Skip to content

fix: prioritize pane focus acknowledgements - #106

Merged
cvsloane merged 2 commits into
mainfrom
refactor/frontend-command-center
Jul 22, 2026
Merged

cvsloane merged 2 commits into
mainfrom
refactor/frontend-command-center

Conversation

@cvsloane

@cvsloane cvsloane commented Jul 22, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • send terminal navigation results on the unsequenced live lane so durable queue fsync cannot delay focus confirmation
  • bind acknowledgements to the authenticated host and exact pending browser channel/request
  • document control-plane-first upgrades and agent-first rollbacks for this protocol boundary

Verification

  • go test ./internal/ws ./cmd/agentd
  • schema tests and typecheck (61 tests)
  • focused control-plane agent WebSocket and terminal route tests (32 tests) plus typecheck
  • fresh adversarial re-review: pass

Summary by CodeRabbit

  • Bug Fixes

    • Improved terminal navigation responsiveness by delivering live results without waiting for durable message processing.
    • Prevented navigation results from being accepted when they originate from an incorrect terminal host or channel.
    • Ensured navigation acknowledgements no longer use durable sequencing.
  • Documentation

    • Added upgrade and rollback guidance for protocol-compatible releases.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cvsloane, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07fe0c7e-16c8-4b26-911d-e7270ca64c82

📥 Commits

Reviewing files that changed from the base of the PR and between c8b9dbc and d72bd56.

📒 Files selected for processing (1)
  • agents/agentd/internal/ws/client_test.go
📝 Walkthrough

Walkthrough

Terminal navigation results now travel through an unsequenced live channel without durable persistence, use server envelopes without sequence fields, and undergo authenticated host/channel validation before reaching the browser.

Changes

Terminal navigation live path

Layer / File(s) Summary
Live message contract and agent transport
packages/ac-schema/src/message.ts, agents/agentd/..., tests/fixtures/protocol/*, tasks/lessons.md
terminal.navigation_result uses a server envelope without seq; agentd sends it through SendUnsequenced, whose WebSocket write remains serialized without waiting on durable persistence.
Control-plane routing and host validation
services/control-plane/src/routes/terminal.ts, services/control-plane/src/ws/agent.ts, services/control-plane/tests/*, docs/operations.md
The control plane processes results outside sequence acknowledgements, validates the authenticated host and active channel, and tests rejection of forged cross-host responses alongside valid results.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant agentd
  participant wsClient
  participant controlPlane
  participant navigationHandler
  participant browserChannel
  agentd->>wsClient: SendUnsequenced terminal.navigation_result
  wsClient->>controlPlane: Live WebSocket message with Seq 0
  controlPlane->>navigationHandler: Payload and authenticated hostId
  navigationHandler->>browserChannel: Verified navigation result
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: prioritizing pane focus acknowledgements over the durable path.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/frontend-command-center

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

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agents/agentd/internal/ws/client_test.go`:
- Around line 151-154: Update the priority-message assertion in the WebSocket
client test to verify that the seq field is absent, rather than only checking
message.Seq equals zero. Inspect the raw JSON object or decode seq as
json.RawMessage, assert the key is missing, and retain the existing type and
message-order checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f36db43e-ebe3-4880-a4fc-b409377d240e

📥 Commits

Reviewing files that changed from the base of the PR and between 904158b and c8b9dbc.

📒 Files selected for processing (13)
  • agents/agentd/cmd/agentd/main.go
  • agents/agentd/internal/ws/client.go
  • agents/agentd/internal/ws/client_test.go
  • agents/agentd/internal/ws/protocol_fixtures_test.go
  • docs/operations.md
  • packages/ac-schema/src/message.ts
  • packages/ac-schema/tests/terminal.test.ts
  • services/control-plane/src/routes/terminal.ts
  • services/control-plane/src/ws/agent.ts
  • services/control-plane/tests/agentWebSocket.test.ts
  • services/control-plane/tests/terminalRoute.test.ts
  • tasks/lessons.md
  • tests/fixtures/protocol/terminal-navigation-result.json

@cvsloane
cvsloane merged commit bf8887b into main Jul 22, 2026
5 checks passed
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.

1 participant