Repository navigation
Conversation
📝 WalkthroughWalkthroughThe changes add status-drop subscriptions to Merge Risk: 🟡 Moderate · up to The title parser still fails to recognize legacy 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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
🧹 Nitpick comments (1)
src/main/startup/agent-hook-spinner-wiring.test.ts (1)
7-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winBuild the source path from separate segments.
Line 7 passes
'src/main/index.ts'as one path fragment. This embeds/and violates the repository rule to avoid assuming/or\. Usejoin(process.cwd(), 'src', 'main', 'index.ts').Proposed fix
- const source = readFileSync(join(process.cwd(), 'src/main/index.ts'), 'utf8') + const source = readFileSync(join(process.cwd(), 'src', 'main', 'index.ts'), 'utf8')As per coding guidelines, use
path.joinor Electron/Node path utilities for file paths and never assume/or\.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6f57e9a7-09fc-4b47-8c26-75a4d5dbdc78
📥 Commits
Reviewing files that changed from the base of the PR and between 444638d and 2baaea8d0a15d8f9f21995c393a9b9d7e64008e6.
📒 Files selected for processing (8)
src/main/agent-hooks/server.test.tssrc/main/agent-hooks/server.tssrc/main/index.tssrc/main/startup/agent-hook-spinner-wiring.test.tssrc/renderer/src/components/terminal-pane/terminal-title-tracker-parity.test.tssrc/shared/agent-detection.test.tssrc/shared/agent-title-status.tssrc/shared/omp-native-title-status.ts
4ff0cec to
227c24f
Compare
|
@coderabbitai review |
|
|
Cross-linking the full OMP status cluster for maintainer triage:
The visible symptom overlaps, but the two issue pairs cover distinct roots. Please choose the preferred implementation within each pair and prioritize a fix—the current stuck/misreported OMP status is materially disrupting normal use. |
adbcd4f to
36e5dd4
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3fb71acd-ae49-4ec3-ad18-9fa5fc7498aa
📒 Files selected for processing (8)
src/main/agent-hooks/server.test.tssrc/main/agent-hooks/server.tssrc/main/index.tssrc/main/startup/agent-hook-spinner-wiring.test.tssrc/renderer/src/components/terminal-pane/terminal-title-tracker-parity.test.tssrc/shared/agent-detection.test.tssrc/shared/agent-title-status.tssrc/shared/omp-native-title-status.ts
🚧 Files skipped from review as they are similar to previous changes (7)
- src/main/index.ts
- src/main/startup/agent-hook-spinner-wiring.test.ts
- src/shared/agent-title-status.ts
- src/renderer/src/components/terminal-pane/terminal-title-tracker-parity.test.ts
- src/main/agent-hooks/server.ts
- src/shared/agent-detection.test.ts
- src/main/agent-hooks/server.test.ts
| @@ -0,0 +1,44 @@ | |||
| import type { AgentStatus } from './agent-title-core' | |||
|
|
|||
| const OMP_NATIVE_STATE_RE = /(?:^| \| )\s*π\s+([:>!])(?=\s|$)/u | |||
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Handle the legacy π: marker as idle.
Line 3 requires whitespace between π and the delimiter. Therefore, getOmpNativeStateMatch('π: label') returns null, and getOmpNativeTitleStatus cannot return the required 'idle' state. A title such as π: legacy | π > later can also skip the first native segment.
Capture whether whitespace separates π from the delimiter. Return 'working' only for π :, return 'idle' for π:, and rewrite only the spaced working marker during cleanup. Add regression coverage for both forms and for wrapper-prefixed titles.
This follows the PR requirement that legacy π: remains idle.
Proposed fix
-const OMP_NATIVE_STATE_RE = /(?:^| \| )\s*π\s+([:>!])(?=\s|$)/u
+const OMP_NATIVE_STATE_RE = /(?:^| \| )\s*π(\s*)([:>!])(?=\s|$)/u
type OmpNativeStateMatch = {
delimiter: string
+ hasWhitespace: boolean
delimiterIndex: number
}
- const delimiter = match?.[1]
- if (delimiter === undefined || match?.index === undefined) {
+ const whitespace = match?.[1]
+ const delimiter = match?.[2]
+ if (
+ whitespace === undefined ||
+ delimiter === undefined ||
+ match?.index === undefined
+ ) {
return null
}
return {
delimiter,
+ hasWhitespace: whitespace.length > 0,
delimiterIndex: match.index + match[0].lastIndexOf(delimiter),
}
export function getOmpNativeTitleStatus(title: string): AgentStatus | null {
- const delimiter = getOmpNativeStateMatch(title)?.delimiter
- if (delimiter === ':') {
- return 'working'
+ const match = getOmpNativeStateMatch(title)
+ if (match?.delimiter === ':') {
+ return match.hasWhitespace ? 'working' : 'idle'
}
- if (match?.delimiter !== ':') {
+ if (match?.delimiter !== ':' || !match.hasWhitespace) {
return null
}Also applies to: 5-19, 23-34, 38-43
ELI5
OMP changed the terminal-title punctuation it uses on Windows/WSL. Orca read every new title as idle and could leave its fallback spinner running after the live hook row disappeared. This teaches the shared title authority the new states and stops that spinner at the authoritative row-deletion boundary.
What Changed
π :is working,π >is idle, andπ !needs input.π:as idle.|/ marker-shaped text inside OMP labels by treating the label as opaque after the first native marker.Why
Fixes #13890.
Authoritative ownership is split deliberately:
AgentHookServer.dropStatusEntryowns definitive removal of a live hook row, so spinner cleanup occurs only after a real deletion. Connection-scoped transient clears do not falsely idle a possibly-working remote PTY.Alternatives considered:
|delimiter.Linked Issue
Fixes #13890
Related upstream evidence: can1357/oh-my-pi#8014. Existing PR #13891 was reviewed as reference only; this PR adds authoritative live-row ownership, opaque-label parsing, stale-title neutralization, and a main wiring contract.
Visual Proof
N/A — no layout or styling changed. Rendered Electron validation on physical Windows 11 + Ubuntu 24.04 WSL/ConPTY observed:
π : physical-wsl→Pi - Running/⠋ Piπ > physical-wsl→Pi - Idle/Piπ ! physical-wsl→Needs inputagentStatus.drop(paneKey)removed the row and the 80 ms synthetic spinner did not repaint the later idle title.How to test
Falsifiable invariant:
π :→ workingπ >→ idleπ !→ permissionπ:→ idleDeterministic baseline/candidate/disabled evidence, using the same oracle command:
991a3fe963: red, 8 failures / 95 tests in the original focused contract.adbcd4f64dover64aec94cb2: green, 384/384.Additional validation:
pnpm typecheck— passed all node, CLI, and web projects.oxfmt --check— passed.git diff --check— passed.pnpm lintpassed code-quality, type-aware, reliability, max-lines, and bundled-skill guide gates, then stopped only on unrelated stale generated skill artifacts already present on current main:resources/skills/current-manifest.json,snapshot-registry.json, andrelease-mapping.json. They were not regenerated or included.Risk is limited to title classification and hook-row lifecycle. There is no RPC, stream opcode, persistence, or wire-shape change. macOS/Linux, folder workspaces, git worktrees, Git providers, Git 2.25, SSH, WSL, and remote version skew were considered; all consumers use the shared classifier and old peers continue exchanging the same title bytes.
AI Disclosure
Implemented with OpenAI Codex. Independent review passes covered architecture/security/correctness, performance/resources/UX, and cross-platform/readiness concerns.
Review
Clean for security, Windows/Linux/macOS compatibility, WSL/ConPTY, SSH and remote skew, folder workspaces/worktrees, mobile/shared consumers, backwards compatibility, and performance.
Checklist
Author