Skip to content

fix(pi): the thinking menu before the first message matches the chat's - #34592

Merged
brennanb2025 merged 14 commits into
mainfrom
brennanb2025/pi-thinking-menu
Oct 30, 2026
Merged

brennanb2025 merged 14 commits into
mainfrom
brennanb2025/pi-thinking-menu

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1243 $\color{#cf222e}{\Huge{\mathbf{−}}}$​50 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1193
Prod 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​721 $\color{#cf222e}{\Huge{\mathbf{−}}}$​65 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​656

ELI5

Before you send the first message in a Pi chat, the thinking menu now shows the same choices Pi will offer once the chat is running, instead of a generic list.

What Changed

The final main integration also exposed a capture boundary: a supported display value could replace the remembered raw request. The optional display-only current.reportedEffort now carries Pi's scoped observed effort separately; current.effort and each captured message preserve the raw request. Older clients ignore the extra field; older servers omit it and keep their existing advertised launch/send path. Save/create/send never depend on catalog membership.

Before: before the first message, Orca built the Pi model picker from pi --list-models. That text table only says whether a model can think, so every thinking model got the same five levels (off, minimal, low, medium, high), and labels were made up from model ids. Levels a model doesn't support still showed (for example "off" on a model that can't turn thinking off), and extended levels it does support (xhigh, max) never showed. After the first message the menu switched to Pi's real per-model menu, so the choices changed under the user. A background catalog refresh could switch it back.

After: the pre-session catalog asks Pi for its models over RPC (get_available_models, sessionless with --no-session, same account and launch environment as a chat) and builds each model's menu with the same function a running chat uses (readPiRpcModelOptions). For the same successful RPC inventory, the cold and live menus use one source and one projection. Account-home discovery can still differ from a workspace with its own extensions, and failure fallback retains the old coarse menu. Labels are Pi's own model names. If an extension asks a question while the catalog is being read, Orca answers "cancelled" so Pi can continue. If Pi can't answer over RPC at all (for example a startup extension waiting on a dialog, which Pi 1.1 can't receive before startup finishes), Orca falls back to today's text listing, so no one loses a list they get today.

The list stays per account, read from the home folder, as before. No saved-data format changes: the catalog row already carries per-model thinking levels, and older clients already render them. The existing options response adds the optional display-only field described above. Remembered Pi requests stay intact. With known native support, the picker derives the level Pi will use: off displays Minimal on a model without Off, and a gapped new seed uses Pi's higher-first policy. Catalog membership never admits or refuses a save, create or send. The picker is prospective: picking High keeps High selected for the next message while the preceding message may have run at Minimal. Proof of native application stays separate.

Why

Two parsers of two sources for one fact let the menus drift. The common pattern for Pi is to read the model list over RPC and build the menu from each model's thinking map, with one projection for the new-chat and running-chat menus. That's what this adopts. A model Pi drops during startup isn't shown, since a running chat couldn't use it either.

Alternatives considered:

  • Text listing first, then an RPC refinement: keeps two sources, starts two processes on every refresh, and keeps the coarse menu for any model that only the listing reports.
  • Per-folder Pi lists: needs a new saved-catalog format that failed Windows performance budgets.

Intended differences from the common pattern:

  • Discovery reuses Orca's existing short-lived catalog probe runner instead of a long-lived child.
  • The list is per account rather than per folder.
  • A failed RPC read falls back to the text listing instead of showing no list.
  • Native Pi vocabulary (including minimal) is retained. Known non-reasoning models have no effort control.
  • New-chat and ordinary saved Pi inputs use the same native higher-first supported display. Raw saved and requested values remain unchanged; no seed fitting is restored.
  • Explicit/held requests retain raw values without catalog admission; accepted future picks remain unconfirmed until applied. Frozen queued/replayed inputs and fingerprints remain exact. Unknown or old-host capability evidence adds no new refusal or discovery wait.
  • Desktop/mobile keep their current host-scoped transport and wake paths. The options response adds only optional display-only current.reportedEffort; there is no new subscription or saved state.

Supersedes #32254.

Linked Issue

N/A (maintainer).

Visual Proof

Actual same-profile upgrade from main008a7345 to final14f9bc8, before sending:

Main: remembered Off Final: native choices, Min selected over raw Off
Main unsent Off Final supported cold menu

Two real Pi replies completed at native Minimal then High. Between them, the normal picker retained prospective High while the preceding native level was Minimal:

Prospective High after normal reopen

