Repository navigation
fix(terminal): stop OMP tab title flapping between OMP and Pi - #16373
Conversation
OMP wraps Pi, and both share the `pi-compatible` title-identity group. Two
writers publish frames for the same pane under different labels: main's
synthetic spinner injects "<frame> OMP" every 80ms, while the wrapped Pi
harness emits its own "Pi" frames.
`isDecorativeAgentTitleFrameChange` keys on `status:textWithoutSpinner`, so
`working:OMP` and `working:Pi` read as meaningful changes. The alternation
defeated spinner-churn suppression entirely: every 80ms frame committed a
store patch plus a runtime-graph sync, on both the tab-title and
runtime-pane-title paths.
Pin same-group identity frames to the tab's launch owner at both store
choke points, reusing the existing owner-normalization helper already
applied on the sidebar, remote-sync, and mounted-pane paths.
The relabel is scoped to bare identity frames ("⠋ Pi", "Pi ready"); a
semantic session title ("π - <session> - <cwd>") carries text no agent
profile can reproduce and is left untouched, so this does not reintroduce
the generic-label complaint in #16093.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between f7033e0 and 32bdf7c77856ca19031808c337d0a971267d5038. 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe change adds owner-aware relabeling for compatible agent identity frames. Tab title batching and runtime pane title updates now use the tab launch owner when they process these frames. Non-identity session titles and frames that already match the owner remain unchanged. New tests cover alternating OMP and Pi frames, title patch counts, owner-specific frames, and semantic session titles. Merge Risk: ⚪ Minimal · up to This change keeps OMP terminal labels stable and prevents repeated store updates without altering persisted data or external interfaces; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description is detailed, on-topic, and covers the change, rationale, testing, visual proof, review considerations, and checklist. However, the required Linked Issue section contains only the placeholder ✨ 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 |
Cross-reference and creditCredit to @psh4607 (Seongho.Bak), whose open PR #16234 ("Preserve OMP and Pi semantic session titles", fixing #16093) independently identified the synthetic-title writer as a contended title source for Pi/OMP panes. Their upstream-source investigation — confirming that both OMP and Pi own their native OSC 0 working titles — is what established that The two changes are complementary, and neither subsumes the other:
Because #16234 intentionally keeps synthetic working titles on relay-hosted sessions (only the status extension is installed there, not the native titlebar extension), the two-writer contention — and therefore the flap — persists on SSH/WSL relays after it lands. This PR closes that remaining path, and also handles the case where the wrapped Pi harness's own frames reach the store labeled "Pi" on an OMP-owned tab. No file overlap, so no merge conflict in either direction. Deliberate compatibility with #16234This PR's relabel is gated to bare identity frames ( Known remaining defect (not fixed here)
This PR corrects the user-visible tab label but does not repair that upstream collapse, so other consumers of its output still observe "Pi" for an OMP pane. It is the deeper cause behind #16093's "semantic title never appears" symptom and deserves its own PR — making that pure function owner-aware means threading owner context through the main-side and renderer title trackers, which is materially larger than this fix and would collide with #16234's active work in the same area. Related prior art in this family: #6619/#6689, #6943/#6954, #7633, #8032, #8986, and commits |
A frame that already names the tab's own agent carries authoritative status wording, so relabeling it restated bare "Pi" as "Pi ready" and changed a Pi-owned tab that never flapped. Only relabel when the frame names a different member of the identity group. Also fixes the repro suite's types against the project typecheck. Co-authored-by: Seongho.Bak <[email protected]>
32bdf7c to
6c6ddf0
Compare
OMP wraps Pi's TUI, so Shift+Enter bytes land in a Pi reader that decodes CSI-u. The omp profile had no `windowsShiftEnterEncoding`, so it fell back to Esc+CR — which submits instead of inserting a newline (#9703). This was latent while an OMP pane's stored title could read either "Pi" or "OMP" depending on which interleaved frame committed first. Pinning the title to the launch owner (#16373) made it deterministically "OMP", so the Windows Shift+Enter fallback now always resolves `omp` and always picks the wrong encoding. `prime-agent` already carries this entry for the identical reason. Co-authored-by: Seongho.Bak <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
…16381) * fix(terminal): collapse identity group in the title churn signature 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 <[email protected]> * 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 #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 <[email protected]> * 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 (#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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> --------- Co-authored-by: Seongho.Bak <[email protected]>
…ai#16373) * fix(terminal): stop OMP tab title flapping between OMP and Pi OMP wraps Pi, and both share the `pi-compatible` title-identity group. Two writers publish frames for the same pane under different labels: main's synthetic spinner injects "<frame> OMP" every 80ms, while the wrapped Pi harness emits its own "Pi" frames. `isDecorativeAgentTitleFrameChange` keys on `status:textWithoutSpinner`, so `working:OMP` and `working:Pi` read as meaningful changes. The alternation defeated spinner-churn suppression entirely: every 80ms frame committed a store patch plus a runtime-graph sync, on both the tab-title and runtime-pane-title paths. Pin same-group identity frames to the tab's launch owner at both store choke points, reusing the existing owner-normalization helper already applied on the sidebar, remote-sync, and mounted-pane paths. The relabel is scoped to bare identity frames ("⠋ Pi", "Pi ready"); a semantic session title ("π - <session> - <cwd>") carries text no agent profile can reproduce and is left untouched, so this does not reintroduce the generic-label complaint in stablyai#16093. * fix(terminal): scope owner relabel to cross-identity frames A frame that already names the tab's own agent carries authoritative status wording, so relabeling it restated bare "Pi" as "Pi ready" and changed a Pi-owned tab that never flapped. Only relabel when the frame names a different member of the identity group. Also fixes the repro suite's types against the project typecheck. Co-authored-by: Seongho.Bak <[email protected]> --------- Co-authored-by: Seongho.Bak <[email protected]> (cherry picked from commit 3b6eb03)
…6376) OMP wraps Pi's TUI, so Shift+Enter bytes land in a Pi reader that decodes CSI-u. The omp profile had no `windowsShiftEnterEncoding`, so it fell back to Esc+CR — which submits instead of inserting a newline (stablyai#9703). This was latent while an OMP pane's stored title could read either "Pi" or "OMP" depending on which interleaved frame committed first. Pinning the title to the launch owner (stablyai#16373) made it deterministically "OMP", so the Windows Shift+Enter fallback now always resolves `omp` and always picks the wrong encoding. `prime-agent` already carries this entry for the identical reason. Co-authored-by: Seongho.Bak <[email protected]> (cherry picked from commit 4a57cfa)
…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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> --------- Co-authored-by: Seongho.Bak <[email protected]> (cherry picked from commit fcf55f2)
…ai#16373) * fix(terminal): stop OMP tab title flapping between OMP and Pi OMP wraps Pi, and both share the `pi-compatible` title-identity group. Two writers publish frames for the same pane under different labels: main's synthetic spinner injects "<frame> OMP" every 80ms, while the wrapped Pi harness emits its own "Pi" frames. `isDecorativeAgentTitleFrameChange` keys on `status:textWithoutSpinner`, so `working:OMP` and `working:Pi` read as meaningful changes. The alternation defeated spinner-churn suppression entirely: every 80ms frame committed a store patch plus a runtime-graph sync, on both the tab-title and runtime-pane-title paths. Pin same-group identity frames to the tab's launch owner at both store choke points, reusing the existing owner-normalization helper already applied on the sidebar, remote-sync, and mounted-pane paths. The relabel is scoped to bare identity frames ("⠋ Pi", "Pi ready"); a semantic session title ("π - <session> - <cwd>") carries text no agent profile can reproduce and is left untouched, so this does not reintroduce the generic-label complaint in stablyai#16093. * fix(terminal): scope owner relabel to cross-identity frames A frame that already names the tab's own agent carries authoritative status wording, so relabeling it restated bare "Pi" as "Pi ready" and changed a Pi-owned tab that never flapped. Only relabel when the frame names a different member of the identity group. Also fixes the repro suite's types against the project typecheck. Co-authored-by: Seongho.Bak <[email protected]> --------- Co-authored-by: Seongho.Bak <[email protected]>
…6376) OMP wraps Pi's TUI, so Shift+Enter bytes land in a Pi reader that decodes CSI-u. The omp profile had no `windowsShiftEnterEncoding`, so it fell back to Esc+CR — which submits instead of inserting a newline (stablyai#9703). This was latent while an OMP pane's stored title could read either "Pi" or "OMP" depending on which interleaved frame committed first. Pinning the title to the launch owner (stablyai#16373) made it deterministically "OMP", so the Windows Shift+Enter fallback now always resolves `omp` and always picks the wrong encoding. `prime-agent` already carries this entry for the identical reason. Co-authored-by: Seongho.Bak <[email protected]>
…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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> --------- Co-authored-by: Seongho.Bak <[email protected]>
…ai#16373) * fix(terminal): stop OMP tab title flapping between OMP and Pi OMP wraps Pi, and both share the `pi-compatible` title-identity group. Two writers publish frames for the same pane under different labels: main's synthetic spinner injects "<frame> OMP" every 80ms, while the wrapped Pi harness emits its own "Pi" frames. `isDecorativeAgentTitleFrameChange` keys on `status:textWithoutSpinner`, so `working:OMP` and `working:Pi` read as meaningful changes. The alternation defeated spinner-churn suppression entirely: every 80ms frame committed a store patch plus a runtime-graph sync, on both the tab-title and runtime-pane-title paths. Pin same-group identity frames to the tab's launch owner at both store choke points, reusing the existing owner-normalization helper already applied on the sidebar, remote-sync, and mounted-pane paths. The relabel is scoped to bare identity frames ("⠋ Pi", "Pi ready"); a semantic session title ("π - <session> - <cwd>") carries text no agent profile can reproduce and is left untouched, so this does not reintroduce the generic-label complaint in stablyai#16093. * fix(terminal): scope owner relabel to cross-identity frames A frame that already names the tab's own agent carries authoritative status wording, so relabeling it restated bare "Pi" as "Pi ready" and changed a Pi-owned tab that never flapped. Only relabel when the frame names a different member of the identity group. Also fixes the repro suite's types against the project typecheck. Co-authored-by: Seongho.Bak <[email protected]> --------- Co-authored-by: Seongho.Bak <[email protected]>
…6376) OMP wraps Pi's TUI, so Shift+Enter bytes land in a Pi reader that decodes CSI-u. The omp profile had no `windowsShiftEnterEncoding`, so it fell back to Esc+CR — which submits instead of inserting a newline (stablyai#9703). This was latent while an OMP pane's stored title could read either "Pi" or "OMP" depending on which interleaved frame committed first. Pinning the title to the launch owner (stablyai#16373) made it deterministically "OMP", so the Windows Shift+Enter fallback now always resolves `omp` and always picks the wrong encoding. `prime-agent` already carries this entry for the identical reason. Co-authored-by: Seongho.Bak <[email protected]>
…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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> --------- Co-authored-by: Seongho.Bak <[email protected]>
ELI5
Launch OMP in a terminal tab and the tab label ping-pongs between "OMP" and "Pi" many times a second. OMP is Pi underneath, so two different parts of Orca kept renaming the same tab — one insisted "OMP", the other "Pi". Orca already has a filter that ignores spinner noise, but because the name kept changing (not just the spinner), the filter let every single frame through. Each one rebuilt store state and re-rendered the tab. This pins the label to whichever agent the user actually launched, so the filter works again.
What Changed
pi-compatibleidentity title frames to the tab'slaunchAgentat the two store choke points:applyTerminalTabTitleUpdates(tab title) andsetRuntimePaneTitle(pane title slot).relabelCompatibleAgentIdentityFrameForOwnertosrc/shared/agent-title-owner.ts, which wraps the existingnormalizeCompatibleAgentTitleForOwnerand scopes the relabel to bare identity frames only.Why
piandompsharetitleIdentityGroup: 'pi-compatible'(src/shared/synthetic-agent-title.ts:45-56). An OMP pane has two title writers that disagree on the label:"<frame> OMP"every 80 ms (src/main/index.ts:1948SPINNER_INTERVAL_MS,:2170,:2205)."⠋ Pi"passes through untouched, and legacy"π …"frames are collapsed to a hardcoded"Pi"bynormalizeTerminalTitle(src/shared/agent-title-status.ts:135-144) — that collapse is identity-blind.The churn suppressor
isDecorativeAgentTitleFrameChangekeys onstatus:textWithoutSpinner(src/shared/agent-decorative-title-signature.ts:17). It correctly absorbs⠋/⠙/⠹ OMP(all →working:OMP), but"⠋ OMP"→working:OMPvs"⠋ Pi"→working:Piare different signatures, so the alternation defeated suppression entirely. Every 80 ms frame became a committed store patch on both title paths, each dragging ascheduleRuntimeGraphSync()with it.A plain Pi pane never flaps — both writers agree on "Pi". That is why this reproduces only with OMP.
The tab icon was already hardened for exactly this case (
resolveTabAgentFromSignalspinsompover Pi-compatible wrapper titles, per #6689/#7633/#9077). The title string never got the same treatment. This closes that asymmetry by reusing the same owner-normalization helper already applied on the sidebar (worktree-title-derived-agent-rows.ts:144), remote-sync (web-session-tabs-sync.ts:1103), and mounted-pane (terminal-title-evidence.ts:17) paths — but not, until now, at the store.Scope note: semantic session titles
normalizeCompatibleAgentTitleForOwnerapplied naively also rewrites semantic titles:"π - fixing sidebar - orca"→"OMP ready". That is precisely what open issue #16093 wants preserved. The relabel is therefore gated ongetPiCompatibleSyntheticAgentLabel, which matches only bare identity frames ("⠋ Pi","Pi ready","OMP - action required") and never a title carrying session text.This is not a live regression today —
normalizeTerminalTitlealready destroys that text upstream — but it would have become one the moment #16093 is fixed. A regression test pins it.Relationship to #16234
Open PR #16234 ("Preserve OMP and Pi semantic session titles", fixes #16093) disables synthetic working-title synthesis for local pi/omp, removing Writer A locally. These are complementary, not competing:
normalizeTerminalTitlecollapse, so an OMP pane can still be labeled "Pi".No conflict: #16234 touches
src/shared/synthetic-agent-title.tsandsrc/main/index.ts; this touches the renderer store andagent-title-owner.ts.Prior art in the same family: #6619/#6689, #6943/#6954, #7633, #8032, #8986, commits
dd0f4c39c8fandbf26ccb3100. Still open and related: #12870.Proof
RED — fix reverted, regression suite at its committed state:
20 alternating frames → 20 committed store patches, on both paths.
GREEN — fix applied:
20 frames → ≤1 commit, and the displayed identity is
OMPfor every frame.Visual Proof
N/A — no live OMP install was available in this environment to film. The change is OSC title-writer arbitration with no layout, color, or component change; the user-visible effect (label stops alternating) is pinned by deterministic commit-count assertions rather than a screenshot.
Testing
I manually tested these changes locally
Automated tests added/updated
src/renderer/src/store/slices/repro-omp-pi-alternating-title-frame-churn.test.ts— 3 tests: tab-title commit count, pane-title commit count, semantic-title preservation. RED/GREEN transcript above.Broad regression sweep (store, terminal-pane, sidebar, runtime, shared, lib): 16,928 passed / 67 skipped, then 15,457 passed after the gating refactor.
pnpm lint— passed (exit 0), before and after the refactor.npx tsc --noEmit— passed (exit 0), before and after the refactor.pnpm build— not run.Review
getTerminalTabOwnerWorktreeId, which is workspace-kind agnostic.pi-compatibleidentity group.normalizeCompatibleAgentTitleForOwnerearly-returns for any owner without atitleIdentityGroup, so Claude, Codex, OpenCode, Droid, and others are untouched — confirmed by the unchanged suites.setRuntimePaneTitleowner lookup is gated behind a cheap regex so non-pi-compatible titles skip it entirely.Notes
Reported symptom was a perf problem, and the store-commit count is the mechanism — this is a perf fix as much as a cosmetic one.
Checklist
N/Awith reasonpnpm lint,pnpm typecheckpass;pnpm buildnot run (CI will cover)