Skip to content

Fix OMP worktree title identity flicker - #7633

Merged
Jinwoo-H merged 6 commits into
stablyai:mainfrom
Dvitash:Dvitash/omp-flicker-worktree
Jul 7, 2026
Merged

Jinwoo-H merged 6 commits into
stablyai:mainfrom
Dvitash:Dvitash/omp-flicker-worktree

Conversation

@Dvitash

@Dvitash Dvitash commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the remaining OMP/Pi title flicker path for Orca-created worktrees: OMP-launched worktree terminals now keep OMP identity when Pi-compatible wrapper title/status frames arrive after activity.
  • Reuses the existing owner-gated Pi-compatible title identity rule in resolveTabAgentFromSignals, preserving real Pi launches and unrelated stale-launch overrides such as Codex → Claude pane reuse.
  • Includes config/scripts/serve-headless-fresh-profile-pairing.mjs, a reusable testing helper for headless remote-runtime validation with a fresh profile and printed pairing URL.

Relationship to prior fixes:

  • Fix remote OMP terminal title thrash #6689 fixed remote OMP terminal title thrash at the host/source and mirrored-tab layers when authoritative OMP ownership was known.
  • Fix typed OMP remote title flicker #6954 fixed manually typed omp in a blank terminal by using ephemeral pane ownership only when there was no launchAgent.
  • This PR is still needed because the worktree-create path already carries launchAgent: 'omp', but the renderer tab-agent resolver could still treat Pi-compatible wrapper title or hook/status identities as a newer explicit signal after activity. This closes that remaining resolver-layer gap.

Screenshots

No visual change.

Testing

  • pnpm lint
    • Not run as a full-suite command. Ran targeted oxlint commands listed below.
  • pnpm typecheck
    • Covered by ./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.web.json.
  • pnpm test
    • Not run as a full-suite command. Ran targeted Vitest regression and prior Pi-compatible coverage listed below.
  • pnpm build
    • Full build not run. Ran pnpm run build:electron-vite for the headless pairing smoke.
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed.

Commands run:

  • Confirmed the new regression failed before implementation with expected 'pi' to be 'omp'.
  • ./node_modules/.bin/vitest run --config config/vitest.config.ts src/renderer/src/lib/use-tab-agent.test.ts -t "keeps OMP launch identity"
  • ./node_modules/.bin/vitest run --config config/vitest.config.ts src/renderer/src/lib/use-tab-agent.test.ts -t "explicit title override|launch identity"
  • ./node_modules/.bin/vitest run --config config/vitest.config.ts src/shared/agent-detection.test.ts -t "Pi-compatible"
  • ./node_modules/.bin/vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts -t "normalizes Pi-compatible remote titles"
  • ./node_modules/.bin/vitest run --config config/vitest.config.ts src/renderer/src/runtime/web-session-tabs-sync.test.ts -t "keeps mirrored OMP tabs"
  • ./node_modules/.bin/vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts -t "preserves authoritative OMP identity|skips the foreground-process probe"
  • ./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.web.json
  • ./node_modules/.bin/oxlint src/renderer/src/lib/use-tab-agent.ts src/renderer/src/lib/use-tab-agent.test.ts
  • node --check config/scripts/serve-headless-fresh-profile-pairing.mjs
  • ./node_modules/.bin/oxlint config/scripts/serve-headless-fresh-profile-pairing.mjs
  • node config/scripts/serve-headless-fresh-profile-pairing.mjs --help
  • pnpm run build:electron-vite
  • End-to-end script smoke: node config/scripts/serve-headless-fresh-profile-pairing.mjs --port 0 printed Pairing endpoint: ws://100.91.127.7:<port> and Pairing URL: orca://pair?..., then removed its fresh profile after shutdown.
  • After conflict resolution: ./node_modules/.bin/vitest run --config config/vitest.config.ts src/renderer/src/lib/use-tab-agent.test.ts -t "keeps OMP launch identity"
  • After conflict resolution: ./node_modules/.bin/vitest run --config config/vitest.config.ts src/renderer/src/lib/use-tab-agent.test.ts -t "explicit title override|launch identity"
  • After conflict resolution: ./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.web.json
  • After conflict resolution: ./node_modules/.bin/oxlint src/renderer/src/lib/use-tab-agent.ts src/renderer/src/lib/use-tab-agent.test.ts

AI Review Report

Reviewed the resolver precedence after merging current upstream/main, especially the new probe-free launch-exit evidence and process-identity path. Verified that the owner-compatible normalization happens before title/hook precedence decisions and does not remove upstream's launched-agent-exited behavior.

Main risks checked:

  • OMP-owned Pi-compatible titles and hook/status identities normalize to OMP before they can override launch identity.
  • True Pi launches remain Pi even when inverse OMP-compatible wrapper signals arrive.
  • Unrelated explicit agent switches still override stale launch identity after observed activity.
  • The testing script remains isolated to config/scripts, uses Node path/os APIs, keeps Linux sandbox handling behind runtime checks, and preserves explicit caller overrides such as --pairing-address.

Cross-platform compatibility was checked for macOS, Linux, and Windows. This PR does not touch keyboard shortcuts, shortcut labels, renderer path separators, or provider-specific review behavior. The script uses cross-platform Node APIs for paths and profile directories; POSIX process-group shutdown is gated away from Windows, which keeps the direct child-kill fallback.

Security Audit

