Repository navigation
fix(pi): accept --model/--effort for Pi agent launch and worker-start - #42255
Conversation
c3bb16d to
31638bd
Compare
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
Pi's launch catalog now opts into launch-time model/effort preferences, so `orca agent launch --agent pi` and `orca orchestration worker-start --agent pi` accept `--model <provider/id>` and `--effort <level>` instead of refusing. Pi models without a provider/id shape are refused up front, before a worktree or worker is created. A new host capability, `agent.launch.pi-model.v1`, lets the CLI refuse a Pi model/effort on older execution hosts that would otherwise start Pi on its default model. Co-authored-by: powerPC <[email protected]>
31638bd to
2b711ea
Compare
The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the two deleted cases so a reverted catalog flag, a reverted --thinking apply or a dropped capability gate fails again.
…#434) The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the coverage in surviving suites rather than by restoring the retired file, and record the decision in the sync ledger.
The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the two deleted cases so a reverted catalog flag, a reverted --thinking apply or a dropped capability gate fails again.
…#434) The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the coverage in surviving suites rather than by restoring the retired file, and record the decision in the sync ledger.
The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the two deleted cases so a reverted catalog flag, a reverted --thinking apply or a dropped capability gate fails again.
…#434) The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the coverage in surviving suites rather than by restoring the retired file, and record the decision in the sync ledger.
The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the two deleted cases so a reverted catalog flag, a reverted --thinking apply or a dropped capability gate fails again.
…#434) The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the coverage in surviving suites rather than by restoring the retired file, and record the decision in the sync ledger.
…sion-option catalog (--model / --thinking) (#444) * test(pi): restore the Pi launch model and thinking coverage (#434) The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the two deleted cases so a reverted catalog flag, a reverted --thinking apply or a dropped capability gate fails again. * test(pi): re-home the Pi launch model coverage stablyai#42316 deleted (#434) The Pi launch catalog, the provider/id refusal and the agent.launch.pi-model.v1 host capability shipped in stablyai#41006 and stablyai#42255, but stablyai#42316 removed every test that pinned them. Restore the coverage in surviving suites rather than by restoring the retired file, and record the decision in the sync ledger. * test(pi): pin the pi launch catalog lookup with an assertion that can fail (#434) Round-2 review: getAgentSessionOptionLaunchCatalog returns null, never undefined, so toBeDefined() could not fail when the pi branch was deleted. --------- Co-authored-by: Nathan Plesnicher <[email protected]>
ELI5
If you asked Orca to start the Pi agent on a specific AI model or thinking level from the command line, Orca refused and told you to set it in Pi's own config. The desktop launcher could already do this. Now
orca agent launchandorca orchestration worker-startcan too. You write the model asprovider/model. If the computer that runs Pi has an older Orca that can't apply your choice, you get a clear "update Orca" message. Pi does not quietly start on the wrong model.What Changed
Before:
orca agent launch --agent pi --model anthropic/claude-sonnet-4-5 --effort low(andworker-start --agent pi --model ...) failed withinvalid_argument: Agent pi does not support launch-time model selection.Nothing was started.After: both commands accept Pi's
--model <provider/id>and--effort <level>. Pi starts with--model <id> --thinking <level>.How it works:
PI_LAUNCH_OPTION_CATALOGnow setssupportsWorkerLaunchPreferences: true. That flag is whatcheckAgentLaunchModelPreferences, the shared gate behindagent launchandworker-start, checks. Every other cataloged agent already set it.isPiModelOptionIdinagent-session-option-catalog-pi.ts, whichparsePiModelOptionIdnow also uses. The gate refuses Pi models that are notprovider/id(sonnet,/x,a/) withinvalid_argument. This happens before any worktree or worker is created. Without it, the request would only fail later, inside the Pi chat.agent.launch.pi-model.v1.callAgentLaunchis used byagent launchandworktree create --agent pi. It refuses a Pi launch that carries--model/--effortwithincompatible_runtimewhen the host does not advertise this capability, so an older host never silently drops the model.docs/site/content/docs/cli/orchestration.mdx.Why
#41005 and #41006 gave Pi a launch catalog and wired it into the desktop launcher, but the catalog never opted into launch-time preferences, so both CLI paths kept refusing. The opt-in is the root-cause fix. The provider/id check and the host capability make mixed-version and chat-surface cases fail early and clearly instead of starting Pi on its default model.
getAgentSessionOptionCatalog('pi')staysnull. Pi chats keep their own RPC model list.Linked Issue
Fixes #36544
Visual Proof
N/A. This changes CLI argument handling and process launch only. Nothing in the UI renders differently.
Testing
Reproduced on main: with the non-test sources reverted to the merge base, the regression tests and a probe failed 4 of 8 cases with "Agent pi does not support launch-time model selection". That included worker-start
resolveWorkerLaunchPreferences({ agent: 'pi', model: 'anthropic/claude-sonnet-4-5', effort: 'high' }). All pass on this branch.agent-launch-model-preferences.test.ts: the gate accepts a Pi model and effort and resolves them to['--model', M, '--thinking', 'xhigh']. It refusessonnet,/sonnetandanthropic/.index-agent-launch.test.ts: an older host withoutagent.launch.pi-model.v1gets a Pi model refused before any launch or create call. I confirmed this test fails when the gate is disabled.Targeted suites (src/cli/agents, src/cli/specs, src/main/pi, src/shared/agent-session/options, src/shared/agent-launch, worker and agent-launch RPC methods): 100 files / 571 tests pass on macOS.
oxlint, oxfmt, anti-slop oxlint, native-plugin oxlint, ast-grep, and the changed-code quality gate all pass on the touched files.
End-to-end by the original author: a branch-built CLI ran
worktree create --agent pi --model deepseek/deepseek-flash --effort high, and the Pi session showeddeepseek-flash • highon its status line.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Risk
The riskiest part is mixed-version behavior. The new CLI refuses a Pi
--model/--efforton any host that does not advertiseagent.launch.pi-model.v1. That includes v1.4.258-era hosts, which could actually apply the model. This errs toward refusing, never toward silently dropping the model. Users on those hosts see "Update Orca on the execution host, or omit --model." Pi--modelnow needs an exactprovider/id. Pi's CLI fuzzy matching of bare names is not available through Orca, and the docs already sayprovider/id. Federated worker-start still uses the existingorchestration.worker-launch-preferences.v1gate, and the remote host rechecks with its own catalog. A plain revert backs this out. No data or settings are migrated.Level: Low
Review
Cross-platform: values go through the existing launch-catalog serializers and reach Pi as separate argv entries. No shell strings are built. Remote/SSH: covered by the host capability and the existing worker-launch-preferences capability. Folder workspaces: the catalog does not depend on workspace kind. Mobile: no changes.
Agent skill upstream boundary
Notes
Original fix by @lucas-wu-wakakak in #42255. Their commit was squashed into this one, and their authorship is kept as a
Co-authored-bytrailer.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (targeted suites and static gates pass locally; full typecheck/test left to CI)