Skip to content

feat(orchestration): support pi and devin worker launch models - #27012

Open
Gabrielgvl wants to merge 3 commits into
stablyai:mainfrom
Gabrielgvl:feat/pi-devin-worker-launch-models
Open

Gabrielgvl wants to merge 3 commits into
stablyai:mainfrom
Gabrielgvl:feat/pi-devin-worker-launch-models

Conversation

@Gabrielgvl

Copy link
Copy Markdown

ELI5

Orca coordinators can already pick a model (and effort) when they launch some worker agents. This PR makes that work for the pi and devin CLIs too: worker-start --agent pi --model <provider/id> --effort <level> starts pi --model <id> --thinking <level>, and worker-start --agent devin --model <id> starts devin --model <id> — per worker launch, without touching machine-wide config files that concurrent coordinators could race on.

What Changed

  • pi: new session-option catalog entry opting into worker launch preferences. Model launches as --model <provider/id>; Orca --effort maps to pi's --thinking flag using pi's own level domain (off|minimal|low|medium|high|xhigh|max). Model discovery comes from pi --list-models (text table parsed into provider/model ids, reasoning-capable rows marked). Configured pi --model/--thinking args are replaced rather than duplicated.
  • devin: catalog entry with model only — devin --model <id>. Devin encodes effort in the model id (e.g. swe-2-medium) and has no effort flag, so --effort is refused up front, as it is for OMP. Model discovery comes from devin models list --format json (families → variants with labels, descriptions, context windows). Configured devin --model args are replaced; permission/trust args are preserved.
  • Receipt: launch.effective reports the requested model/effort for both agents — the same admission-record semantics the seven previously opted agents already have.
  • Arg plumbing: pi and devin required-value option lists added to agentArgTerminatorIndex/VALUE_OPTIONS so overrides insert before -- and value tokens are never mistaken for flags.
  • Shared helpers: extracted parseJsonObject into model-list-json-output.ts (shared by OMP and devin probes) and reused process-output-field-scanner line iteration in the pi and commit-message parsers instead of a third copy.
  • Docs/help: --model/--effort help, orchestration docs, and bundled skill guides list the newly supported agents.

Why

Issue #26971 asks for launch-scoped model selection for pi and devin workers. The session-option catalog + launchPreferences path is the established mechanism (OMP #24796, OpenCode #24624/#24768), so this extends it rather than adding per-agent flag handling or config mutation. This supersedes the earlier pi attempt #17704 by @kukapu (Albert Alvarez Estelles) — same pi-side mechanism, rebased onto the current catalog architecture and paired with devin support.

Linked Issue

Fixes #26971

Visual Proof

N/A — CLI/RPC-only change; no UI surface is altered.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Platform tested: Linux (this host). Discovery commands verified against the real installed CLIs: pi 1.1.0 (--list-models, --thinking domain) and devin 3000.11.3 (models list --format json shape). New focused tests cover: both catalogs, launch args for pi model+thinking and devin model, devin --effort refusal, configured-flag replacement/dedup, terminator insertion, receipt values, and probe-spec ownership. Commands run:

pnpm install                     # exit 0
pnpm lint                        # exit 0
pnpm typecheck                   # exit 0
pnpm test                        # exit 1 — see below
pnpm build                       # exit 0
pnpm test <focused files>        # exit 0 (150 tests)
node config/scripts/generate-bundled-skill-guides.mjs --check   # exit 0

pnpm test (full suite, repo-pinned Bun 1.4.2): 117,135 pass / 56 fail across 20 files. Every failure is a host-integration test needing resources this machine lacks or forbids touching — real fish/zsh binaries, PTY process groups, cross-version relay fixtures, missing agent CLIs, live Electron windows. None touch the changed code paths; all catalog/launch/receipt/discovery tests pass.

AI Disclosure

Author: GitHub @Gabrielgvl · X @kvlao. Implemented by Devin (SWE-2 Max) as a dispatched Orca worker; independently reviewed by pi-review (cross-model, 3 rounds).

Review

AI review summary (pi-review, adversarial finders + refuters):

  • Cross-platform: all new logic is argv composition and stdout parsing — no paths, shells, or platform APIs. Windows spawning stays inside the existing runProcess plumbing; -- terminator handling is covered by tests.
  • SSH/remote/local: model discovery runs through the existing probe-spec/host plumbing OMP already uses; nothing assumes a local-only execution host.
  • Supported-agent compatibility: the change opts pi and devin into a generic mechanism without editing shared resolution semantics; all other agents' catalogs and the --extra-agent-args allowlist are untouched.
  • Performance: discovery runs only on demand (pickers/probes); parsers are single-pass line scanners with the shared 4096-char field cap.
  • Security: argv arrays only (no shell interpolation), model ids pass through as opaque single tokens, no secrets or config mutation.

