Per-run model choice on the subagent authorization card

Overview

When a subagent tool call needs approval (the tool authorization gate is in ask mode), the Authorization required card now carries a model picker. Before tapping Allow once / Allow for session / Always allow, the user can choose which model executes this delegated run. The choice is a one-off: nothing is persisted on the chat, the agent, or the project — the next subagent call uses the chat's model again (or the agent's pinned model).

Usage

The picker appears only on subagent approval cards. It lists the same union the main chat model picker shows:

{
  "modelOverride": { "providerId": "openrouter", "modelId": "anthropic/claude-sonnet-4" },
  "thinkingLevel": "medium"
}

and the nested call runs on that model — with that reasoning effort — for this invocation only. Deny still ignores the pick.

Precedence

Model resolution for the delegated run, most specific first:

  1. Authorization-card pick — the user explicitly approved this run on a model, so it wins over everything else.

  2. Agent model pin — a named agent's modelId (Settings → Project → Agents) applies when no card pick was made.

  3. Chat model — the fallback for a generic subagent with no pin.

    Thinking level follows the same precedence: the card's pick wins, then the agent's thinkingLevel, then the chat's inherited level.

Regression check

With debug Chrome available at http://127.0.0.1:9222 (or CDP_URL), run:

node scripts/test-auth-model-picker.cjs

The test mounts the real AuthModelPicker on an isolated about:blank tab with an in-memory localStorage shim, seeds a pinned model and a server-backed recent entry, opens the sheet, and asserts both bookmark sections render. It does not modify app data.