Repository navigation
fix(omp): read Pi/OMP static state-title markers and retire stale spinners - #14602
Conversation
…nners OMP 17.2.12 replaced its animated braille title frames with static markers on WSL/ConPTY (`π : working`, `π > idle`, `π ! needs input`). Orca read all three as idle, so a working OMP pane lost its status, and a synthetic title spinner started by an earlier hook kept rotating after its status row was gone. Classify the markers from one shared table so a later upstream punctuation change is a row, not a reparse, and stop the spinner when the hook row it stands in for is cleared or dismissed. Fixes #13890
|
Warning Review limit reachedNext included review available in 17 seconds. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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: 📒 Files selected for processing (10)
🚧 Files skipped from review as they are similar to previous changes (8)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change adds Pi/OMP title-marker parsing for working, permission, and idle states. It integrates explicit marker detection with existing title-status logic and clears stale working markers. It adds parity and detection tests. Merge Risk: 🔵 Low · up to The change improves Pi/OMP status detection and spinner cleanup, but some OpenCode-wrapped titles may still appear idle while working or awaiting permission, and an unusual renderer error could leave a stale title spinner. The PR is mergeable with explicit owner awareness and follow-up on these bounded issues. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The changes address the linked issue objectives [ ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a5a77f95-f68a-41d2-bbca-fa0fe5017d29
📒 Files selected for processing (10)
src/main/agent-hooks/server.test.tssrc/main/agent-hooks/server.tssrc/main/index.tssrc/main/synthetic-title-spinner.test.tssrc/main/synthetic-title-spinner.tssrc/renderer/src/components/terminal-pane/terminal-title-tracker-parity.test.tssrc/shared/agent-detection.test.tssrc/shared/agent-title-status.tssrc/shared/pi-state-title-marker.test.tssrc/shared/pi-state-title-marker.ts
| // Why: Pi/OMP's marker is an explicit state protocol, so it wins over the glyph and | ||
| // keyword gates below — its label is free-form cwd/session text that can carry either. | ||
| const piStateStatus = getPiStateTitleStatus(title) | ||
| if (piStateStatus) { | ||
| return piStateStatus | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Check Pi state markers before the OpenCode gate.
isOpenCodeNativeTitle at Line 175 handles OC | π : cwd first. It returns idle when the title has no spinner. Execution then does not reach this explicit working marker.
Move the Pi marker check before the OpenCode check. Add OC | π : cwd and OC | π ! cwd regression cases to src/shared/agent-detection.test.ts.
Proposed fix
+ const piStateStatus = getPiStateTitleStatus(title)
+ if (piStateStatus) {
+ return piStateStatus
+ }
+
if (isOpenCodeNativeTitle(title)) {
return containsAgentSpinnerGlyph(title) ? 'working' : 'idle'
}
-
- const piStateStatus = getPiStateTitleStatus(title)
- if (piStateStatus) {
- return piStateStatus
- }|
I live-tested this PR on Windows 11 with WSL2 and OMP 17.2.14. The marker parsing works, but the workspace could still stay on Working after OMP had returned to a native I had missed #15658. That PR is the missing completion fix for this path. #14602 handles the terminal title and stops the synthetic spinner when a hook row is cleared or dismissed. In the failing run, the hook row never reached That leaves a live For normal completion, this PR needs #15658 or equivalent:
The test gap is straightforward. The parity test feeds I have not A/B tested #15658 itself yet, but the failing trace matches the event contract it fixes. #14602 is still needed for static title parsing. It is not enough by itself for the stale Working symptom when OMP's terminal |
OMP status review / visual validation
The PR is still open and may require conflict resolution against current |
Final preparation status
|
…-omp-wsl-titles # Conflicts: # src/main/agent-hooks/server.test.ts # src/shared/agent-title-status.ts
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Greptile SummaryThe PR adds support for OMP’s static Pi state-title markers and ties synthetic spinner cleanup to definitive status-row removal.
Confidence Score: 5/5The PR appears safe to merge, with no additional actionable defects beyond the marker-boundary issue already raised in the existing thread. The new marker handling and spinner lifecycle paths remain aligned with stable pane identity, and transient SSH connection clears do not retire live pane spinners.
|
| Filename | Overview |
|---|---|
| src/shared/pi-state-title-marker.ts | Introduces the shared OMP marker parser and stale-working-marker rewrite; the known broad-match concern is already covered by an existing thread. |
| src/shared/agent-title-status.ts | Gives explicit OMP state markers precedence over decorative glyphs and preserves marker-bearing titles during normalization. |
| src/main/agent-hooks/server.ts | Adds a guarded multi-subscriber notification for definitive status-row dismissals. |
| src/main/index.ts | Connects pane-scoped status clear and dismissal events to synthetic spinner retirement. |
| src/main/synthetic-title-spinner.ts | Distinguishes pane-scoped clears from connection-scoped transient clears for spinner cleanup. |
Reviews (2): Last reviewed commit: "test(omp): preserve static state titles ..." | Re-trigger Greptile
| `(?:^|[\\s|])π[ \\t]+([${PI_STATE_MARKERS.map(escapeForCharacterClass).join('')}])(?=\\s|$)`, | ||
| 'u' |
There was a problem hiding this comment.
Marker matcher claims embedded text
The (?:^|[\s|]) boundary recognizes π :, π >, or π ! anywhere in free-form shell or agent title text, not only at the start of an OMP segment. Because this result precedes the other provider detectors, matching text receives an unrelated Pi status, skips Gemini normalization, and can have its punctuation rewritten during stale-title cleanup.
Knowledge Base Used: Agent integrations and hooks
|
Conflict resolution and review complete.
The PR is open and GitHub reports it as mergeable. |
|
CI is green after rerunning the previously flaky test shard. All required checks pass. |
…nners (stablyai#14602) * fix(omp): read Pi/OMP static state-title markers and retire stale spinners OMP 17.2.12 replaced its animated braille title frames with static markers on WSL/ConPTY (`π : working`, `π > idle`, `π ! needs input`). Orca read all three as idle, so a working OMP pane lost its status, and a synthetic title spinner started by an earlier hook kept rotating after its status row was gone. Classify the markers from one shared table so a later upstream punctuation change is a row, not a reparse, and stop the spinner when the hook row it stands in for is cleared or dismissed. Fixes stablyai#13890 * test(omp): preserve static state titles during normalization --------- Co-authored-by: Merge Sim <sim@local>
ELI5
OMP used to spin a little braille animation in the terminal title while it worked. On Windows/WSL it can't animate any more, so as of 17.2.12 it writes a static punctuation marker instead:
π : cwdmeans working,π > cwdmeans idle,π ! cwdmeans it needs input. Orca never learned those markers, so it read every one of them as "idle" — a working OMP agent looked finished, and Orca's own fallback spinner (started earlier by a hook event) kept spinning after the status row it stood in for was gone.This teaches Orca the markers from one small table, and makes the fallback spinner retire together with the status row it represents.
What Changed
src/shared/pi-state-title-marker.ts: a marker table (:→ working,!→ permission,>→ idle) plus one matcher built from it. Both the status classifier and the stale-title clear read that single table.detectAgentStatusFromTitleconsults the marker before the glyph and keyword gates, so a marker-bearing title is never decided by decoration that happens to sit in OMP's label.normalizeTerminalTitleno longer reshapes a marker-bearing title as a Gemini title.clearWorkingIndicatorsrewrites a working marker to the idle marker, so the existing 3-second stale-title fallback can actually retire a native working title. Every other strip pass left it untouched, so it re-armed the timer forever.agentStatus:clear, and — via a newsubscribeStatusDropseam — user dismissal, which never routes through the clear fan-out. Connection-scoped transient clears are deliberately ignored.Supersedes #13891 and #13923, which each fix part of this. Neither is modified or closed by this PR.
Why
Fixes the two halves of #13890 at the layers that own them.
Why a marker table rather than a regex per state. The failure in #13890 is not that Orca mis-parsed a title; it's that upstream re-punctuated a channel Orca was pattern-matching by hand, and the parser silently produced a wrong answer instead of no answer. Hard-coding three delimiters into a regex plus three branches recreates that coupling one release later. A table gives one place to add the next marker, and a contract test walks the table so the parser and the classifier cannot drift apart the way they did here.
Three deliberate robustness properties, all covered by tests:
|, more marker characters, and other agents' status glyphs. Leftmost-marker-wins handles all of it without parsing the label.πonly has to sit at a token boundary, not at the start of the string, so any wrapper prefix shape (zsh | π : cwd,tmux: π : cwd) still exposes the marker.π ~ cwdreturns null and the pre-existing Pi gates decide, so the next protocol change degrades to today's behavior instead of confidently asserting the wrong state.Why the legacy form is untouched. Whitespace is required before the marker, so 17.2.11's
π: cwddisabled title andπ - cwdkeep their historical idle classification and⠋ π - cwdkeeps reading as working. Hosts on the old OMP are unaffected.Why no
process.platformgate. This is WSL/ConPTY behavior, but the bytes are not local-only: the same title reaches a macOS or Linux client driving a Windows/WSL host over SSH or the mobile transport. Gating the parser on the client's platform would fix native Windows and leave every remote consumer broken. The classifier is shared by main, renderer, and remote consumers precisely so all of them agree.Why two spinner seams, not one. The spinner is a stand-in for a live hook row, so it must not outlive one. Pane teardown was already covered; a pane-scoped status clear and a user dismissal were not, and they reach the server through different paths (
emitPaneStatusClearedvsdropStatusEntry). Transient connection clears stay excluded — losing an SSH transport is not evidence the remote PTY stopped working.Linked Issue
Fixes #13890
Upstream behavior change: OMP WSL/ConPTY titles,
can1357/oh-my-pi#8014.Related but distinct: #13749 / #13776 cover stale identity after an agent exits back to a shell; this is an OMP process that stays inside its TUI and transitions between working and idle.
Visual Proof
N/A— no layout, styling, or copy changed. The user-visible effect is which status a pane reports and whether its title keeps rotating; both are asserted directly in tests rather than by screenshot. The display title a working native OMP pane normalizes to is unchanged from the existing Pi path (⠋ Piworking,Piidle).Testing
Focused suites (5 files, 411 tests) and the shared/terminal-pane sweep, on macOS:
Red/green proof that the new tests are not vacuous — with only the two call sites in
agent-title-status.tsstubbed out (parser and tests left in place),pi-state-title-marker.test.tsgoes 13 failed / 13 passed; restored, 26 passed. The 13 that still pass without the fix are the legacy-form and abstention cases, which are asserting preserved behavior on purpose.Coverage added, table-driven:
π: cwd,π - cwd,⠋ π - cwdkeep their historical classificationπ : / π > / π !zsh | π : cwd,zsh | tmux | π > cwd,tmux: π : cwdπ ! cwd, bare and wrapped|, further markers, and another agent's status glyphsbecame-idle)Gates on changed files only (a full
pnpm typecheckwas skipped deliberately — it OOMs on this machine; CI covers it):pnpm exec oxlint— cleanpnpm exec oxfmt --check— cleannode config/scripts/check-changed-code-quality.mjs -- <merge-base>— code quality 0, type-aware 0, React Doctor 0, across 10 changed filesI manually tested these changes locally — no. I have no Windows + WSL2 host in this environment, so the runtime path is covered by the byte-level parity harness rather than a physical A/B. Worth a Windows/WSL smoke before merge.
Automated tests added/updated
AI Disclosure
Implemented with Claude (Opus 5) in Orca.
Review
process.platformbranch, by design: the title bytes originate on a Windows/WSL host but are classified by whichever client renders the pane, which may be any platform. Behavior on non-OMP titles is unchanged, and the legacy OMP forms are explicitly pinned by test.execper title, ahead of gates that already ran several substring scans;clearPiStateWorkingMarkerruns only on the 3-second stale path. No new timers, allocations per frame, or IPC.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — changed-file lint/format/quality gates and the shared + terminal-pane test sweep pass locally; full typecheck and build deferred to CI (local typecheck OOMs)Author