Skip to content

Retain Pi and OMP working-title fallback on relays - #16234

Closed
psh4607 wants to merge 1 commit into
stablyai:mainfrom
psh4607:fix/preserve-omp-session-titles
Closed

psh4607 wants to merge 1 commit into
stablyai:mainfrom
psh4607:fix/preserve-omp-session-titles

Conversation

@psh4607

@psh4607 psh4607 commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Main now preserves Pi and OMP semantic working titles locally through #16381. Relay-hosted sessions are different: Orca installs their status hook but not the native titlebar source. Without a relay fallback, a working SSH/WSL pane can keep its old shell or idle title and look done. This keeps the native title locally and restores Orca's generic working title only on relays.

What Changed

  • Pass the existing hook connectionId boundary into the synthetic-title policy.
  • Let Pi and OMP synthesize working titles only for relay-hosted hook events.
  • Keep local native working titles and synthetic done/waiting titles unchanged.
  • Cover relay Pi/OMP behavior while confirming Codex remains unchanged.

Why

#16381 fixed the local root cause for #16093 by disabling Pi/OMP working-title synthesis and preserving the semantic title text. During review of this PR, the SSH path exposed a separate boundary: SshRelaySession.installPluginsOnRelay sends only getPiAgentStatusExtensionSource(...), and PluginOverlay.materializePi installs only orca-agent-status.ts. It does not install the Pi-compatible titlebar extension.

Hook events already carry connectionId: null locally and a non-null relay id for SSH/WSL. Using that existing boundary restores the pre-existing remote fallback without adding an RPC field, stream opcode, or remote payload change.

Linked Issue

Visual Proof

N/A — this is title-writer arbitration with no layout change. No live SSH or Pi/OMP session was available; deterministic policy and adjacent relay/title tests cover the behavior.

Testing

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

TDD evidence:

  • RED: the focused suite failed 1/7 because relay OMP working-title synthesis returned false.
  • GREEN: the focused suite passed 7/7 after the relay-only override; Pi returned true on relay and Codex remained false.

Post-rebase verification on current main:

  • Focused semantic/synthetic title tests: 2 files, 52/52 passed.
  • Adjacent SSH/plugin-overlay/titlebar/renderer/cross-version wire tests: 12 files, 136/136 passed.
  • pnpm lint — passed.
  • pnpm typecheck — passed.
  • pnpm build — passed on macOS. The optional /usr/local/bin/orca-dev symlink reported a permission warning; the build exited 0 and completed all build targets.

The full pnpm test suite was not rerun after this rebase. No Windows, Linux, live SSH, or live Pi/OMP manual run was performed.

AI Disclosure

OpenAI Codex was used for conflict investigation, rebase resolution, implementation verification, self-review, and PR metadata updates under user direction.

Review

  • Security: no input, credential, process, filesystem, or shell surface changes.
  • Cross-platform: uses the existing platform-neutral hook connectionId; Windows was not manually tested.
  • SSH/WSL/wire: retains synthetic working titles for relay events without changing RPC, stream, schema, opcode, or published relay content.
  • Agent compatibility: the relay override is limited to Pi and OMP. Codex, OpenCode, and other profiles are unchanged.
  • Backwards compatibility: local behavior is the fix(terminal): stop Orca mangling the OMP/Pi title it writes itself #16381 contract; relay behavior retains Orca's previous generic working fallback.
  • Performance: local Pi/OMP panes avoid the competing timer; relay panes retain it because no native title source is installed there.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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 test was not rerun after rebase; focused/adjacent tests, pnpm lint, pnpm typecheck, and pnpm build pass

@psh4607
psh4607 marked this pull request as ready for review August 24, 2026 09:03
@psh4607
psh4607 marked this pull request as draft August 24, 2026 09:03
@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62e0576e-4725-4d10-acc6-d29bf9f83f91

📥 Commits

Reviewing files that changed from the base of the PR and between 91a5007 and 33cd04f.

📒 Files selected for processing (3)
  • src/main/index.ts
  • src/shared/synthetic-agent-title.test.ts
  • src/shared/synthetic-agent-title.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/shared/synthetic-agent-title.test.ts
  • src/main/index.ts
  • src/shared/synthetic-agent-title.ts

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


📝 Walkthrough

Walkthrough