Credential-free recorded-policy UI fixture, no agent run: normal Medium preference under the full map, then a new chat under the deliberately gapped map. Its journal still stores raw Medium.

Full map: Medium Four choices: derived XHigh
Fixture full-map Medium Fixture new-seed XHigh, unsupported Medium absent
Native iOS: supported Effort segments, XHigh selected Same unsent fixture chat and composer
Shipping native iOS gapped Medium seed derives XHigh Same native iOS fixture with blank composer and XHigh pill

Recorded-policy UI fixture only; no agent run. The visible annotation is fixture provenance.

Testing

Targeted Windows Pi chain completed on14f9bc8: authentic prior-build raw-Off unsent profile, graceful upgrade, supported Min cold selection, actual Minimal reply, normal High selection/reopen over held native Minimal, then actual High reply; exactly two sends in the same native session. The first post-click controls were already enabled, so the pending transient was not observed. A separate host-options response/current.confirmed capture and native request counters were not recorded; automatic post-save readback/projection are source/test evidence, not claimed runtime measurements. The desktop gapped new-seed screenshot passed through normal UI with raw Medium preserved. Shipping-native iOS gap screenshot passed with a raw Medium new reservation, supported-only segments and production-derived XHigh; fixture scope and images above. Existing signed-out/probe/shared-agent and unchanged-menu evidence carries under the fresh flow review; no second full QA round.

The final Windows app stopped gracefully; all33 recorded owned identities were absent and assigned ports clear. Copied auth was removed and five real-config hashes unchanged. The credential-free fixture wrote no native session file; one legitimate real-Pi conversation file remains in its isolated evidence profile. Approximate-birth fixture process receipts and transient inventory limits remain disclosed in the loop report.

  • Full review: six production rounds complete on e9b85a377ad; F1/F2/F3 and the CI-found legacy Claude capture regression are fixed and independently verified. Final three-seat raw/report/capture contract, first-hand whole-mechanism reference comparison and source readiness checks are clean. Deferred P3: injected tests do not execute production extension-dialog cancellation wiring; no reproduced defect.
  • CI green on current head e9b85a377adcd3d1d6ff500b59ef2d1b0a3c98bb: Main 40981253332, Mobile 40981253283, Runtime, Persistence and WSL distro smoke checks; the real WSL-terminal job was skipped. CI owns lint/typecheck/build verification.
  • Targeted contracts cover native model/effort projection, raw Off → displayed Minimal, future High over old native Minimal, exact raw/frozen queue/replay inputs, unknown/old hosts, host61/610-row operation bounds and actual desktop/mobile catalog-refresh callers at6/60 owners. Current-head CI includes the repaired mobile runtime/typecheck boundary.
  • Carried unchanged-flow evidence from 212dd54: real Windows Pi 1.1.0 on the machine's OpenAI sign-in, model openai-codex/gpt-6.1-sol: main-created remembered off resolves to Min; the native/cold/live inventories match all 26 ordered IDs and names. Six supported levels exclude Off and include XHigh/Max. Real Min and XHigh replies complete.
  • Main/branch signed-out UI matches. Actual app RPC probes exit before shutdown without session files. Final graceful stop has no recorded survivors; copied QA Pi auth removed. Real Pi auth hash unchanged; real .claude.json hash changed during the lead session (note only), five other config hashes unchanged.
  • Shared helper representatives: actual Claude Opus5.5 / Med and Codex GPT6.1Sol / Low replies completed. Codex succeeded on retry after team load-balancer429. Bounded main/source trace found no confirmed PR regression in the observed Claude labels or transient Codex failed-turn effort display; exact transient Codex host/render state was not captured.
  • Native iOS shipping-route screenshot: recorded-catalog UI fixture shows six choices, Minimal selected and Off absent; companion shows GPT-6.1 Sol Min. No mobile agent run. Device shutdown/service exits recorded; final helper/listener absence lead-reported. Real .codex/config.toml hash changed (hash note only).

