Add ambient browser runtime bridge#135
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
📝 WalkthroughWalkthroughAdds browser runtime probing and a Unix-domain RPC for browser tooling; extends browser grant/session handling with ChannelID and an Ensure flow; refactors tool lifecycle to emit structured start/update/result events; propagates browser context through daemon, session, and PI executor layers; adds extension, tests, and skill docs. Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant RPC as Browser RPC Handler
participant Daemon as Daemon
participant Mgr as Browser Manager
participant ES as Event System
Client->>RPC: send length-prefixed JSON-RPC "browser_tool"
RPC->>Daemon: validate request & context -> call Manager.Ensure
Daemon->>Mgr: Ensure(grant/session/project/task/channel/machine/expires)
alt grant available
Mgr-->>Daemon: existing Grant
else need open
Mgr-->>Mgr: lazy Open session -> re-derive Grant (includes ChannelID)
Mgr-->>Daemon: new Grant
end
RPC->>ES: emit BrowserToolCallStarted
RPC->>Mgr: call ToolResult(BrowserToolCall)
alt service success
Mgr->>ES: BrowserToolCallUpdated(status: "ok")
Mgr->>ES: BrowserToolResult(OK:true, SessionID/ChannelID,...)
RPC-->>Client: JSON-RPC response ok (result)
else credential-method rejected
Mgr->>ES: BrowserToolCallUpdated(status: "feature_not_enabled"/approval_required)
Mgr->>ES: BrowserToolResult(ErrorCode: "feature_not_enabled")
RPC-->>Client: JSON-RPC error (-32001 / tool error)
else service failure
Mgr->>ES: BrowserToolCallUpdated(error details)
Mgr->>ES: BrowserToolResult(ErrorCode: "browser_tool_failed")
RPC-->>Client: JSON-RPC error (-32001 / tool error)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
45e2a11 to
0bbbafb
Compare
Summary
Adds the daemon side of the ambient GSD Browser loop:
gsd-browser0.1.20 and advertises runtime state in daemon hellogsd_browsertool and bundled browser skill in PiDependencies
gsd-build/protocol-gov0.34.0 is tagged and used by this branch.gsd-build/gsd-browserv0.1.20 is tagged for the cloud method manifest/runtime minimum.Verification
cd internal/pi/extension && npm test -- browser-tool.test.mjs browser-methods.generated.test.mjsgo test ./...go build -o /tmp/gsd-cloud-browser-ambient-loop .Post-merge
Tag the daemon release as the next
daemon/v0.3.xversion and verify the release workflow produces binaries.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests