Repository navigation
Fix remote OMP terminal title thrash - #6689
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/runtime/orca-runtime.ts (1)
17354-17367: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick winSerial per-PTY foreground probe regresses mobile listing latency.
refreshPtyWorktreeRecordsFromControllerbackslistTerminals,getWorktreePs, andrefreshMobileSessionPtyRecords(mobile RPC hot paths). AwaitingrefreshPtyForegroundAgentFromControlleronce per session serializes agetForegroundProcessround-trip for every PTY, so listing latency grows linearly with terminal count (each call also has no per-call timeout, unlike thelistProcesses()call guarded bywithTimeoutResult). Additionally, if one refresh rejects (e.g. a snapshot listener throws viatouchMobileSessionSnapshotsForPty), the whole loop aborts. Fan the refreshes out and settle them together.⚡ Proposed parallelization
- for (const session of sessions) { + const foregroundAgentRefreshes: Promise<void>[] = [] + for (const session of sessions) { const worktreeId = inferWorktreeIdFromPtyId(session.id) ?? findResolvedWorktreeIdForPath(resolvedWorktrees, session.cwd) if (targetWorktreeId && worktreeId !== targetWorktreeId) { continue } if (worktreeId) { this.recordPtyWorktree(session.id, worktreeId, { connected: true }) } - await this.refreshPtyForegroundAgentFromController(session.id) + foregroundAgentRefreshes.push(this.refreshPtyForegroundAgentFromController(session.id)) } + await Promise.allSettled(foregroundAgentRefreshes)
🧹 Nitpick comments (3)
src/shared/agent-title-owner.ts (1)
69-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a short
Why:comment for the compatibility rewrite rule.These helpers encode the PR’s core Pi/OMP ownership constraint, but the reason titles/types are only rewritten when
titleIdentityGroupmatches is not documented in the code. A 1-2 line comment here would make future changes much safer.As per coding guidelines, "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."
Source: Coding guidelines
src/main/runtime/orca-runtime.ts (1)
5008-5013: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winAvoid foreground-agent polling on every OSC title frame.
refreshPtyForegroundAgentfires for every non-null OSC title — agents update their title rapidly (spinner frames) during active output, so this triggers a continuousgetForegroundProcessprobe per active PTY (a relay round-trip for SSH/daemon-backed terminals). The inflight dedup caps concurrency to one per PTY but does not stop the steady stream of probes. The foreground agent rarely changes within a session, so gate the refresh on an actual title/status transition (shouldTouchPtyBackedSessionTabsis computed just above).♻️ Proposed gate
shouldTouchPtyBackedSessionTabs = prevTitle !== oscTitle || prevStatus !== pty.lastAgentStatus if (agentStatus === 'idle' && prevStatus !== 'idle') { this.resolvePtyTuiIdleWaiters(pty, ptyId) } - this.refreshPtyForegroundAgent(ptyId) + if (shouldTouchPtyBackedSessionTabs) { + this.refreshPtyForegroundAgent(ptyId) + }src/renderer/src/components/terminal-pane/pty-connection.ts (1)
980-991: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the authoritative-owner precedence.
This precedence chain is the core Pi/OMP anti-thrashing rule, but the ordering is non-obvious from the helper alone. A short
Whycomment here would make future reordering much safer.As per coding guidelines,
**/*.{ts,tsx,js,jsx}: "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."Suggested comment
+ // Why: Pi-compatible titles/statuses must resolve against the pane's + // authoritative launch owner so remote snapshots/hooks don't repaint OMP + // sessions back to Pi during reconnects or status updates. const getAuthoritativePaneAgent = (): AgentType | undefined => {Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6f6826ad-ebe7-43bb-bae5-5b66f67d097a
📒 Files selected for processing (15)
config/scripts/dev-serve-fresh-profile.shsrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/renderer/src/components/sidebar/useWorktreeAgentRows.test.tssrc/renderer/src/components/sidebar/worktree-agent-rows.tssrc/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.tssrc/renderer/src/components/sidebar/worktree-title-derived-agent-rows.tssrc/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/lib/use-tab-agent.tssrc/renderer/src/runtime/web-session-tabs-sync.test.tssrc/renderer/src/runtime/web-session-tabs-sync.tssrc/shared/agent-detection.test.tssrc/shared/agent-title-owner.tssrc/shared/synthetic-agent-title.ts
|
|
||
| PORT="${ORCA_REMOTE_DEV_SERVER_PORT:-6769}" | ||
| PAIRING_ADDRESS="${ORCA_REMOTE_DEV_PAIRING_ADDRESS:-}" | ||
| PROFILE_DIR="${ORCA_REMOTE_DEV_USER_DATA_PATH:-${XDG_CONFIG_HOME:-$HOME/.config}/orca-dev-remote-server-fresh}" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Resolve PROFILE_DIR before changing directories.
If --profile-dir or ORCA_REMOTE_DEV_USER_DATA_PATH is relative, Lines 107-116 reinterpret it relative to REPO_ROOT, not the caller’s working directory, because the script cds before rm -rf. That makes ./orca-dev-test capable of wiping or recreating the wrong directory.
Suggested fix
PORT="${ORCA_REMOTE_DEV_SERVER_PORT:-6769}"
PAIRING_ADDRESS="${ORCA_REMOTE_DEV_PAIRING_ADDRESS:-}"
PROFILE_DIR="${ORCA_REMOTE_DEV_USER_DATA_PATH:-${XDG_CONFIG_HOME:-$HOME/.config}/orca-dev-remote-server-fresh}"
RUN_BUILD=0
@@
done
+
+if [[ "$PROFILE_DIR" != /* ]]; then
+ PROFILE_DIR="$PWD/$PROFILE_DIR"
+fi
if [[ -z "$PAIRING_ADDRESS" ]]; thenAlso applies to: 65-70, 107-116
…us transition The foreground-process probe added for OMP/Pi owner resolution is only ever consulted as the owner fallback when launchAgent is unknown. For all Orca-launched agents (including the OMP path this PR fixes) the relay getForegroundProcess round-trip was pure waste. - Skip the probe entirely when pty.launchAgent is set. - Gate the onPtyData trigger on an actual agent-status transition, not on per-frame braille-spinner title churn. - Fire-and-forget the refresh on the mobile listing hot path so latency does not grow per-session and a throwing snapshot listener can't abort the sweep. Adds regression tests covering both the skip and the status-transition gate, and a Why comment on the renderer's authoritative-owner precedence. Co-authored-by: Orca <[email protected]>
|
Thanks for this, @Dvitash! 🙏 Merged. This is a clean fix for a genuinely subtle problem — OMP wrapping Pi means it I reviewed for correctness, performance, and safety; reproduced the flicker I pushed one follow-up commit before merging to tighten the new foreground-agent
Both line up with the CodeRabbit perf notes. Thanks again for the thorough work |
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]>
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]>
…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)
…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]>
Fixes stablyai#6619: OMP-owned remote/mobile terminals no longer flicker their tab label between "OMP" and "Pi". OMP wraps Pi, so it emits Pi-identity OSC titles and status frames during active work. On the host, in mirrored remote tabs, and in the title-derived sidebar rows, those frames were stored verbatim — so an OMP-launched pane alternated between "OMP" (launch identity) and "Pi" (live frame). The fix introduces a shared owner-normalization helper (agent-title-owner.ts) that rewrites Pi-compatible titles/status entries to the authoritative launch owner, but only when the incoming and owner profiles share the same titleIdentityGroup — so true Pi sessions, unrelated agents, and custom titles are left untouched. Maintainer hardening on top of the original change: - Skip the new getForegroundProcess probe entirely when launchAgent is already known (it is only ever the owner fallback when launchAgent is unknown), and gate the onPtyData trigger on a real status transition rather than per-frame braille-spinner title churn — avoiding a relay round-trip per output frame on SSH/daemon-backed terminals. - Make the foreground refresh fire-and-forget on the mobile listing hot path (listTerminals/getWorktreePs) so latency does not grow per session and a throwing snapshot listener cannot abort the liveness sweep. - Added regression tests + a Why comment on the renderer owner precedence. Verified: 829 tests pass; node/web/cli typechecks clean; oxlint clean; reproduced the flicker against main as a negative control and confirmed the live renderer build collapses interleaved OMP/Pi frames to a stable OMP label with zero Pi leaks while leaving true-Pi/unrelated/custom titles unchanged. Co-authored-by: Dvitash <[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]>
Summary
Closes #6619.
Screenshots
No new UI surfaces. The supplied GIFs cover the previous failure mode: an OMP-owned remote session could render Pi-compatible working titles such as
Pi,Pi ready, or legacy? - tmpframes while the agent was active.Testing
./node_modules/.bin/vitest run --config config/vitest.config.ts src/shared/agent-detection.test.ts src/main/runtime/orca-runtime.test.ts src/renderer/src/runtime/web-session-tabs-sync.test.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts src/renderer/src/components/sidebar/useWorktreeAgentRows.test.ts./node_modules/.bin/tsgo --noEmit -p config/tsconfig.node.json./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.web.json./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.cli.json./node_modules/.bin/oxlint src/shared/synthetic-agent-title.ts src/shared/agent-title-owner.ts src/shared/agent-detection.test.ts src/main/runtime/orca-runtime.ts src/main/runtime/orca-runtime.test.ts src/renderer/src/runtime/web-session-tabs-sync.ts src/renderer/src/runtime/web-session-tabs-sync.test.ts src/renderer/src/components/terminal-pane/pty-connection.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/renderer/src/components/sidebar/worktree-agent-rows.ts src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts src/renderer/src/components/sidebar/useWorktreeAgentRows.ts src/renderer/src/components/sidebar/useWorktreeAgentRows.test.ts./node_modules/.bin/oxlint src/shared/agent-title-owner.ts538a1efbeAI Review Report
Reviewed the remote host snapshot flow, renderer mirrored-tab reconciliation, PTY OSC 9999 handling, and sidebar title-derived agent rows. The compatibility helper only rewrites titles and status when the incoming profile and owner profile share
titleIdentityGroup, so true Pi sessions, unrelated agents, and custom titles stay unchanged.Security Audit
Basic audit completed. The changes propagate existing agent ownership metadata and normalize display/status strings. No new command execution, IPC surface, filesystem writes, credential handling, network endpoints, or git provider behavior is introduced.
Notes
The fresh-profile dev server script was local test scaffolding and has been removed from this PR. The remaining changes are limited to owner propagation, compatible title/status normalization, and short comments documenting why owner-based compatibility is needed.