The branch-only native iOS gap case passed on14f9bc8 using the shipping WKWebView route and production mobile bundle in a stock Debug simulator client. Normal phone Create Tab → Pi created one unsent fixture reservation seeded with raw Medium before its first options read. Read-only runtime hook evidence shows newLaunch true, raw Medium unchanged, and a derived XHigh selection among exactly Off/Min/Low/XHigh; no unsupported Medium and no selection tap. The stock four-choice picker uses segments. This is a recorded-policy capability fixture, with zero provider launches, sends, prompts or setOption calls; the visible user bubble is provenance annotation, not a submitted message. All50 safe artifacts were independently fetched and hash-verified, both full native images inspected, and20 shipping-source hashes matched QA head14f9bc8. All47 recorded owned identities were absent, the owned simulator was Shutdown, pairing removed and assigned ports clear. Metro used a forced Node stop. Hash-only changes to .claude.json and .codex/config.toml are noted; the first failed JS build preceded the earliest config baseline. No config contents were inspected. Native build setup needed the current ExpoLocalization module and an iOS16 simulator minimum target; production source was unchanged. This is UI evidence, not a release-device or performance measurement.

  • Automated tests added/updated, or explained why not below

Review

Six production rounds are complete and the final fresh review is clean on e9b85a377adcd3d1d6ff500b59ef2d1b0a3c98bb; exact-head CI is green. db9072831fc integrates main plus optional display-only current.reportedEffort and raw capture in the existing owners; production-boundary tests cover the host response, both client capture callbacks and exact acceptance/native setter. 44aaf468e7a is a further main merge with a fixture-type-only conflict resolution. e9b85a377ad restores main's legacy non-Pi singleton-effort behavior; its unchanged regression passes, and no net appearance difference from main needs a new screenshot. These final changes are tests-row UI/serialization/capture flows: raw Medium still reaches the unchanged native Pi setter and Pi applies XHigh. No lifecycle/observation scheduling/queue/replay algorithm changed. Real Pi evidence and screenshots carry from14f9bc8, with earlier unchanged Claude/Codex evidence; they are not claimed as proof of the new serialization. The loop's existing status comment records the exact QA carry marker and evidence limits.

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

  • SSH/WSL: unchanged; Pi's catalog keeps its existing host routing and launch.
  • Windows: the same managed process and launch path as Pi chats.
  • Mixed versions: catalog rows are unchanged. Updated options responses add optional display-only current.reportedEffort; older clients ignore it, and older servers omit it while keeping their existing advertised action paths.
  • Performance: one RPC child per refresh instead of one listing child. In the fallback case only, one more listing child runs.

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 attached; mobile fixture scope labelled
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • CI lint, typecheck, tests and build checks pass on the head

Pi's pre-session catalog now asks Pi for its models over RPC and builds each
menu with the same projection a running chat uses, falling back to the text
listing only when Pi cannot answer over RPC.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 27, 2026 22:30
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

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: 9cbef491-5bbf-464e-86f1-199d9381f7c3
Commits

Reviewing files that changed from the base of the PR and between 6da91f4 and 49f8c52.

Files selected for processing: 1
  • src/shared/structured-agent-session-option-view.test.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.

Walkthrough

Pi model discovery now tries RPC through a sessionless connection and falls back to --list-models when RPC fails, unless the signal is aborted. Shared effort rules normalize catalog-supported values across model snapshots, session reads, and launch flows. Tests cover live confirmation, remembered effort, startup and dispatch behavior, catalog reads, and queued-message option retention.

Priority: Normal

Merge Risk: Minimal · up to 49f8c

The reviewed test updates do not introduce a merge-blocking behavior or operational risk.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title "fix(pi): the thinking menu before the first message matches the chat's" is related to the main change. The PR makes the Pi thinking menu before the first message use the same per-model RPC-…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description is complete and follows the repository template. It explains the user impact, implementation, rationale, alternatives, linked-issue exception, visual proof, testing, revie…
Full details: Title check

Explanation

The title "fix(pi): the thinking menu before the first message matches the chat's" is related to the main change. The PR makes the Pi thinking menu before the first message use the same per-model RPC-derived options as a running chat. The title is short and names the affected feature (Pi thinking menu). It is slightly awkward, and it does not mention the RPC-based catalog source, but it does describe the primary change.

Full details: Description check

Explanation

The pull request description is complete and follows the repository template. It explains the user impact, implementation, rationale, alternatives, linked-issue exception, visual proof, testing, review status, compatibility considerations, and checklist. The maintainer exception explains the N/A linked issue, and the AI Disclosure section is not required for internal contributors.

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

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

@brennanb2025

brennanb2025 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Pi's menu before the first message used a coarse listing, so it could offer unsupported levels and omit model-specific choices. Both cold and live menus now use Pi's native inventory. The selected value describes the next message: choosing High keeps High selected while the preceding message may still have run at Minimal. Supported display is derived separately from the raw request and from proof of what Pi applied.