Reviewed input handling, command execution, path handling, auth/secrets, dependencies, and IPC impact.

  • No new dependencies.
  • No IPC contract changes.
  • The resolver change is pure renderer identity selection and does not execute commands or handle untrusted input beyond existing terminal title/status strings.
  • The testing script intentionally prints a runtime pairing URL for manual testing; it does not store the token, commit it, or write it outside stdout.
  • The script runs known repo-local commands (ensure-native-runtime.mjs, orca-dev serve) and optionally probes tailscale ip -4 for a reachable pairing address. User-provided arguments are forwarded only to orca serve; --no-pairing and --recipe-json are rejected because they would break the script's pairing/ephemeral-profile contract.
  • Fresh-profile cleanup is guarded to paths containing orca-headless-pairing-profile-, and fixed profile directories supplied via ORCA_HEADLESS_PAIRING_PROFILE_DIR are kept rather than deleted.

No security follow-up needed.

Notes

  • Conflict resolution merged current upstream/main, kept upstream's probe-free launch-exit evidence, and layered the Pi-compatible owner normalization into the updated resolver.
  • The testing script is intentionally included because it was useful for validating the headless remote-runtime pairing path and should be reusable for future remote/worktree debugging.
  • DBus/GPU warnings can appear during Linux headless serve startup, but they did not prevent the server from printing a usable pairing URL in smoke testing.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 67b8a405-96bb-469e-baff-53542084317f

📥 Commits

Reviewing files that changed from the base of the PR and between de0b1a1 and e405734.

📒 Files selected for processing (1)
  • config/scripts/serve-headless-fresh-profile-pairing.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/scripts/serve-headless-fresh-profile-pairing.mjs

📝 Walkthrough

Walkthrough

This pull request adds a new headless CLI wrapper that starts orca-dev serve --json with an isolated Electron profile, selects a pairing address, rewrites readiness output, handles shutdown, and cleans up the profile directory. It also updates tab agent signal resolution so explicit title and hook-derived agents are remapped through launch-owner compatibility logic, with new tests covering wrapper-title precedence cases.

Changes

Headless pairing script: adds wrapper flag parsing, forwarded flag validation, pairing-address selection, Electron preflight, subprocess spawning, readiness-line rewriting, signal handling, and profile cleanup.

Tab agent resolution: adds resolveSignalAgentForLaunchOwner, applies it to explicit title and hook agent resolution, and adds tests for Pi/OMP remote worktree scenarios.

Sequence Diagram(s)

sequenceDiagram
  participant Wrapper as serve-headless-fresh-profile-pairing.mjs
  participant Preflight as ensure-native-runtime.mjs
  participant Child as orca-dev.mjs serve --json
  Wrapper->>Wrapper: parseArgs / validate flags
  Wrapper->>Wrapper: resolveDefaultPairingAddress
  Wrapper->>Preflight: ensureElectronRuntime
  Preflight-->>Wrapper: runtime OK
  Wrapper->>Child: spawn with profile dir & serveArgs
  Child-->>Wrapper: stdout lines
  Wrapper->>Wrapper: printReadyLine parses orca_server_ready
  Wrapper->>Child: SIGINT/SIGTERM -> stopChild
Loading

Suggested labels: enhancement, needs-review

Poem

Headless night, a pairing light,
Signals mapped and set aright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main OMP worktree identity flicker fix.
Description check ✅ Passed The description matches the template with Summary, Screenshots, Testing, AI Review Report, Security Audit, and Notes sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
config/scripts/serve-headless-fresh-profile-pairing.mjs (1)

218-225: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use path.join(scriptDir, ...) instead of a hardcoded relative path.

This relies on cwd: repoRoot plus a /-delimited string, which is inconsistent with the path.join-based orcaDevScript (Line 11) and violates the repo's path-utility guideline. An absolute path is also more robust than depending on cwd.

♻️ Proposed change
   const result = spawnSync(
     process.execPath,
-    ['config/scripts/ensure-native-runtime.mjs', '--runtime=electron'],
+    [path.join(scriptDir, 'ensure-native-runtime.mjs'), '--runtime=electron'],
     {
       cwd: repoRoot,
       stdio: 'inherit'
     }
   )

As per coding guidelines: "use path.join or other path utilities instead of hardcoding / or \".

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c4b3302b-5b5d-45c1-8bee-970d8d3147e5

📥 Commits

Reviewing files that changed from the base of the PR and between 86f404e and de0b1a1.

📒 Files selected for processing (3)
  • config/scripts/serve-headless-fresh-profile-pairing.mjs
  • src/renderer/src/lib/use-tab-agent.test.ts
  • src/renderer/src/lib/use-tab-agent.ts

Co-authored-by: Orca <help@stably.ai>

@Jinwoo-H Jinwoo-H left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the focused fix here. I reviewed and added a couple of maintainer-side hardening/coverage updates:

  • expanded the OMP/Pi-compatible tab-agent regression coverage across title, live hook, sibling hook, completed-hook fallback, and true Pi launch preservation
  • hardened the headless fresh-profile pairing helper for cross-platform paths, forwarded --flag=value guards, Windows process-tree shutdown, repeated signal handling, and guarded cleanup retries

Validated with targeted resolver/runtime tests, typecheck, scoped lint, max-lines ratchet, helper smoke checks, and Electron screenshots proving OMP-owned Pi-compatible signals render the OMP tab icon while true Pi-owned inverse signals render Pi.

@Jinwoo-H
Jinwoo-H merged commit bea9b38 into stablyai:main Jul 7, 2026
nwparker added a commit that referenced this pull request Aug 25, 2026
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>
nwparker added a commit that referenced this pull request Aug 25, 2026
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>
nwparker added a commit that referenced this pull request Aug 25, 2026
…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 <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 #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 (#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>

* 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>
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 25, 2026
…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)
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…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>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants