Skip to content

A Pi or OMP helper session no longer takes over its lead's terminal pane - #32261

Closed
brennanb2025 wants to merge 23 commits into
mainfrom
brennanb2025/sta-11554-pi-root-owner
Closed

brennanb2025 wants to merge 23 commits into
mainfrom
brennanb2025/sta-11554-pi-root-owner

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1409 $\color{#cf222e}{\Huge{\mathbf{−}}}$​243 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1166
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​281 $\color{#cf222e}{\Huge{\mathbf{−}}}$​118 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​163

A Pi or OMP helper could replace its lead's terminal tab identity, title and Session History resume target. The lead conversation appeared gone, and an Orca restart resumed the helper. Status and title registrations inside one CLI process shared ownership and delivery state.

The selected lead now keeps its pane, title and saved resume target when a helper starts or finishes. Explicit new, resume, fork and reload remain supported, including selecting a former helper and fileless Pi successors. History stays flat, the saved format stays the same, and previously rebound entries are not repaired. Tracked in STA-11554.

Status and title consume one process-local session selection and retire independently. Shared delivery and roster state are adopted only after selection. OMP18 role declarations reject declared sub starts; a later SDK helper declared main cannot replace an already selected lead on startup. Explicit switch/branch can select another session. Pi1.3 and OMP17 use the first eligible start and explicit provider lifecycle transitions; Pi replacements follow predecessor and announced-shutdown facts. Model commands and native answers remain provider actions.

The 10-24 tripwire panel selected the simpler common pattern. The helper-attention registry, retained request bodies, context liveness probes, replay and receiver snapshot protocol are removed. Separate helper reporting cannot take over the pane. Lead-local Pi modal waiting, native questions, OMP approvals and plan answers, and parent-side subagent progress/completion holds remain. The Pi receiver and question recognizer return to main's existing behavior. In particular, unsaved Pi /new no longer turns a startup metadata event into a blank Done row.

Intended limits: a helper created by another extension before the lead starts can win the first-start fallback; a CLI already running during an Orca upgrade can retain its old reporting behavior until CLI restart. No new saved field, wire operation, capability, minimum version, command wrapper or user-facing control is added. Independently supplied SDK UI is possible, but no existing actionable same-pane helper flow requiring a separate relay was established. The stock Pi helper binds no UI; its existing roster-event mismatch is outside scope. No independent helper-request persistence, answer router or History grouping is promised.

Validation on c425a5e: both reported regressions fail against the prior head and pass after the fix. The tests use authentic OMP18 default-main context facts for status/title selection, and real pinned Pi1.3 SessionManagers with actual Pi argv through the generated sender, real normalizer, hook server and visible-row selector for unsaved /new. Persisted /resume remains an identity-only control; no visible resume regression is claimed. Targeted runs cover 282 passing tests across 18 named files. Attention-only tests were removed while retaining the two-manager regression, delivery, transition, native-lead and cross-version contracts. Source plus all harness, smoke and workflow support totals 440 changed lines against the merged main base, below the binding 560 ceiling; test deletions provide no budget credit. The normal hook passed.

The original three review rounds and single main sync are retained. The fresh delta review is complete with no proved new findings and refs=done. Current-head CI is complete: 26 successful and 16 skipped checks, CLEAN and out of draft. Targeted current-head Pi/OMP delta QA is complete on macOS. Real Pi helper late-result, selected-lead modal completion/Yes/close, unsaved /new, persisted /resume, literal pi, actual OMP18 SDK-default-main helper construction after lead selection, explicit former-helper resume/reply and desktop History targets all matched selected and persisted identities. The prior saved fd profile was upgraded into this candidate and yielded real continuation replies. The final existing status comment links the screenshots and precise limits. Earlier Windows/POSIX evidence applies only to unchanged flows. The changed default-main startup and /new behavior is not claimed as exercised on Windows; the requested Windows host is unreachable and needs a person, and this delta contains no Windows-specific code. No second full QA round or main merge is planned.

Historical QA observations remain qualified: the original released Pi pane lacked a valid resume target before this delta, and frozen released control also restored a shell; OMP17's original missing-anchor failure was followed by a successful natural-anchor cold restore. Earlier Pi/OMP18 initial live-status gaps traced to unchanged resume/OSC projection after successful full-row persistence/hydration. Native session content and later real replies were retained. Provider/rig failures and the unexecuted disposal-survivor variant remain recorded. These observations are neither new-head passes nor waivers. Prime status behavior is unchanged; its generated title source consumes the same selector but its executable does not use the OMP declaration branch. Unchanged phone consumers use their tests under the QA table; no shared Claude/Codex identity path changes remain.

QA cleanup: graceful Browser.close, 34 recorded process identities checked, zero owned survivors and zero admitted-port listeners; ticket2257 released. Nine config hashes were unchanged; real .codex/auth.json changed, with cause unestablished and no credential contents read/copied/edited. The hash-only observation is recorded. The stock Pi helper used a model-supplied one-turn limit and returned the requested result late; this is not an unlimited-helper or survival-across-/new claim. Original failed/qualified cells remain qualified.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 23, 2026 08:52
@coderabbitai

coderabbitai Bot commented Oct 23, 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: e9b491a7-9b2c-4bf5-8f16-ad3687ff3529
📥 Commits

Reviewing files that changed from the base of the PR and between 07c2b36 and 3b6ecf1.

📒 Files selected for processing: 1
  • src/main/pi/omp-transcript-metadata.test.ts

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

Walkthrough

The change adds lifecycle-based session authority for Pi status handling. Declared main sessions can own status, while sub-session attention can be forwarded or retained for the owner. Generated handlers use shared Pi UI state and updated registration paths. The test harness adds session-scoped hooks and event emitters. Tests cover session identity, helper activity, session transitions, reload callbacks, and OMP lifecycle listeners.

Priority: Normal

Merge Risk: Low · up to 3b6ec

The lead pane may briefly show incorrect helper activity during ownership transitions; the remaining issue is localized and suitable for bounded follow-up.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 20 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description contains detailed change, rationale, scope, testing, and limitation information, but it does not follow the required template structure. It omits the required section headings, an actu… Rewrite the description using all required template sections. Add a valid linked issue reference, provide visual proof or state N/A with a reason, complete the Testing and Checklist items, include AI Disclosure when applicable, and docume…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title states the main change: a Pi or OMP helper session no longer takes over the lead session's terminal pane. The raw summary and PR objectives both center on keeping the lead's pane, saved resu…
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.
Full details: Title check

Explanation

The title states the main change: a Pi or OMP helper session no longer takes over the lead session's terminal pane. The raw summary and PR objectives both center on keeping the lead's pane, saved resume target, model, prompt, and completion. The title is concise, specific, and matches the changeset. At 72 characters and 14 words it is slightly long but still a single clear sentence.

Full details: Description check

Explanation

The description contains detailed change, rationale, scope, testing, and limitation information, but it does not follow the required template structure. It omits the required section headings, an actual linked issue in the Fixes # field, explicit visual proof or N/A, AI disclosure, review details, and completed checklist items.

Resolution

Rewrite the description using all required template sections. Add a valid linked issue reference, provide visual proof or state N/A with a reason, complete the Testing and Checklist items, include AI Disclosure when applicable, and document Review, Agent skill upstream boundary, and Notes explicitly.

✨ Finishing Touches: 💡 1
📝 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ 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: dda8119e-94b3-43d5-a1f4-4481fff21cb7
📥 Commits

Reviewing files that changed from the base of the PR and between b4ee652 and 9c9ad49.

📒 Files selected for processing: 11
  • src/main/pi/agent-status-declared-session.test.ts
  • src/main/pi/agent-status-extension-omp-lifecycle.test.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/main/pi/agent-status-extension-test-harness.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-post-queue-source.ts
  • src/main/pi/agent-status-session-boundary-source.ts
  • src/main/pi/agent-status-subagent-roster-source.ts
  • src/main/pi/agent-status-ui-prompt-source.ts
  • src/main/pi/omp-model-command-source.ts
  • src/main/pi/omp-session-status-owner-source.ts

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

@brennanb2025 brennanb2025 changed the title OMP 18: a helper session no longer takes over its lead's terminal pane A Pi or OMP helper session no longer takes over its lead’s terminal pane Oct 23, 2026
@brennanb2025 brennanb2025 changed the title A Pi or OMP helper session no longer takes over its lead’s terminal pane A Pi or OMP helper session no longer takes over its lead's terminal pane Oct 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ 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: b2a17592-8551-4a09-b4b2-11abf47aec6a
📥 Commits

Reviewing files that changed from the base of the PR and between d17c5ff and 25adcc3.

📒 Files selected for processing: 12
  • src/main/pi/agent-status-completion-delivery.test.ts
  • src/main/pi/agent-status-declared-session.test.ts
  • src/main/pi/agent-status-extension-async-subagents.test.ts
  • src/main/pi/agent-status-extension-omp-lifecycle.test.ts
  • src/main/pi/agent-status-extension-omp-model.test.ts
  • src/main/pi/agent-status-extension-session-change.test.ts
  • src/main/pi/agent-status-extension-source.test.ts
  • src/main/pi/agent-status-extension-source.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-ui-prompt-source.ts
  • src/main/pi/omp-session-status-owner-source.ts
  • src/main/pi/omp-session-status-owner.test.ts
💤 Files with no reviewable changes: 1
  • src/main/pi/agent-status-handler-source.ts

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

@brennanb2025

brennanb2025 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

A helper inside a Pi or OMP process could replace the lead terminal's title and saved resume identity. The lead appeared gone, and an Orca restart resumed the helper. This PR selects one lead for status/title, defers shared setup until selection, and retires status and title registrations independently. Explicit new/resume/fork/reload and former-helper selection remain supported; History stays flat and earlier rebound entries are not repaired.

The 10-24 tripwire panel chose the simpler common pattern. Independent helper attention delivery, request maps, liveness probing and receiver snapshots are removed. Lead-native Pi modal waiting, OMP answers and parent-side child progress remain. The same selector now rejects a later SDK-default-main OMP18 startup over an existing lead; explicit switches still select it. Restoring the existing Pi receiver also fixes blank Done after unsaved /new. No second ownership guard, saved field, wire operation or command wrapper was added. Intended limits remain: an unmarked helper created before the lead may win first-start selection, and an already-running old CLI can retain legacy behavior until restart.

The original three review rounds and first main sync are retained. The final one-round tripwire panel and one independent delta review completed on c425a5e, with no proved new finding; the whole reference comparison is complete. Both reported regressions fail against the previous production head and pass after the fix. The reviewer independently ran both risk files. Targeted final test executions total 282 passes across18 named files; they are a union, not a single full-suite run. Attention-only assertions were removed while preserving the real two-SessionManager/real-Pi-argv, lifecycle, delivery and cross-version contracts. Source plus all support is 440/560 changed lines:289 production,102 harness/context,43 runtime smoke,6 workflow. Test deletion gives no budget credit. Normal hook passed. Current-head CI completed 26 successful,16 skipped checks, including typechecking, Windows packaging and Pi runtime contracts on Windows/macOS/Ubuntu; GitHub reported CLEAN/out of draft.

Targeted real macOS Pi1.3 + helper0.22 and OMP18.12.6 delta QA completed on this head. The genuine prior fd saved profile was upgraded and continued with real replies. Actual Pi helper late result kept lead ID/path/title/status/persisted resume and History target; native lead modal stayed waiting after actual completion, then Yes returned true and settled. Unsaved /new had no file and retained the prior nonblank row; materialization and persisted /resume followed the right session. Plain pi returned a real reply. Actual OMP SDK construction omitted depth/prefix and declared main after the lead; its real result did not rebind the lead. Explicit former-helper resume then selected that transcript, produced a new reply and matched the History Jump target. Native files, rendered pixels and persisted projections were checked separately; driver exit0 alone is not the verdict.

The Pi helper used model-supplied max_turns1 and displayed steered/turn-limit wording; the requested real result arrived late. This is not an unlimited-helper or survival-across-/new claim. The OMP invocation frame is not a separately prolonged working interval; native startup/result records cover the default-main case. Prior unchanged alias/fork/reload/restart/OMP17/Prime/Windows evidence carries, with its existing qualifications. Windows delta not executed: no Windows-specific code change; requested host unreachable and needs a person. No new-head Windows pass or waiver is claimed. Unchanged phone consumers use tests; no shared Claude/Codex identity path changed.

Historical qualifications remain: the original released Pi frozen pane lacked resume authority before this delta and released control also restored a shell; the earlier removal write is unknown. Original OMP17 no-anchor recovery failed before a different natural-anchor recovery passed. Initial Pi/OMP18 live-status gaps traced to unchanged resume/OSC projection despite full persisted/hydrated rows and intact conversations. Original provider/rig failures, stock-tool failures and the unexecuted disposed-lead/independent-helper-survivor variant remain qualified. Independent SDK successes do not pass stock-tool failures. No new PR-specific defect was established and no repair/waiver was invented.

Cleanup: graceful Browser.close,34 exact process identities checked,0 owned survivors,0 admitted-port listeners; ticket2257 released. Nine real-config hashes unchanged; .codex/auth.json changed, cause unestablished, hash-only observation recorded. No credential contents read/copied/edited.

For Brennan's review — current-head whole-window evidence:

Flow Screenshot
Pi helper finishes after lead; selected pane stays lead (stock one-turn qualification) Pi helper finishes after lead; selected pane stays lead (stock one-turn qualification)
Pi lead modal stays waiting after actual lead completion Pi lead modal stays waiting after actual lead completion
Native Yes resolves true; lead continues and settles Native Yes resolves true; lead continues and settles
Pi /new before transcript exists; no blank Done publication Pi /new before transcript exists; no blank Done publication
Pi persisted /resume and real reply Pi persisted /resume and real reply
Literal pi startup and real reply Literal pi startup and real reply
OMP18 SDK-default-main helper returns; lead remains selected OMP18 SDK-default-main helper returns; lead remains selected
User explicitly resumes former helper and gets real reply User explicitly resumes former helper and gets real reply
OMP desktop History Jump target and original/new helper replies OMP desktop History Jump target and original/new helper replies
Carried baseline / unchanged-flow proof (earlier head; precise limits above)
Evidence Screenshot
Prior-release Pi helper Jump binding, before the ownership fix Prior-release Pi helper Jump binding, before the ownership fix
Windows OMP17 natural-anchor cold restore and History (unchanged flow) Windows OMP17 natural-anchor cold restore and History (unchanged flow)
Windows configured Prime cold restore and new replies (unchanged flow) Windows configured Prime cold restore and new replies (unchanged flow)

Judgment spots: single lifecycle selection, deferred adoption and cleanup, real-manager startup regression.

After main advanced, merge conflicts blocked this PR. Merge 56781d9 brings in main 870038c. The single Pi turn-start conflict retains this PR’s modal/turn state resets and main’s reply-timestamp reset. The required merge lint-staged check passed, and an independent narrow merge review found no broken flow. CI on the merge head completed: 42 checks (26 successful, 16 skipped), including the aggregate PR gate, Windows packaging, all Node test shards and Pi runtime on Windows/macOS/Ubuntu. Existing real-run evidence remains on c425a5e; no additional QA was needed for this main merge, and all earlier qualifications remain.

Main’s repository-wide comment cleanup later introduced conflicts. Merge 9bd99a5 brings in main 7d18e19. Ten Pi conflicts preserve this PR’s executable behavior and regression assertions while retaining the comment cleanup. The required merge lint-staged check passed; independent narrow review verified both parents and found no broken flow. The first merged-head CI run passed TypeScript compilation and all three Pi runtime platforms, but a newly introduced main ratchet rejected the unchanged test fixture’s wall-clock timestamp. Test-only commit 409481d replaces it with a fixed timestamp; its normal hook passed. CI on corrected head 409481d completed: 42 checks (26 successful, 16 skipped), including the aggregate gate, all Node test shards, Windows packaging, WSL and Pi runtime on Windows/macOS/Ubuntu. GitHub reports CLEAN/MERGEABLE. Existing QA evidence stays on c425a5e, with the same qualifications; this merge required no QA rerun.

After main advanced again, merge a3cd89f brings in main 843e502. The three conflicts preserve the OMP helper-takeover and Pi unsaved /new fixes. The existing shared selector also supplies main’s newly added helper-takeover behavior; no second ownership election was added. Main’s new regressions remain, with their declarations and identity fixtures integrated. Required merge lint-staged passed, and an independent narrow review found no merge-introduced broken flow. CI on this latest merged head completed: 42 checks (26 successful, 16 skipped), including the aggregate gate, all Node test shards, Windows packaging, WSL and Pi runtime on Windows/macOS/Ubuntu. GitHub reports CLEAN/MERGEABLE. No retry was needed. Existing QA remains on c425a5e with all earlier qualifications; no QA rerun was required.

@nwparker

Copy link
Copy Markdown
Contributor

Superseded by #33595 (merged, co-authored by you), which fixes the Pi helper takeover (status, resume, title) with a smaller change. OMP was left as on main: the installed OMP 18 doesn't expose role declarations to extensions and main's OMP gate already rejects other sessions. Reopen if OMP needs the broader handling.

@nwparker nwparker closed this Oct 25, 2026
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.

2 participants