Skip to content

feat(pi): offer a thinking level for Pi terminal launches - #41006

Merged
AmoabaKelvin merged 1 commit into
mainfrom
pi-launcher-model-effort
Nov 11, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
pi-launcher-model-effort

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

The Pi panel in the + menu now has a thinking-level row (off to max) for terminal launches, so Pi can start thinking harder or less. Leave it alone and Pi uses its own default.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​30 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25

What Changed

Builds on the Pi model fix #41005 (merged).

Before: the panel had no thinking control for a Pi terminal launch.

After:

  • Pi's launch catalog gains an effort option that maps to pi --thinking <level>, using Pi's own levels (PI_THINKING_LEVELS). An untouched control sends nothing.
  • sourceControlActionOptions now reads the launch catalog. For every other agent this is the same object as before, and OpenCode's launch catalog has no options. With that change, the terminal surface shows the row, narrowed to the levels the picked model supports: Claude Haiku 4.5 offers off to High.
  • A --thinking already in Pi's Arguments becomes a choice only when it names one of Pi's levels. Any other value stays literal.

Why

The issue asks for thinking effort next to the model choice. The row is the existing launcher option control, and the chat surface already had it. This adds the CLI mapping so terminal launches can use it too. It is new UI, so it waits for a product OK.

Linked Issue

Fixes #39155. The model half is fixed in #41005.

Visual Proof

Before: see #41005. The panel had no thinking row for a terminal launch.

After, with real Pi 1.5.0: Claude Haiku 4.5 plus High picked, and the Pi TUI it launched.

(screenshot removed: contained real product data)
(screenshot removed: contained real product data)

Testing

  • Hidden dev build with real Pi 1.5.0 (captures above). A Haiku 4.5 + Low pick then Launch chat opened the chat on Claude Haiku 4.5 · Low, the same chat path as before.

  • tui-agent-startup-session-options.spec.ts now also checks that a picked thinking level replaces a configured --thinking. agent-choice-cli-apply.test.ts checks that --thinking ultra stays literal. Both fail without the change.

  • Focused suites ran with --maxWorkers=2 (74 files). oxlint and oxfmt --check ran on the changed files.

  • The wide unit-test step of pnpm check:changed was skipped locally because its fan-out hung. CI is the gate for it.

  • 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

Level: Low

  • Pi's effort row on the chat surface now uses the launch option's mapping. The chat still applies effort over RPC, and the labels and choices are unchanged.
  • When the model list is still loading or no model is picked, the row shows all seven levels. Pi clamps levels a model can't run.
  • A plain revert backs this out.

AI Disclosure

Review

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

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

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)
  • I stated the risk: what could break, for whom, and how to back it out
  • 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)

The launcher's Pi panel now shows Pi's thinking levels on the terminal
surface, narrowed to what the picked model supports, and a pick starts
Pi with `--thinking <level>`. Untouched, Pi keeps its own default.

Co-authored-by: lucas-wu-wakakak <[email protected]>
@AmoabaKelvin
AmoabaKelvin force-pushed the pi-launcher-model-effort branch from f01202f to 8dbc9e8 Compare November 11, 2026 03:56
@AmoabaKelvin
AmoabaKelvin changed the base branch from pi-launcher-model to main November 11, 2026 03:56
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Pi option catalog adds a reasoning-effort selector based on PI_THINKING_LEVELS and recognizes only supported --thinking values. The tests check that an unsupported value remains unrecognized and that picked model and effort values are used in the launch command while --no-skills remains. Source-control action options now obtain the agent catalog through getAgentSessionOptionLaunchCatalog.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 8dbc9

This adds a thinking-level control for Pi terminal launches. Untouched controls send no flag, and unsupported values stay literal. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding a thinking level for Pi terminal launches.
Description check Passed The description covers the required sections, including the user-facing change, implementation details, motivation, linked issue, visual proof, testing, risk, rollback, and checklist status. The skipp…
Linked Issues check Passed Issue #39155 requires Pi terminal launches to honor the selected model and to provide supported thinking levels while preserving Pi defaults when no option is selected. PI_LAUNCH_OPTION_CATALOG maps…
Out of Scope Changes check Passed The changed production files implement Pi launch-option mapping and make the launcher read launch options. The changed tests cover the Pi terminal command and literal argument behavior. These changes …
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Description check

Explanation

The description covers the required sections, including the user-facing change, implementation details, motivation, linked issue, visual proof, testing, risk, rollback, and checklist status. The skipped wide test step is disclosed with CI identified as the gate.

Full details: Linked Issues check

Explanation

Issue #39155 requires Pi terminal launches to honor the selected model and to provide supported thinking levels while preserving Pi defaults when no option is selected. PI_LAUNCH_OPTION_CATALOG maps the selected model to --model and adds the effort selector from PI_THINKING_LEVELS. Its default is empty, and valid values map to --thinking; unsupported values remain literal. sourceControlActionOptions reads the launch catalog, so the Pi option reaches terminal launches. The startup test verifies that selected model and effort replace configured values and preserve --no-skills. The reported literal-argument test verifies that --thinking ultra remains unchanged.

Full details: Out of Scope Changes check

Explanation

The changed production files implement Pi launch-option mapping and make the launcher read launch options. The changed tests cover the Pi terminal command and literal argument behavior. These changes directly support issue #39155. No unrelated production behavior is demonstrated; the catalog lookup preserves existing handling for other agents.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 47c5eb47-4c43-428a-ade9-5a05a56bc168
Commits

Reviewing files that changed from the base of the PR and between bb1d478 and 8dbc9e8.

Files selected for processing: 4

  • src/shared/agent-launch/choices/agent-choice-cli-apply.test.ts
  • src/shared/agent-launch/startup/tui-agent-startup-session-options.spec.ts
  • src/shared/agent-session/options/agent-session-option-catalog-pi.ts
  • src/shared/source-control/ai/recipes/source-control-action-options.ts

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

@AmoabaKelvin
AmoabaKelvin merged commit 3e0b7f7 into main Nov 11, 2026
51 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the pi-launcher-model-effort branch November 11, 2026 04:43
lucas-wu-wakakak added a commit to lucas-wu-wakakak/orca that referenced this pull request Nov 14, 2026
… and effort

Pi's launch catalog landed in stablyai#41005/stablyai#41006 for terminal launches, but it
never opted into worker launch preferences, so the shared gate that both
`orca agent launch` and `orca orchestration worker-start` go through still
refused every Pi model pick:

  invalid_argument: Agent pi does not support launch-time model selection.

Every other cataloged agent sets supportsWorkerLaunchPreferences; Pi now does
too. Pi chats are untouched: chat picks still apply over RPC, and the catalog
stays launch-only (getAgentSessionOptionCatalog('pi') is still null).

Fixes stablyai#36544
Refs stablyai#41005 stablyai#41006 stablyai#39155 stablyai#36587
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
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.
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
…#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.
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
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.
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
…#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.
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
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.
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
…#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.
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
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.
nplez1 added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
…#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.
lab-agent-np Bot added a commit to nplez1/orca that referenced this pull request Nov 17, 2026
…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]>
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.

[Bug]: New-tab Pi launcher ignores model selection and lacks thinking-effort options

1 participant