Repository navigation
Conversation
📝 WalkthroughWalkthroughThis PR modifies the generated Pi agent status extension source to make hook POST delivery non-blocking. It introduces a fixed timeout constant and a serialized post queue, reworks the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
🧹 Nitpick comments (1)
src/main/pi/agent-status-extension-source.ts (1)
112-118: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoffSerialized queue can accumulate a backlog and lag status under bursty events.
post()chains every event onto a single serializedpostQueue, and eachpostOnce()can take up toHOOK_POST_TIMEOUT_MS(1s). During high-frequency streaming (e.g. rapidtool_execution_start/tool_call), events can arrive faster than the queue drains, so reported status may fall progressively behind the agent's real state and the tail of pending posts grows for the session lifetime.Since these are point-in-time status snapshots, consider coalescing — e.g. dropping/replacing a pending update for the same event type rather than delivering every queued item in order. Not blocking; the current approach is correct, just potentially wasteful under load.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d08350ff-e2c5-4e49-a230-971223398b66
📒 Files selected for processing (2)
src/main/pi/agent-status-extension-source.test.tssrc/main/pi/agent-status-extension-source.ts
|
Thanks for identifying the awaited Pi hook path. Closing this as superseded by merged PR #8355. #8355 keeps the non-blocking, one-second-bounded delivery intent from this PR, but replaces the serialized promise backlog with a strict bound of one active request plus one latest pending snapshot. It also adds executed generated-extension behavior tests and fixes the separate session_shutdown false-completion path from #7791. |
Summary
Keep Orca's managed Pi status extension from blocking running Pi turns while it reports agent status. Hook events now enqueue ordered background POSTs with a 1s abort timeout instead of awaiting loopback delivery inside Pi event handlers.
Fixes #7791.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test(run under Node 24.17.0; failed on unrelated timing-sensitive tests listed below)pnpm buildAdditional validation run:
pnpm vitest run src/main/pi/agent-status-extension-source.test.ts src/main/pi/titlebar-extension-service.test.ts --maxWorkers=1pnpm run typecheck:nodepnpm exec vitest run --config config/vitest.config.ts src/main/ssh/ssh-system-transport.integration.test.ts src/main/attribution/terminal-attribution.test.ts src/relay/git-handler-pull-reconciliation.test.ts src/relay/subprocess.test.ts src/main/daemon/node-pty-fd-leak.test.ts --maxWorkers=1 --testTimeout=60000pnpm testnotes:window.localStoragewas unavailable in that unsupported Node runtime.AI Review Report
Reviewed the Pi managed-extension path for blocking behavior, event ordering, and regression coverage. The main risk checked was that Pi awaits extension event handlers, so awaited hook POSTs can pause active agent work if Orca's loopback hook server stalls or restarts. The change keeps events ordered via a promise queue while returning synchronously from Pi handlers.
Cross-platform review: no keyboard shortcuts, labels, UI layout, path separators, or Electron platform APIs changed. The generated extension uses standard
fetch,AbortController, and timer APIs in the Pi Node runtime, and keeps existing endpoint-file parsing for macOS, Linux, and Windows endpoint formats.SSH/remote/local review: this touches local Pi/OMP managed extension source only; remote hook routing and SSH relay handling are unchanged. Agent compatibility checked for Pi and OMP shared extension generation and existing titlebar-extension tests.
Security Audit
No new command execution, filesystem writes, credentials, IPC channels, or dependency changes. The POST body remains the existing JSON hook envelope sent to localhost with the existing hook token. The new abort timeout reduces denial-of-service/stall risk from an unavailable or wedged local hook receiver. Endpoint parsing and token handling are unchanged.
Notes
Agent-specific change for Pi/OMP managed hooks. Follow-up risk is limited to status delivery timing: because posts are now backgrounded, status updates may arrive shortly after the Pi event handler returns, but ordering is preserved within the queue.
X handle: N/A