The final main integration also exposed a capture boundary: a supported display value could replace the remembered raw request. The optional display-only current.reportedEffort now carries Pi's scoped observed effort separately; current.effort and each captured message preserve the raw request. Older clients ignore the extra field; older servers omit it and keep their existing advertised launch/send path. Save/create/send never depend on catalog membership.

Six production review rounds are complete, with zero new defects in the fresh final review on e9b85a377adcd3d1d6ff500b59ef2d1b0a3c98bb. F1/F2/F3 are fixed, and the legacy Claude capture repair is verified. First-hand comparison with the common pattern and source readiness review are complete. The final three-seat contract preserves raw input and exact captured/frozen messages; native support determines prospective display, never admission. Deferred P3: production extension-dialog cancellation wiring lacks direct injected-test coverage; no reproduced defect.

CI is green on e9b85a377adcd3d1d6ff500b59ef2d1b0a3c98bb: main checks40981253332, Mobile verify40981253283, including all12 unit shards, static typechecks, packaging, platform runtimes, wire compatibility and WSL distro smoke checks. The real WSL-terminal job was skipped. The deterministic legacy Claude capture regression exposed by shard1 was reproduced and repaired in one production line; the existing assertion is unchanged and18 focused tests pass. Operation-count contracts cover host catalog61/610 rows and actual desktop/mobile refresh callers6/60 owners. No measured runtime speedup is claimed.

Evidence carry: real runs and Pi screenshots are on 14f9bc82ca330b72a7820251a958b5337219725c, with unchanged Claude/Codex evidence carried from212dd54. Later db9072831fc adds the optional response/report split and raw capture in existing owners; production host-read → both client capture → exact acceptance/native-boundary tests cover it. 44aaf468e7a is a main merge with a fixture-type-only conflict resolution. e9b85a377ad restores main's legacy non-Pi singleton-effort behavior; the unchanged actual desktop capture regression and18 focused tests cover that tests-row flow. It has no net visual change from main, so it needs no additional screenshot. Fresh source tracing types all final resolution changes as UI/serialization/capture tests rows: raw Medium still reaches the unchanged Pi setter and Pi applies XHigh. No native lifecycle, observation scheduling, shared acceptance, queue/drain or replay algorithm changed. The original real-run evidence carries; it does not prove the new response serialization. Pi Min/High/gap appearance is unchanged, so its existing screenshots carry.

Targeted Pi evidence on14f9bc8: an authentic main008a7345 profile saved Off before sending, stopped gracefully, and opened on the final build. With Pi1.1 and the machine’s OpenAI model, the recovered cold menu showed six supported choices with Min selected and Off absent. Two normal sends completed in the same native session: “Amber leaves drift.” at native Minimal, then “Quiet rivers shine.” at native High. Between them, selecting High and reopening the picker retained High while the native checkpoint still recorded Minimal. The first post-click controls were already enabled; the pending transient was not observed. A separate host-options response and its confirmation field were not captured, so that exact completion is not claimed; automatic post-save readback and its projection are source/test evidence. Native request counts and provider-wire mapping were not measured. The initial empty-account rig state was repaired through the authorized normal command setting before this evidence was captured.

The real-chain app stopped gracefully, its recorded Pi child was absent, the copied auth was removed, and the five real-config hashes were unchanged. The one legitimate conversation file remains within the isolated evidence profile; sessionless discovery cleanup is the carried evidence below. This is the one changed Pi run-row after resolution. The separate desktop fixture passed: after a normal Medium preference, graceful restart and capability-only change, a new Pi tab retained raw Medium in its journal and displayed XHigh among exactly Off/Min/Low/XHigh. The first cached seven-choice image is invalid gap evidence and was preserved separately. An ordinary catalog read after its ten-minute freshness interval supplied the four-choice input. This is a credential-free recorded-policy UI fixture; no gapped-provider reply is claimed. The shipping-native-iOS gap screenshot passed as detailed below.

The following unchanged evidence carries from212dd54080c4dc46a8bb7ae93861b85b01713b47: real Pi1.1/OpenAI cold/live equality across26 ordered native IDs/names and six efforts, real Minimal/XHigh replies; signed-out main/branch No Models parity; sessionless probe exit/no-session-file evidence; one successful real reply each with Claude and Codex; shipping iOS six-choice Minimal appearance. The fresh flow review found no changed shared lifecycle flow requiring another Claude/Codex run. Main's merge alone and the test-only commit do not stale these flows.

