Repository navigation
fix(terminal): stop Orca mangling the OMP/Pi title it writes itself - #16381
Conversation
📝 WalkthroughWalkthroughThe change preserves OMP and Pi session and working-directory text during title normalization. Braille spinner frames are canonicalized, and separator states receive explicit status classification. Ownership conversion replaces only the compatible agent brand. OMP and Pi working-title synthesis is disabled while terminal-state synthesis remains active. Runtime title updates now process supplied titles directly. Regression tests cover normalization, ownership, PTY flows, runtime propagation, sidebar titles, and published tab titles. Merge Risk: 🟡 Moderate · up to The change stops title flicker and preserves session identity, but multiplexer-wrapped permission or idle titles may still be shown without the correct agent state, which can mislead users about whether an agent needs attention. Merge should wait for this bounded classification issue to be addressed or explicitly accepted. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is detailed and on-topic. It explains the root cause, implementation, design decisions, testing, compatibility impact, known limitations, and review status. Some template headings are not reproduced explicitly, including Linked Issue and Visual Proof, but the core change and validation information are complete. Full details: Docstring CoverageExplanation Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 18 files. (1 skipped: 1 too large.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
Scope correction pushedPost-review found a real bug in the first version of this PR, now fixed in
That is #16093's complaint reintroduced through the signature — the exact thing this PR's predecessor was careful to avoid. My original test suite missed it because it only asserted that a single semantic title passes through storage unmodified, never that a change between two still commits. Fix: fold only exact bare identity frames, matched per wrapper segment via Full matrix, measured through the real suppressor:
Regression test added for the semantic-change case. Suite is now 8 tests. Re-verified: 19,785 passed / 67 skipped across Deliberately not in this PRRender-time owner relabel. Without it, a tab whose first committed frame was Known limitationA genuine same-group handoff in one pane (quit OMP, run |
02d4179 to
52eab18
Compare
Replaces the ingest-time title rewrite from #16373 with a non-destructive fix at the actual cause. The churn suppressor `isDecorativeAgentTitleFrameChange` keyed on the literal label, so `working:OMP` and `working:Pi` compared unequal and every alternating frame from a wrapped harness committed a store patch. #16373 made the labels agree by rewriting the stored title to the tab's launch owner — but `runtimePaneTitlesByTabId` is also the Windows Shift+Enter byte-encoding input, so normalizing at ingest destroyed evidence other consumers read (fixed separately in #16376). Collapse the identity group inside the signature instead. Which member of a group a frame names is decoration, exactly like the spinner glyph the signature already strips, so frames compare equal without touching what is stored. Suppression now changes only WHETHER a frame commits, never WHAT it says. Also fixes the flap under a multiplexer (#8032): the collapse runs over wrapper segments, so "zsh | ⠋ Pi" and "zsh | ⠙ OMP" compare equal, which the anchored owner-relabel in #16373 never matched. Reverts the store changes from #16373 and drops the helper it added. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
A legacy "π - <session> - <cwd>" title is Pi-compatible too, so folding every profile match collapsed two different sessions to the same signature and suppressed the change outright — reintroducing #16093 through the churn signature. Fold only exact bare identity frames, matched per wrapper segment, so semantic session titles keep comparing on their own text. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
Verified against the OMP source: it emits only π-glyph frames (`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an Orca-hosted pane its native titler cedes to Orca's own injected extension, which writes `⠋ π - <session> - <cwd>`. So OMP emits neither "OMP" nor "Pi". Both flap sides are Orca's: "OMP" from driveSyntheticTitleFromHook, "Pi" from normalizeTerminalTitle collapsing our own extension's output to a hardcoded literal. The prior header credited the wrapped harness for frames it never sends, which is the same wrong narrative that produced eight fixes at eight layers. No behavior change.
Verified against the OMP source: it emits only π-branded frames
(`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an
Orca-hosted pane its native titler cedes to Orca's OWN injected extension,
which writes `π - <session> - <cwd>` / `⠋ π - <session> - <cwd>` at 80ms.
So neither flapping string came from OMP. Orca made both:
"Pi" — normalizeTerminalTitle collapsing our extension's output to a
hardcoded literal, discarding the session name and cwd (#16093)
"OMP" — driveSyntheticTitleFromHook injecting over it every 80ms
Fixed at the source:
- normalizeTerminalTitle canonicalizes only the rotating braille frame and
keeps the rest, in both spinner positions and through a multiplexer
prefix (#8032). Status still round-trips through normalization.
- detectAgentStatusFromTitle reads the π state separator, so `π ! <label>`
is permission instead of the blanket idle that hid a blocked agent.
- normalizeCompatibleAgentTitleForOwner swaps only the brand for the
owner's label, so a pane still reads as its launch owner (#6689, #7633,
#9077) without losing the session text.
- pi/omp set synthesizeWorkingTitle: false — the agent animates its own
working title. Terminal states still synthesize; they carry the pane's
agent identity downstream.
Reverts the ingest-time title rewrite from #16373, whose normalization of
runtimePaneTitlesByTabId also changed Windows Shift+Enter bytes (#16376).
Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
The separator check runs on every title, so `omp - deploy notes` and `pi - refactor the parser` read as an idle agent. The owner rewrite only ever emits the exact profile labels, so dropping case-insensitivity keeps `OMP - tmp` classifying while ordinary prose stops matching. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
Drives 30 working frames as Orca's injected extension emits them plus the idle transition, and asserts what survives the churn gate. Before the fix every frame alternated "⠋ Pi"/"⠋ OMP" and each one committed — ~12 store patches per second on a working tab. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
ba7868a to
2f50a80
Compare
`-` is both a π state separator and the delimiter in the synthetic permission label, so `OMP - action required` read as idle. It resolved correctly only because detectAgentStatusFromTitle happens to check the synthetic label first — and the separator fn is exported, so a direct caller inherited the bug. Also pins the owner rewrite's fixed-point property, which holds only because getAgentLabel does not tokenize omp/pi, and corrects a comment that overstated how tightly the brand swap is scoped. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
The suite header cited `synthesizeTerminalTitle: false`; the profiles set `synthesizeWorkingTitle: false`. The distinction is the whole reason the narrower flag was chosen — terminal-state frames still carry the pane's agent identity downstream — so the wrong name buried the rationale. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
|
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. |
1 similar comment
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f3750b37-9a83-4dfe-a313-720a76718bf3
📒 Files selected for processing (18)
src/main/runtime/orca-runtime.test.tssrc/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.tssrc/renderer/src/components/terminal-pane/pty-connection-task-complete-dispatch.test.tssrc/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.tssrc/renderer/src/components/terminal-pane/pty-transport-pi-coalesce.test.tssrc/renderer/src/components/terminal-pane/pty-transport-pi-spinner.test.tssrc/renderer/src/lib/agent-status.test.tssrc/renderer/src/store/slices/repro-omp-pi-alternating-title-frame-churn.test.tssrc/renderer/src/store/slices/terminal-tab-title-batch.tssrc/renderer/src/store/terminals/terminal-tab-presentation.tssrc/shared/agent-detection.test.tssrc/shared/agent-title-owner.tssrc/shared/agent-title-status.tssrc/shared/omp-pi-semantic-title-preservation.test.tssrc/shared/pi-compatible-synthetic-title.tssrc/shared/synthetic-agent-title.test.tssrc/shared/synthetic-agent-title.tstests/e2e/session-tabs-decorative-title-fanout.unit.test.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/store/slices/repro-omp-pi-alternating-title-frame-churn.test.ts
🚧 Files skipped from review as they are similar to previous changes (15)
- src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts
- src/renderer/src/components/terminal-pane/pty-connection-task-complete-dispatch.test.ts
- src/renderer/src/lib/agent-status.test.ts
- src/renderer/src/components/terminal-pane/pty-transport-pi-spinner.test.ts
- src/shared/synthetic-agent-title.test.ts
- src/renderer/src/store/slices/terminal-tab-title-batch.ts
- src/renderer/src/store/terminals/terminal-tab-presentation.ts
- src/shared/synthetic-agent-title.ts
- src/main/runtime/orca-runtime.test.ts
- src/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.ts
- tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts
- src/shared/agent-detection.test.ts
- src/shared/agent-title-status.ts
- src/renderer/src/components/terminal-pane/pty-transport-pi-coalesce.test.ts
- src/shared/omp-pi-semantic-title-preservation.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| // may already have been swapped for the owner's label, so accept those too — but only in their | ||
| // exact profile casing, since a lowercase `pi - refactor…` is ordinary prose, not a Pi title. | ||
| // The separator must be delimited (`:` attached, or spaced) or `omp-harness` reads as a state. | ||
| const PI_COMPATIBLE_SEPARATOR_RE = /^\s*(?:π|Pi|OMP)(?::|\s+([!>-]))(?=\s|$)/u |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- src/shared/pi-compatible-synthetic-title.ts ---'
cat -n src/shared/pi-compatible-synthetic-title.ts
printf '%s\n' '--- detectAgentStatusFromTitle and direct dependencies ---'
sed -n '130,270p' src/shared/agent-title-status.ts
printf '%s\n' '--- wrapper title definitions and uses ---'
rg -n -A8 -B8 'getWrapperTitleSegments|normalizeTerminalTitle|detectAgentStatusFromTitle' src/sharedRepository: stablyai/orca
Length of output: 50369
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- imports and title checks in src/shared/agent-title-status.ts ---'
sed -n '1,125p' src/shared/agent-title-status.ts
printf '%s\n' '--- Pi title predicate ---'
rg -n -A18 -B8 'function isPiTerminalTitle|const isPiTerminalTitle|isPiTerminalTitle' src/shared
printf '%s\n' '--- complete wrapper segmentation contract ---'
cat -n src/shared/terminal-title-wrapper-segments.tsRepository: stablyai/orca
Length of output: 12611
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- containsLegacyAgentName binding and implementation ---'
rg -n -A24 -B12 'containsLegacyAgentName|titleHasAnyLegacyAgentName|AGENT_NAMES' src/shared/agent-title-core.ts src/shared/agent-name-token-match.ts
printf '%s\n' '--- wrapped-title status tests and exact fallback behavior ---'
rg -n -A10 -B10 'zsh \|.*π|multiplexer|wrapped.*status|status.*wrapped' src/sharedRepository: stablyai/orca
Length of output: 23114
Handle multiplexer-wrapped titles.
getPiCompatibleTitleSeparatorStatus checks the full title, so zsh | π ! session and zsh | π > session bypass the separator check and return no status from detectAgentStatusFromTitle. Check getWrapperTitleSegments(title) before evaluating the ! and > states.
Verified against a live OMP installCaptured the raw OSC title stream from a real What OMP actually emits — exactly the source-derived format, confirmed on the wire: OMP emits neither Replaying those exact captured frames through OrcaOn The session name With this PR: Five commits, each a genuine state change, and the display carries both the OMP owner identity (#6689/#7633/#9077) and the session name (#16093). The reported symptom, reproduced and eliminatedInterleaving the live frames with the synthetic writer as
That alternation between Closes the one gap called out in the PR description: everything else was verified from source and by executing Orca's functions; this is the live wire capture. |
…tablyai#16381) * fix(terminal): collapse identity group in the title churn signature Replaces the ingest-time title rewrite from stablyai#16373 with a non-destructive fix at the actual cause. The churn suppressor `isDecorativeAgentTitleFrameChange` keyed on the literal label, so `working:OMP` and `working:Pi` compared unequal and every alternating frame from a wrapped harness committed a store patch. stablyai#16373 made the labels agree by rewriting the stored title to the tab's launch owner — but `runtimePaneTitlesByTabId` is also the Windows Shift+Enter byte-encoding input, so normalizing at ingest destroyed evidence other consumers read (fixed separately in stablyai#16376). Collapse the identity group inside the signature instead. Which member of a group a frame names is decoration, exactly like the spinner glyph the signature already strips, so frames compare equal without touching what is stored. Suppression now changes only WHETHER a frame commits, never WHAT it says. Also fixes the flap under a multiplexer (stablyai#8032): the collapse runs over wrapper segments, so "zsh | ⠋ Pi" and "zsh | ⠙ OMP" compare equal, which the anchored owner-relabel in stablyai#16373 never matched. Reverts the store changes from stablyai#16373 and drops the helper it added. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): fold only bare identity frames into the group token A legacy "π - <session> - <cwd>" title is Pi-compatible too, so folding every profile match collapsed two different sessions to the same signature and suppressed the change outright — reintroducing stablyai#16093 through the churn signature. Fold only exact bare identity frames, matched per wrapper segment, so semantic session titles keep comparing on their own text. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * docs(terminal): correct the flap diagnosis in the repro header Verified against the OMP source: it emits only π-glyph frames (`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an Orca-hosted pane its native titler cedes to Orca's own injected extension, which writes `⠋ π - <session> - <cwd>`. So OMP emits neither "OMP" nor "Pi". Both flap sides are Orca's: "OMP" from driveSyntheticTitleFromHook, "Pi" from normalizeTerminalTitle collapsing our own extension's output to a hardcoded literal. The prior header credited the wrapped harness for frames it never sends, which is the same wrong narrative that produced eight fixes at eight layers. No behavior change. * fix(terminal): stop Orca mangling the OMP/Pi title it writes itself Verified against the OMP source: it emits only π-branded frames (`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an Orca-hosted pane its native titler cedes to Orca's OWN injected extension, which writes `π - <session> - <cwd>` / `⠋ π - <session> - <cwd>` at 80ms. So neither flapping string came from OMP. Orca made both: "Pi" — normalizeTerminalTitle collapsing our extension's output to a hardcoded literal, discarding the session name and cwd (stablyai#16093) "OMP" — driveSyntheticTitleFromHook injecting over it every 80ms Fixed at the source: - normalizeTerminalTitle canonicalizes only the rotating braille frame and keeps the rest, in both spinner positions and through a multiplexer prefix (stablyai#8032). Status still round-trips through normalization. - detectAgentStatusFromTitle reads the π state separator, so `π ! <label>` is permission instead of the blanket idle that hid a blocked agent. - normalizeCompatibleAgentTitleForOwner swaps only the brand for the owner's label, so a pane still reads as its launch owner (stablyai#6689, stablyai#7633, stablyai#9077) without losing the session text. - pi/omp set synthesizeWorkingTitle: false — the agent animates its own working title. Terminal states still synthesize; they carry the pane's agent identity downstream. Reverts the ingest-time title rewrite from stablyai#16373, whose normalization of runtimePaneTitlesByTabId also changed Windows Shift+Enter bytes (stablyai#16376). Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): match the state separator only in exact profile casing The separator check runs on every title, so `omp - deploy notes` and `pi - refactor the parser` read as an idle agent. The owner rewrite only ever emits the exact profile labels, so dropping case-insensitivity keeps `OMP - tmp` classifying while ordinary prose stops matching. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * test(terminal): pin one real OMP turn to two committed patches Drives 30 working frames as Orca's injected extension emits them plus the idle transition, and asserts what survives the churn gate. Before the fix every frame alternated "⠋ Pi"/"⠋ OMP" and each one committed — ~12 store patches per second on a working tab. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): carry the permission guard inside the separator reader `-` is both a π state separator and the delimiter in the synthetic permission label, so `OMP - action required` read as idle. It resolved correctly only because detectAgentStatusFromTitle happens to check the synthetic label first — and the separator fn is exported, so a direct caller inherited the bug. Also pins the owner rewrite's fixed-point property, which holds only because getAgentLabel does not tokenize omp/pi, and corrects a comment that overstated how tightly the brand swap is scoped. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * docs(terminal): name the flag the code actually sets The suite header cited `synthesizeTerminalTitle: false`; the profiles set `synthesizeWorkingTitle: false`. The distinction is the whole reason the narrower flag was chosen — terminal-state frames still carry the pane's agent identity downstream — so the wrong name buried the rationale. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> --------- Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> (cherry picked from commit fcf55f2)
…tablyai#16381) * fix(terminal): collapse identity group in the title churn signature Replaces the ingest-time title rewrite from stablyai#16373 with a non-destructive fix at the actual cause. The churn suppressor `isDecorativeAgentTitleFrameChange` keyed on the literal label, so `working:OMP` and `working:Pi` compared unequal and every alternating frame from a wrapped harness committed a store patch. stablyai#16373 made the labels agree by rewriting the stored title to the tab's launch owner — but `runtimePaneTitlesByTabId` is also the Windows Shift+Enter byte-encoding input, so normalizing at ingest destroyed evidence other consumers read (fixed separately in stablyai#16376). Collapse the identity group inside the signature instead. Which member of a group a frame names is decoration, exactly like the spinner glyph the signature already strips, so frames compare equal without touching what is stored. Suppression now changes only WHETHER a frame commits, never WHAT it says. Also fixes the flap under a multiplexer (stablyai#8032): the collapse runs over wrapper segments, so "zsh | ⠋ Pi" and "zsh | ⠙ OMP" compare equal, which the anchored owner-relabel in stablyai#16373 never matched. Reverts the store changes from stablyai#16373 and drops the helper it added. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): fold only bare identity frames into the group token A legacy "π - <session> - <cwd>" title is Pi-compatible too, so folding every profile match collapsed two different sessions to the same signature and suppressed the change outright — reintroducing stablyai#16093 through the churn signature. Fold only exact bare identity frames, matched per wrapper segment, so semantic session titles keep comparing on their own text. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * docs(terminal): correct the flap diagnosis in the repro header Verified against the OMP source: it emits only π-glyph frames (`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an Orca-hosted pane its native titler cedes to Orca's own injected extension, which writes `⠋ π - <session> - <cwd>`. So OMP emits neither "OMP" nor "Pi". Both flap sides are Orca's: "OMP" from driveSyntheticTitleFromHook, "Pi" from normalizeTerminalTitle collapsing our own extension's output to a hardcoded literal. The prior header credited the wrapped harness for frames it never sends, which is the same wrong narrative that produced eight fixes at eight layers. No behavior change. * fix(terminal): stop Orca mangling the OMP/Pi title it writes itself Verified against the OMP source: it emits only π-branded frames (`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an Orca-hosted pane its native titler cedes to Orca's OWN injected extension, which writes `π - <session> - <cwd>` / `⠋ π - <session> - <cwd>` at 80ms. So neither flapping string came from OMP. Orca made both: "Pi" — normalizeTerminalTitle collapsing our extension's output to a hardcoded literal, discarding the session name and cwd (stablyai#16093) "OMP" — driveSyntheticTitleFromHook injecting over it every 80ms Fixed at the source: - normalizeTerminalTitle canonicalizes only the rotating braille frame and keeps the rest, in both spinner positions and through a multiplexer prefix (stablyai#8032). Status still round-trips through normalization. - detectAgentStatusFromTitle reads the π state separator, so `π ! <label>` is permission instead of the blanket idle that hid a blocked agent. - normalizeCompatibleAgentTitleForOwner swaps only the brand for the owner's label, so a pane still reads as its launch owner (stablyai#6689, stablyai#7633, stablyai#9077) without losing the session text. - pi/omp set synthesizeWorkingTitle: false — the agent animates its own working title. Terminal states still synthesize; they carry the pane's agent identity downstream. Reverts the ingest-time title rewrite from stablyai#16373, whose normalization of runtimePaneTitlesByTabId also changed Windows Shift+Enter bytes (stablyai#16376). Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): match the state separator only in exact profile casing The separator check runs on every title, so `omp - deploy notes` and `pi - refactor the parser` read as an idle agent. The owner rewrite only ever emits the exact profile labels, so dropping case-insensitivity keeps `OMP - tmp` classifying while ordinary prose stops matching. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * test(terminal): pin one real OMP turn to two committed patches Drives 30 working frames as Orca's injected extension emits them plus the idle transition, and asserts what survives the churn gate. Before the fix every frame alternated "⠋ Pi"/"⠋ OMP" and each one committed — ~12 store patches per second on a working tab. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): carry the permission guard inside the separator reader `-` is both a π state separator and the delimiter in the synthetic permission label, so `OMP - action required` read as idle. It resolved correctly only because detectAgentStatusFromTitle happens to check the synthetic label first — and the separator fn is exported, so a direct caller inherited the bug. Also pins the owner rewrite's fixed-point property, which holds only because getAgentLabel does not tokenize omp/pi, and corrects a comment that overstated how tightly the brand swap is scoped. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * docs(terminal): name the flag the code actually sets The suite header cited `synthesizeTerminalTitle: false`; the profiles set `synthesizeWorkingTitle: false`. The distinction is the whole reason the narrower flag was chosen — terminal-state frames still carry the pane's agent identity downstream — so the wrong name buried the rationale. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> --------- Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
…tablyai#16381) * fix(terminal): collapse identity group in the title churn signature Replaces the ingest-time title rewrite from stablyai#16373 with a non-destructive fix at the actual cause. The churn suppressor `isDecorativeAgentTitleFrameChange` keyed on the literal label, so `working:OMP` and `working:Pi` compared unequal and every alternating frame from a wrapped harness committed a store patch. stablyai#16373 made the labels agree by rewriting the stored title to the tab's launch owner — but `runtimePaneTitlesByTabId` is also the Windows Shift+Enter byte-encoding input, so normalizing at ingest destroyed evidence other consumers read (fixed separately in stablyai#16376). Collapse the identity group inside the signature instead. Which member of a group a frame names is decoration, exactly like the spinner glyph the signature already strips, so frames compare equal without touching what is stored. Suppression now changes only WHETHER a frame commits, never WHAT it says. Also fixes the flap under a multiplexer (stablyai#8032): the collapse runs over wrapper segments, so "zsh | ⠋ Pi" and "zsh | ⠙ OMP" compare equal, which the anchored owner-relabel in stablyai#16373 never matched. Reverts the store changes from stablyai#16373 and drops the helper it added. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): fold only bare identity frames into the group token A legacy "π - <session> - <cwd>" title is Pi-compatible too, so folding every profile match collapsed two different sessions to the same signature and suppressed the change outright — reintroducing stablyai#16093 through the churn signature. Fold only exact bare identity frames, matched per wrapper segment, so semantic session titles keep comparing on their own text. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * docs(terminal): correct the flap diagnosis in the repro header Verified against the OMP source: it emits only π-glyph frames (`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an Orca-hosted pane its native titler cedes to Orca's own injected extension, which writes `⠋ π - <session> - <cwd>`. So OMP emits neither "OMP" nor "Pi". Both flap sides are Orca's: "OMP" from driveSyntheticTitleFromHook, "Pi" from normalizeTerminalTitle collapsing our own extension's output to a hardcoded literal. The prior header credited the wrapped harness for frames it never sends, which is the same wrong narrative that produced eight fixes at eight layers. No behavior change. * fix(terminal): stop Orca mangling the OMP/Pi title it writes itself Verified against the OMP source: it emits only π-branded frames (`DEFAULT_TERMINAL_TITLE = "π"`, title-generator.ts:25), and on an Orca-hosted pane its native titler cedes to Orca's OWN injected extension, which writes `π - <session> - <cwd>` / `⠋ π - <session> - <cwd>` at 80ms. So neither flapping string came from OMP. Orca made both: "Pi" — normalizeTerminalTitle collapsing our extension's output to a hardcoded literal, discarding the session name and cwd (stablyai#16093) "OMP" — driveSyntheticTitleFromHook injecting over it every 80ms Fixed at the source: - normalizeTerminalTitle canonicalizes only the rotating braille frame and keeps the rest, in both spinner positions and through a multiplexer prefix (stablyai#8032). Status still round-trips through normalization. - detectAgentStatusFromTitle reads the π state separator, so `π ! <label>` is permission instead of the blanket idle that hid a blocked agent. - normalizeCompatibleAgentTitleForOwner swaps only the brand for the owner's label, so a pane still reads as its launch owner (stablyai#6689, stablyai#7633, stablyai#9077) without losing the session text. - pi/omp set synthesizeWorkingTitle: false — the agent animates its own working title. Terminal states still synthesize; they carry the pane's agent identity downstream. Reverts the ingest-time title rewrite from stablyai#16373, whose normalization of runtimePaneTitlesByTabId also changed Windows Shift+Enter bytes (stablyai#16376). Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): match the state separator only in exact profile casing The separator check runs on every title, so `omp - deploy notes` and `pi - refactor the parser` read as an idle agent. The owner rewrite only ever emits the exact profile labels, so dropping case-insensitivity keeps `OMP - tmp` classifying while ordinary prose stops matching. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * test(terminal): pin one real OMP turn to two committed patches Drives 30 working frames as Orca's injected extension emits them plus the idle transition, and asserts what survives the churn gate. Before the fix every frame alternated "⠋ Pi"/"⠋ OMP" and each one committed — ~12 store patches per second on a working tab. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * fix(terminal): carry the permission guard inside the separator reader `-` is both a π state separator and the delimiter in the synthetic permission label, so `OMP - action required` read as idle. It resolved correctly only because detectAgentStatusFromTitle happens to check the synthetic label first — and the separator fn is exported, so a direct caller inherited the bug. Also pins the owner rewrite's fixed-point property, which holds only because getAgentLabel does not tokenize omp/pi, and corrects a comment that overstated how tightly the brand swap is scoped. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> * docs(terminal): name the flag the code actually sets The suite header cited `synthesizeTerminalTitle: false`; the profiles set `synthesizeWorkingTitle: false`. The distinction is the whole reason the narrower flag was chosen — terminal-state frames still carry the pane's agent identity downstream — so the wrong name buried the rationale. Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com> --------- Co-authored-by: Seongho.Bak <49228032+psh4607@users.noreply.github.com>
ELI5
An OMP tab title flickered between "OMP" and "Pi" about 12 times a second, rebuilding store state on every flicker.
It turns out OMP sends neither of those strings. Orca was writing the tab title (via its own extension), then mangling its own writing into "Pi", then fighting the result with a third writer of its own that said "OMP". This fixes all three, so the title just says what the session actually is.
The actual root cause
Verified against
oh-my-pi/packages/coding-agent/src/utils/title-generator.ts:OMP only ever writes the π glyph — never
"OMP", never"Pi". And on an Orca-hosted pane its native titler doesn't even run:setExtensionTerminalTitle(extension-ui-controller.ts:113) cedes the title to Orca's own injected extension (src/main/pi/titlebar-extension-source.ts:21,44), which writesπ - <session> - <cwd>and⠋ π - <session> - <cwd>every 80ms.Both flapping strings were manufactured by Orca:
⠋ PinormalizeTerminalTitlecollapsing our own extension's output to a hardcoded literal⠋ OMPdriveSyntheticTitleFromHookinjecting over it every 80msMeasured through Orca's real normalizer before this change:
The discarded
<session> - <cwd>is #16093. Theπ !collapse meant a blocked OMP agent read as idle. Andpi-compatible-synthetic-title.ts:47-49already documented that barePi/OMPlabels exist because of this collapse — the codebase was round-tripping its own damage.What changed
Four shared files, at the source:
normalizeTerminalTitlecanonicalizes only the rotating braille frame and keeps brand, separator, session and cwd. Handles both spinner positions — leading (⠋ π - …, Orca's extension) and medial (π ⠋ label, OMP native) — and wrapper prefixes, which fixes the flap under tmux/Zellij ([Bug]: Zellij-wrapped OMP titles cause Orca tab label flicker #8032).detectAgentStatusFromTitlereads the π state separator:π !→ permission (was idle),π >/π:/π -→ idle. A spinner outranks the separator.normalizeCompatibleAgentTitleForOwnerswaps only the brand for the owner's label, so a pane still reads as its launch owner (Fix remote OMP terminal title thrash #6689, Fix OMP worktree title identity flicker #7633, fix(pi): stop OMP tab icon flashing to Pi while working #9077) without discarding the session text ([Bug]: OMP/pi 语义会话标题被 synthetic title 覆盖,tab 永远显示 OMP - Running #16093).π - tmp+ owner omp →OMP - tmp, notOMP ready.pi/omp→synthesizeWorkingTitle: false— the agent animates its own working title. Terminal states still synthesize, because they carry the pane's agent identity downstream.Plus a revert of #16373's ingest rewrite, whose normalization of
runtimePaneTitlesByTabIdalso changed Windows Shift+Enter bytes (repaired in #16376, which stays).18 files, +353/-328.
Design decisions worth reviewing
Why not
synthesizeTerminalTitle: false(the OpenCode precedent, and the stronger form of #16234)? I tried it first; it broke 9 identity tests. Orca uses the synthetic title as an identity carrier, not just display text. Narrowing to working-only keeps that carrier and still removes the competing writer during the 12/sec window.Why brand-swap instead of pass-through? Passing the π title straight through preserved the session label but reversed the deliberate owner-identity pinning from #6689/#7633/#9077. Swapping the brand in place satisfies both constraints.
Case-sensitivity on the separator.
PI_COMPATIBLE_SEPARATOR_REmatches onlyπ,Pi,OMPin exact profile casing, because the owner rewrite only ever emitsownerProfile.workingLabel. Case-insensitive matching classifiedomp - deploy notesandpi - refactor the parseras idle agents. Regression-tested.Proof
Status round-trip holds — a normalized or owner-rewritten title re-classifies exactly as its source did (the invariant the old collapse existed to guarantee), including the
π - geminicwd case from #7447:⠋ π - fixing the sidebar - orca⠋ π - fixing the sidebar - orcaπ - fixing the sidebar - orcaπ ! fixing the sidebarzsh | ⠙ π - a - bzsh | ⠋ π - a - bOwner rewrite:
⠋ π - fix - orca+ omp →⠋ OMP - fix - orca(working → working);π ! label→OMP ! label(permission → permission).No false positives:
omp-harness ready,pi-scratch ready,pipeline - build,pip - install,npm - run build,pi - refactor the parser,omp - deploy notesall classify as no agent.Testing
I manually tested these changes locally (no OMP install in this environment)
Automated tests added/updated
New
src/shared/omp-pi-semantic-title-preservation.test.ts— frame collapse in both spinner positions, multiplexer prefix, distinct sessions staying distinct, separator classification, owner brand-swap, status round-trip, false-positive guards.~35 assertions updated across 10 files that pinned the old collapsed literals. Each updated to the new contract; identity expectations left untouched.
Post-rebase: 23,739 passed / 76 skipped across shared, lib, sidebar, terminal-pane, store, main/runtime. Full suite: 58,547 passed, with the only failures pre-existing environment ones (macOS
@parcel/watcher, native-chat transcript watch, electron-vite dev, a DOM repack test) — confirmed failing on a clean tree with zero changes.npm run typecheckexit 0,pnpm lintexit 0. CI green (47 passed / 1 skipped).Review
π : label(not a spinner) on Windows/ConPTY — that classifies idle via the separator, same as before.isLegacyPiCompatibleTitleshipped 2026-07-05 (Prevent OMP terminals from being mislabeled as Gemini #7447), before the collapse it replaces (Fix Grok and Pi terminal title normalization and status detection #7880, 2026-07-08), so every client new enough to contain today's behavior classifies the new form correctly. Clients older than 2026-07-05 would not — a ~7-week floor, flagged as a product call.piwith leading decoration stripped. Same floor.pi/omp. Claude, Codex, OpenCode, Droid verified unchanged."Pi"/"⠋ Pi"values still classify —PI_COMPATIBLE_SYNTHETIC_TITLE_REis a separate matcher and is retained deliberately.Staff review
Two independent senior-staff reviews: nothing blocking, root cause genuinely fixed, merge-ready. Both verified empirically against the real functions rather than by reading:
normalizeTerminalTitleis structurally idempotent (every braille codepoint maps to⠋, which maps to itself).applyTrackedPtyTitlerecords no change per frame and mobile fanout stays quiet.normalizeCompatibleAgentTitleForOwner. New host + old client: the old client's fix(terminal): stop OMP tab title flapping between OMP and Pi #16373 ingest relabel becomes a harmless no-op.synthesizeWorkingTitle: falsechallenged hard. The flag has exactly two consumers in the tree. Attention, unread, notifications and smart sort all key on status detected from the raw title, never on a synthetic string — and⠋ π - …detects working via the spinner glyph. There are zero non-test'⠋ Pi'/'⠋ OMP'literals insrc/.Three non-blocking findings were raised and all three are fixed in this PR:
getPiCompatibleTitleSeparatorStatus('OMP - action required')returnedidle—-is both a state separator and the permission label's delimiter. It resolved correctly only because callers happen to check the synthetic label first, and the function is exported. The guard now lives inside the function, with a pinning test.getAgentLabelnot tokenizingomp/pi. Pinned with a test so a future tokenizer addition fails loudly instead of silently collapsing titles.Known limitation
Bare
π— OMP's default title when it has no label — classifies as no agent. Pre-existing and unchanged here, but now adjacent to code that cites the constant.canonicalizeBrailleSpinnerFramerewrites every braille codepoint in the title, so a session name containing braille would have those glyphs canonicalized too. Contrived and cosmetic.Wrapped idle titles under a multiplexer (
zsh | π - a - b) still aren't classified, becausedetectAgentStatusFromTitleis anchored for the non-spinner path. Pre-existing; not widened here. Wrapped working frames — the actual churn — are covered.Credit
Co-authored with @psh4607 (Seongho.Bak). Their #16234 investigation established that OMP owns its own OSC title and that Orca's synthetic writer was overwriting it — the thread that led to this diagnosis.
synthesizeWorkingTitle: falsehere is their fix; this PR adds the label preservation that makes it fully effective.Supersedes the approach in #16373 (reverted here). #16376 stays.
Checklist
N/Awith reasonpnpm lint,pnpm typecheckpass