One known semantic note kept open by reviewers: for structured (native-chat) pi workers, launch preferences are seeded into the session exactly like a saved chat selection — if pi's session layer rejects a value, the worker runs with the configured model while the receipt still records the request. That is the existing contract shared by every opted structured agent; making launch.effective provider-verified would be a generic settlement change spanning all of them and is deliberately out of scope here.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No issues expected in: security (argv-only flag composition), cross-platform (Linux verified; pure argv/JSON logic elsewhere), Remote SSH (existing probe plumbing), Mobile (untouched), backwards compatibility (additive opt-in; --effort/--model flags previously rejected for these agents), performance (on-demand probes only).

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

worker-start --model/--effort rejected pi and devin because neither had a
session-option catalog. Add both, following the OMP pattern:

- pi maps effort to --thinking (off|minimal|low|medium|high|xhigh|max) and
  discovers models through `pi --list-models`.
- devin is model-only -- effort is part of the model id and it has no
  effort flag, so --effort is refused. Discovery reads
  `devin models list --format json`.
- Both strip a configured --model/--thinking before injecting the launch
  flags, so the flag is never sent twice.

The pi table parser moves into pi-model-list-probe.ts, shared by
commit-message discovery, the RPC catalog probe, and the new catalog; it
also gains the minimal and max levels pi's flag domain lists.
…spec

- reuse iterateProcessOutputLines/getProcessOutputFields for the pi table
  and commit-message parsers instead of a third private copy
- extract the noisy-stdout JSON object extraction both omp and devin model
  listings need into model-list-json-output.ts
- pin the devin MODEL_DISCOVERY_ONLY_SPECS entry with an owner-boundary
  test like grok's, and align the pi thinking default with the parser's
  'low'
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0cc60006-6689-4080-b373-8ee8401c78b4

📥 Commits

Reviewing files that changed from the base of the PR and between 404e54d and c9f28ae.


📒 Files selected for processing (23)
  • docs/site/content/docs/cli/orchestration.mdx
  • skill-guides/orchestration/references/coordinator-loop.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/specs/orchestration-worker-specs.ts
  • src/main/pi/rpc-model-catalog-probe.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.test.ts
  • src/shared/agent-model-probe-spec.test.ts
  • src/shared/agent-model-probe-spec.ts
  • src/shared/agent-session-option-agent-args.ts
  • src/shared/agent-session-option-catalog-devin.test.ts
  • src/shared/agent-session-option-catalog-devin.ts
  • src/shared/agent-session-option-catalog-pi.test.ts
  • src/shared/agent-session-option-catalog-pi.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/commit-message-agent-spec.test.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/commit-message-agent-specs-primary.ts
  • src/shared/commit-message-model-parsers.ts
  • src/shared/devin-model-list-probe.ts
  • src/shared/model-list-json-output.ts
  • src/shared/omp-model-list-probe.ts
  • src/shared/pi-model-list-probe.ts
  • src/shared/tui-agent-startup-session-options.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The change adds dynamic model discovery and launch-time model selection for Pi and Devin. Pi effort preferences map to its --thinking flag. Devin accepts model selection, with effort encoded in the model ID. The change also updates Pi model-list parsing, shares JSON model-list output parsing with OMP, adds launch and parser tests, and updates orchestration documentation.


Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to c9f28

This change adds model selection for pi and devin workers, plus thinking-level selection for pi. Nothing in the supplied material points to a merge-blocking problem. The author-reported failures in host-integration tests are said to be in unrelated paths.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 47.06% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 20 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding worker launch model support for Pi and Devin.
Description check Passed The description includes all required sections, links issue #26971, explains the change and rationale, documents testing and known full-suite failures, and completes the checklist.
Linked Issues check Passed Direct issue #26971 has coding requirements for launch-scoped model selection and receipt values for pi and devin. PI_SESSION_OPTION_CATALOG enables worker preferences, maps model to --model…
Out of Scope Changes check Passed The changed files stay connected to #26971. Catalog code, probe parsers, argument-plumbing updates, launch and probe tests, receipt tests, help text, orchestration documentation, and bundled skill-gui…

Full details: Docstring Coverage

Explanation

Docstring coverage is 47.06% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 20 files. (2 skipped: 2 unsupported.)



  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

orchestration worker-start: accept --model (and --effort) for the pi and devin agents

1 participant