Synthetic title decisions now accept relay context. OMP and Pi keep working-title synthesis disabled for local events but enable it for relayed events. Codex remains excluded from relayed working-title synthesis. Terminal-state title behavior remains unchanged. The title hook passes relay status by checking whether connectionId is non-null. Tests cover relayed OMP, Pi, and Codex behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy the linked issue objective [#16093]. Local Pi and OMP sessions keep synthetic working-title synthesis disabled, while relay sessions use the fallback because their native title sou…
Out of Scope Changes check ✅ Passed The changes are limited to relay-aware synthetic title arbitration and related regression tests. No unrelated code, protocol, UI, or infrastructure changes are included.
Title check ✅ Passed The title clearly identifies the primary change: preserving Pi and OMP working-title fallback behavior on relay sessions.
Description check ✅ Passed The description is complete and focused. It explains the problem, implementation, rationale, linked issue context, testing results, limitations, and checklist status. It also provides the required N/A…
Full details: Linked Issues check

Explanation

The changes satisfy the linked issue objective [#16093]. Local Pi and OMP sessions keep synthetic working-title synthesis disabled, while relay sessions use the fallback because their native title source is unavailable. Done and waiting title behavior remains unchanged, and regression tests cover Pi, OMP, and Codex.

Full details: Description check

Explanation

The description is complete and focused. It explains the problem, implementation, rationale, linked issue context, testing results, limitations, and checklist status. It also provides the required N/A explanation for visual proof and documents that the full test suite was not rerun after rebase.

  • Fix all pre-merge checks with AI

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.

@nwparker

Copy link
Copy Markdown
Contributor

Update: the core of this landed in #16381, with credit to you as co-author — but one part of this PR did not land, and I think it may still be needed.

What landed

synthesizeWorkingTitle: false on the pi and omp profiles. Your diagnosis was right and it's the change that stops Orca fighting the agent's own title.

It also turned out to be only half the bug. Orca's normalizeTerminalTitle was separately collapsing every π-branded title to the hardcoded literal "Pi", which is what actually destroyed the session name in #16093 — so removing the synthetic writer alone would not have made the semantic title appear. #16381 fixes that too, plus π ! (agent blocked) classifying as idle, and the brand swap so a pane still reads as its launch owner while keeping the session text.

Verified on a live omp v18.0.4 PTY capture: 70 committed store patches → 5, with OMP > <session name> surviving to the tab.

What did NOT land — and where you may be more right than me

Your synthesizeWorkingTitleOnRelay: true carve-out. I applied synthesizeWorkingTitle: false unconditionally, including on relay.

I independently confirmed your premise: installPluginsOnRelay sends getPiAgentStatusExtensionSource, which is status-only and writes no titles at all (src/main/pi/agent-status-extension-source.ts — zero setTitle/OSC writes), while the local path installs the titlebar extension. So Orca's title source really is absent on relay, exactly as you documented.

My reasoning for skipping the carve-out: OMP's native titler lives in OMP itself (title-generator.ts), not in an extension, and is suppressed only when an extension calls setExtensionTerminalTitle — which the status-only extension never does. So a relay pane should still emit native π ⠋ <label> frames and need no synthesis.

I could not verify that — I have no relay host. If OMP's native titler does not run there for some reason I have not accounted for, relay pi/omp panes lose their working title under #16381 and your carve-out is the correct fix. (Impact would be cosmetic rather than functional: hook payload.state still drives agentStatus:set independently of titles, so working status still surfaces.)

Suggestion

I am deliberately not closing this. The relay question is open and it is your call, not mine. If you can test against a relay/SSH host:

  • Native titles appear on relay → this PR is fully superseded, close it.
  • They do not → the carve-out is a real gap in fix(terminal): stop Orca mangling the OMP/Pi title it writes itself #16381 and worth landing on its own; it would rebase down to just the synthesizeWorkingTitleOnRelay field, the isRelay context param, and its tests, since synthesizeWorkingTitle: false is already on main.

Note this PR now shows CONFLICTING against main because #16381 touches the same profiles.

Thanks for the upstream-source investigation — establishing that OMP owns its own OSC title is what eventually led to finding that Orca was mangling output it had written itself.

@psh4607
psh4607 force-pushed the fix/preserve-omp-session-titles branch from 6f7e6d8 to 33cd04f Compare August 26, 2026 01:45
@psh4607 psh4607 changed the title Preserve OMP and Pi semantic session titles Retain Pi and OMP working-title fallback on relays Aug 26, 2026
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@psh4607

psh4607 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #16381. After rechecking the relay and provider paths, OMP still emits its native OSC working title when Orca installs only the status extension, and Pi also retains its native semantic session title. The relay status extension does not call setTitle(), so a relay-only synthetic fallback would risk overwriting provider-owned titles. I did not run a live SSH OMP/Pi capture because the available SSH target has neither CLI installed; this conclusion is based on the current provider and Orca source paths. Thanks for the clarification @nwparker .

@psh4607 psh4607 closed this Aug 26, 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