fix: project public agent focus to attached clients - #3764
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
Merge Risk: ⚪ Minimal · up to Successful public agent-focus requests now update attached shell clients, with regression coverage for response, location, snapshot, and rendered surface. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use 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 |
|
@coderabbitai review |
|
✅ Action performedReview finished.
|
Greptile SummaryThis PR makes successful public
Confidence Score: 5/5The PR appears safe to merge, with the new behavior following established session-wide focus and geometry paths. No actionable failure was identified; unsuccessful requests remain non-projecting, successful AgentFocus requests resolve to the focused tab, and client-originated navigation retains its connection-local handling.
|
| Filename | Overview |
|---|---|
| src/server/headless/client_views.rs | Adds success-gated public AgentFocus projection and integrates AgentFocus with existing shell geometry handling. |
| src/server/headless/tests/mod.rs | Adds a headless regression test verifying response state, client projection replacement, and rendered target content. |
Sequence Diagram
sequenceDiagram
participant API as Public API client
participant Server as Headless server
participant App as Application runtime
participant Shell as Attached shell clients
API->>Server: agent.focus(target)
Server->>App: Process request and pending events
App-->>Server: AgentInfo success or error
alt Successful focus
Server->>Server: Resolve resulting tab
Server->>Shell: Replace each shell projection
Server->>Shell: Reapply controlled geometry
else Failed focus
Server-->>API: Forward error unchanged
end
Server-->>API: Forward response
Reviews (1): Last reviewed commit: "fix: project public agent focus to attac..." | Re-trigger Greptile
Issue
Running
herdr agent focusreports success and changes server focus, but an attached client's viewport stays on its previous workspace.Problem
Public focus handling did not classify
agent.focusas client navigation after independent client views were introduced. The server changed the active pane without replacing each client's projected tab.How did we fix it?
Herdr now projects a successful public agent focus to every attached shell client. It resolves the target after pending events are applied, then uses the existing public focus and geometry paths. Failed requests and client-originated navigation keep their existing behavior.
Verification
The new headless regression failed before with the client on
w2while the response focusedw1. It now passes and verifies the response, client location, replacement snapshot, and rendered target surface. The matching disposable-session interaction now moves fromSECOND_CURRENT_VIEWtoFIRST_TARGET_VIEW. Five focused tests pass. CI passes on Linux, macOS, and Windows.refs #3760