Prior Windows cleanup verified the recorded owned identities absent after graceful stops; copied Pi auth was removed and real Pi auth hash unchanged. One shared-agent run's real .claude.json hash changed, noted without reading contents. Codex's first429 was capacity, followed by the successful real retry pictured below. Old mobile shutdown and service exits were recorded, final helper absence lead-reported without a separate census; Metro used a forced stop. Its lease expired during a transport delay after the rig stopped; saved artifacts were recovered and hash-verified. These limitations are retained rather than promoted to stronger evidence.

For Brennan's review:

Main008a7345: remembered Off, before sending Final14f9bc8: same raw Off, native Min selected
Main unsent Off Final cold supported menu and Min
Real reply at native Minimal Next real reply at native High
Pi completed Amber leaves drift at Minimal Pi completed Quiet rivers shine at High

Between these replies, High stays selected for the next message while native Pi still records the preceding Minimal level. Exact host-response/confirmation instrumentation limits are stated above.

Prospective High after ordinary reopen

The following is a recorded-policy UI fixture, with no agent run. Both images are on the branch: a normal Medium preference under the full map, then a new chat under the deliberately gapped map. Raw Medium remains saved; the displayed selection becomes XHigh.

Full fixture map: Medium selected Gapped fixture map: XHigh selected, Medium absent
Recorded-policy full-map Medium fixture Recorded-policy four-choice new seed derived XHigh

Full unsent fixture caption and composer.

Signed out on main Signed out on branch
Main signed-out No Models state Branch same signed-out state
Claude: completed Copper bells ring. Codex: completed Cedar paths wind. after capacity retry
Claude actual completed native reply Codex actual completed native retry, earlier429 visible

The branch-only native iOS gap case passed on14f9bc8 using the shipping WKWebView route and production mobile bundle in a stock Debug simulator client. Normal phone Create Tab → Pi created one unsent fixture reservation seeded with raw Medium before its first options read. Read-only runtime hook evidence shows newLaunch true, raw Medium unchanged, and a derived XHigh selection among exactly Off/Min/Low/XHigh; no unsupported Medium and no selection tap. The stock four-choice picker uses segments. This is a recorded-policy capability fixture, with zero provider launches, sends, prompts or setOption calls; the visible user bubble is provenance annotation, not a submitted message. All50 safe artifacts were independently fetched and hash-verified, both full native images inspected, and20 shipping-source hashes matched QA head14f9bc8. All47 recorded owned identities were absent, the owned simulator was Shutdown, pairing removed and assigned ports clear. Metro used a forced Node stop. Hash-only changes to .claude.json and .codex/config.toml are noted; the first failed JS build preceded the earliest config baseline. No config contents were inspected. Native build setup needed the current ExpoLocalization module and an iOS16 simulator minimum target; production source was unchanged. This is UI evidence, not a release-device or performance measurement.

Native iOS: supported Effort segments, XHigh selected Same unsent fixture chat and composer
Shipping native iOS gapped Medium seed derives XHigh Same native iOS fixture with blank composer and XHigh pill

Recorded-policy UI fixture only; no agent run. The visible annotation is fixture provenance.

Judgment points: native supported display, prospective selection projection, and separate native application proof.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

Pi’s pre-chat thinking menu now uses the same model data and menu builder as a running chat. Remembered effort choices stay separate from what Pi reports applying.

  • Pi’s new-chat menu uses the same model choices as a running chat.
  • Pi’s effort picker shows supported choices without replacing the saved request.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Pre-chat discovery] --> B[Pi model RPC]
  B --> C[Shared menu builder]
  D[Running chat] --> C
  B -->|Request fails| E[Text listing fallback]
  C --> F[Desktop and mobile menus]
  E --> F
Loading

Reviews (2) · Last reviewed commit: "test: isolate host fixture types from cl..." · Reviewed by Greptile

@brennanb2025
brennanb2025 merged commit b578e30 into main Oct 30, 2026
54 checks passed
AmoabaKelvin pushed a commit that referenced this pull request Oct 30, 2026
…6242)

#34592 made the effort picker hide any model whose effort menu is
unconfirmed (effortsKnown: false), which Pi needs because its menus are exact.
#36158 relies on OMP showing exactly such recorded menus for models that are
not running, so the two merged into failing OMP tests on main. The hide now
applies to Pi only; OMP, Claude and Codex offer unconfirmed menus as before.
@brennanb2025
brennanb2025 deleted the brennanb2025/pi-thinking-menu branch October 30, 2026 07:27
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.

1 participant