Repository navigation
Description
What
Orca has no launch-time model selection for the pi agent. --model/--effort are refused outright instead of being applied, and the refusal is a capability gap rather than a user error, so every caller that wants a pi worker on a named model has to bypass orca agent launch entirely.
Repro (Orca 1.4.214-np.50, macOS, pi 1.4.0 / Pi-Bolt 1.0.7)
$ orca-np agent launch --agent pi --model deepseek/deepseek-flash-auto --effort high \
--worktree name:some-worktree --prompt hi --json
{
"id": "local",
"ok": false,
"error": {
"code": "invalid_argument",
"message": "Agent pi does not support launch-time model selection. Omit --model to run the model from its own config."
},
"_meta": { "runtimeId": null }
}
Same for orca worktree create --agent pi --model …: the flag is accepted by the parser and then refused by the capability check.
Worse: it used to fail silently. On 1.4.214-np.45 the same command returned ok: true and started the agent on pi's own settings.json default (verified from the resulting pi session: {"provider":"isoquant","modelId":"deepseek-v4.1-flash-1017-fast"} while --model deepseek/deepseek-flash-auto was requested). So callers can be pinned to neither an error nor the requested behaviour depending on host version.
Where it comes from (fork source, HEAD 3babb8f5f8)
src/shared/agent-session-option-catalog.ts:35—CATALOGScoversantigravity, claude, codebuddy, codex, gemini, cursor, grok, muse, omp. Nopientry, sogetAgentSessionOptionLaunchCatalog('pi')isnull.src/shared/agent-launch-model-preferences.ts:50-57—checkAgentLaunchModelPreferencesrefuses any agent whose catalog is missing (or has nomodelApply.launchArgs), which is that error string.src/shared/automation-extra-agent-args.ts:32-46— the extra-arguments allowlist has nopieither (omp: [MODEL_OPTION]is the closest example), so there is no second path to pass a model.src/shared/agent-session-option-catalog-omp.ts:20— OMP, which is pi-compatible and consumes the samePI_CODING_AGENT_DIR/extension contract (src/shared/pi-agent-kind.ts), does have--model.
What pi's CLI actually supports
pi --model <provider/id> # also "<provider/id>:<thinking>" shorthand
pi --thinking <level> # off | minimal | low | medium | high | xhigh | max
So both halves of a launch pin map onto real flags; nothing has to be composed or typed into the TUI.
Expected
- A
pisession-option catalog (mirroring the OMP one) soorca agent launch --agent pi --model <provider/id> --effort <level>(andorca worktree create --agent pi --model …) starts pi with--model <provider/id> --thinking <level>. --effort→--thinkingfor pi specifically (pi's flag is--thinking, not--effort), with pi's valid levels accepted and anything else refused.- When the host cannot apply a model, keep the explicit refusal (as
np.50does) rather than dropping the flag — the silent version is what made this expensive to notice.
Why it matters
Any orchestration caller that needs a specific model per worker is locked out: orca-np refuses, so automation has to launch agents through orca terminal create --command "pi --model … --thinking …" and hand-deliver the prompt, which loses agent launch's prompt plumbing, title/conversation naming and operation replay. In this lab that is the agent:auto driver (nplez1/homelab, automation/agent-driver): it resolves an implementer model from ~/.config/pi-config/model-roles.json and had to move from --model to a terminal command because of this.
Workaround in use today
orca-np terminal create --worktree path:<worktree> --command \
'pi --model deepseek/deepseek-flash-auto --thinking high "$(cat .agent-brief.md)"'
Verified: the session starts on deepseek/deepseek-flash-auto at thinkingLevel: high, and Orca does register the pane as an agent row (agentType: "pi", paneKey, state transitions) — so process detection is fine; only the launch argument path is missing.
Activity
lab-agent-np commentedon Nov 17, 2026
Picked up in workspace
auto-434.nplez1 commentedon Nov 17, 2026
Plan (Opus planner,
claude/opus, high reasoning, tool enabled)Finding first: the feature already landed, and shipped
The two halves the issue asks for are both on
main, and both are ancestors of this branch:3e0b7f791a2 feat(pi): offer a thinking level for Pi terminal launches (#41006)—--effort→--thinking.d0882ca38c2 fix(pi): accept --model/--effort for Pi agent launch and worker-start (#42255)—supportsWorkerLaunchPreferences: true,isPiModelOptionId, theprovider/idrefusal, and the host capabilityagent.launch.pi-model.v1.git tag --contains d0882ca38c2→v1.4.214-np.56. The repro in this issue is against1.4.214-np.50, whose base is3babb8f5f8(2026-10-17) — older than both commits. So the repro no longer reproduces on np.56 or onmain;orca agent launch --agent pi --model <provider/id> --effort <level>compiles to--model <provider/id> --thinking <level>,orca worktree create --agent pi --model …goes through the same validator, and the extra-arguments allowlist now carriespi: [--model, --thinking].What is actually missing
The regression coverage stablyai#42255 shipped was deleted by an unrelated sweep.
b9b4a115c53 test: remove low-value CLI dashboard and browser examples (#42316)removed:src/shared/agent-launch/choices/agent-launch-model-preferences.test.ts(pi accepts--model/--effortand compiles to--model … --thinking …; non-provider/idmodels are refused);refuses a Pi model on a host that would start Pi on its default modelcase insrc/cli/index-agent-launch.test.ts— the only guard on expected behaviour 3 of this issue.Nothing else in the suites asserts pi
--thinking, pi model acceptance, or the capability refusal (rg AGENT_LAUNCH_PI_MODEL_RUNTIME_CAPABILITYreturns only the implementation and the contract file).Approach
A test-only PR: restore both deleted pi tests, adapted to the current layout, plus one assertion for expected behaviour 2 ("anything else refused"). No production code changes.
The one candidate code change I considered and rejected: gating a federated
orchestration worker-start --agent pi --model …on the remote'sagent.launch.pi-model.v1. It is redundant. The execution host already resolves the alias and runs the same validator duringorchestration.federationAttachStart—legacy-remote/federation.ts:65→prepareFederationWorkerLaunchOnHost(worker-opencode-model-preflight.ts:21) →prepareFederationConfiguredWorkerStart(worker-configured-agent-preflight.ts:29) →resolveWorkerStartAgent(worker-start-validation.ts:153) →resolveWorkerLaunchPreferences→checkAgentLaunchModelPreferences, which refuses when its own pi catalog lackssupportsWorkerLaunchPreferences(agent-launch-model-preferences.ts:56-61). That check runs before any worktree is created (federation.ts:65precedes:70), andisKnownRemoteStartFailuretreatsinvalid_argumentas a known failure (federated-worker-start-receipts.ts:3-12), so the home host records a failed dispatch and reports it. There is no silent-drop window on worker-start, and a home-sideagent === 'pi'test would also miss alias-mapped pi agents, whose aliases only the remote can resolve.File map
src/shared/agent-launch/choices/agent-launch-model-preferences.test.ts(new)resolveAgentSessionOptionLaunchimport moved to../../agent-session/options/launch/agent-session-option-launch, plus an out-of-range effort refusal.src/cli/index-agent-launch.test.tsokFixture; both pi constants).Risks
src/shared/**counts as a global input, so the unit gate applies.Acceptance criteria
checkAgentLaunchModelPreferences({agent:'pi', model:'deepseek/deepseek-flash', effort:'xhigh'})returns the preferences, andresolveAgentSessionOptionLaunch('pi', …).argsis['--model','deepseek/deepseek-flash','--thinking','xhigh'].sonnet,/sonnet,anthropic/and an effort outside pi's levels are refusedinvalid_argument.orca agent launch --agent pi --model …against a host withoutagent.launch.pi-model.v1exits 1 withincompatible_runtimeand makes no launch call.supportsWorkerLaunchPreferences: trueor the--thinkingapply turns 1 red; deleting the pi branch incallAgentLaunch(agent-launch-request.ts:146-155) turns 3 red.Test strategy
pnpm test src/shared/agent-launch/choices/agent-launch-model-preferences.test.ts,pnpm test src/cli/index-agent-launch.test.ts,pnpm tc,pnpm check:code-quality:changed main, and the unit gate for the global-input classification. Each restored test is re-checked against the repo's "do not add tests by default" rule: it fails if the behaviour is reverted, its expected values are literals rather than read from the catalog, and it runs at the single layer that owns the behaviour.Product calls
agent.launch.pi-model.v1for orchestration rather than minting anorchestration.*id — moot now that the orchestration gate is dropped; if it were ever wanted, the existing capability means exactly "this host's pi catalog applies--model/--thinking", and a new id would be false on every currently paired host.agent === 'pi'on the home host.listModelsprobe plus a change toagentPickerListsCliModels; thinking levels already appear in the launcher since feat(pi): offer a thinking level for Pi terminal launches stablyai/orca#41006.test(pi): restore the Pi launch model and thinking coverage (#434)
test(pi): re-home the Pi launch model coverage stablyai#42316 deleted (…
test(pi): pin the pi launch catalog lookup with an assertion that can…
nplez1 commentedon Nov 17, 2026
Outcome: the feature is already on
mainand shipped inv1.4.214-np.56, so this is version skew rather than a missing capability.3e0b7f791a2(feat(pi): offer a thinking level for Pi terminal launches stablyai/orca#41006) — the--effort→--thinkingoption inPI_LAUNCH_OPTION_CATALOG.d0882ca38c2(fix(pi): accept --model/--effort for Pi agent launch and worker-start stablyai/orca#42255) —supportsWorkerLaunchPreferences: true, theprovider/idrefusal, thepiextra-arguments allowlist entry, andagent.launch.pi-model.v1so an old host refuses instead of starting Pi on its default model.git tag --contains d0882ca38c2→v1.4.214-np.56. The repro's base3babb8f5f8(2026-10-17) predates both, which is why np.50 refuses exactly as reported.What was missing was the regression coverage:
b9b4a115c53(stablyai#42316, "remove low-value CLI dashboard and browser examples") deletedagent-launch-model-preferences.test.tsand theagent.launch.pi-model.v1refusal case inindex-agent-launch.test.tsas collateral of an examples sweep. The branch restores those cases in surviving suites (perlocal/sync/convergence-ledger.md§ "Test inventories retired upstream") and records the decision there.Two constraints the issue did not state, both resolved in the branch's favour of "no code change":
orca orchestration worker-start --agent pi --model …needs no new capability gate: the execution host already runs the same validator duringorchestration.federationAttachStartand refuses before any worktree is created, and a home-sideagent === 'pi'test would miss alias-mapped Pi agents.listModelsprobe and is a separate change.test(pi): restore the Pi launch model and thinking coverage (#434)
test(pi): re-home the Pi launch model coverage stablyai#42316 deleted (…
test(pi): pin the pi launch catalog lookup with an assertion that can…
test(pi): restore the Pi launch model and thinking coverage (#434)
test(pi): re-home the Pi launch model coverage stablyai#42316 deleted (…
test(pi): pin the pi launch catalog lookup with an assertion that can…
test(pi): restore the Pi launch model and thinking coverage (#434)
test(pi): re-home the Pi launch model coverage stablyai#42316 deleted (…
test(pi): pin the pi launch catalog lookup with an assertion that can…
[Feature]: pi agent has no launch-time model selection — add a pi ses…