Open Cloud sandbox agents as Herdr panes - #3
Conversation
📝 WalkthroughWalkthroughThe change adds a Cloud entrypoint that selects an Agent Relay Cloud agent, warms its Daytona box, starts or reuses its broker agent, and attaches the broker stream to a Herdr pane. Documentation, manifest configuration, dependencies, and integration tests are included. ChangesCloud pane workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CloudPicker
participant AgentRelayCloud
participant DaytonaBox
participant FleetAgentPane
CloudPicker->>AgentRelayCloud: select and warm Cloud agent
AgentRelayCloud->>DaytonaBox: poll until box is ready
AgentRelayCloud->>FleetAgentPane: provide broker connection
FleetAgentPane-->>CloudPicker: attach live broker stream
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/cloud.test.mjs (1)
207-229: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winPreserve the single-writer status contract.
Add an assertion that
runCloudPickerdoes not callpane.report_agent. The test collects all requests but only checks pane creation. A picker-side status write can race thefleet-agentstatus projector.Proposed test assertion
const open = requests.find((entry) => entry.method === 'plugin.pane.open').params; + assert.equal( + requests.filter((entry) => entry.method === 'pane.report_agent').length, + 0, + 'leaves fleet-agent as the only status writer' + ); assert.equal(open.entrypoint, 'fleet-agent');🤖 Prompt for 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. In `@test/cloud.test.mjs` around lines 207 - 229, Add an assertion in the runCloudPicker test that no collected request has method pane.report_agent, while preserving the existing plugin.pane.open and result assertions.
🤖 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 `@test/cloud.test.mjs`:
- Around line 138-184: Add a concurrent creation test for ensureCloudBrokerAgent
that invokes it twice before either spawn completes, ensuring only one Cloud
broker agent is ultimately created. Update the creation flow to handle this race
by making spawnCli idempotent for the derived agent name or, on duplicate-name
failure, listing agents and reusing the existing one.
---
Nitpick comments:
In `@test/cloud.test.mjs`:
- Around line 207-229: Add an assertion in the runCloudPicker test that no
collected request has method pane.report_agent, while preserving the existing
plugin.pane.open and result assertions.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1a6f35b7-c1c8-433f-bd0b-d6fd6d25f887
⛔ Files ignored due to path filters (5)
dist/cloud-picker.mjsis excluded by!**/dist/**dist/cloud.mjsis excluded by!**/dist/**dist/fleet-agent.mjsis excluded by!**/dist/**dist/fleet.mjsis excluded by!**/dist/**package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
README.mdherdr-plugin.tomlpackage.jsontest/cloud.test.mjs
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
What changed
cloudpicker entrypoint that uses the existing non-interactive Agent Relay Cloud sessionfleet-agententrypoint against the remote broker, preserving the T3/T4 pane and single-writer status-projection model@agent-relay/harness-driverWhy
T5 requires a Cloud sandbox agent to appear as a drivable Herdr pane while working in a live Relayfile-mounted tree with no clone or push. Cloud already exposes the broker through a signed Daytona preview URL, so this extends the existing fleet pane rather than introducing a third terminal model.
Dependency
Depends on AgentWorkforce/cloud#2957. The picker sends the new
requireRelayfileMount: trueflag so Cloud fails the warm rather than returning a mountless ready box.Validation
npm ci --omit=dev: exit 0npm test: 65 passed, 1 Windows-only skip, exit 0git diff --check: exit 0Live probe status
Cloud auth, workspace lookup, agent listing, a real Daytona box, and its broker endpoint were reachable. The live probe also exposed the missing required-mount guard fixed by cloud#2957: hosted Cloud marked a box ready while
/workspacewas unavailable for PTY spawn. Provider credentials available on this host were expired or failed their warm/spawn path, and Herdr itself is not installed here. Therefore the final visible-pane + local-edit acceptance is intentionally not claimed yet; it requires deployment of cloud#2957 and a host with Herdr plus a healthy coding credential.Summary by cubic
Adds a Cloud picker that warms a Daytona Cloud agent box in Relayfile mode and opens its broker terminal as a Herdr pane using the existing
fleet-agent. Also ensures concurrent Cloud pane opens converge on a single broker agent.New Features
cloudentrypoint and pane inherdr-plugin.tomlthat uses a non-interactiveagent-relay loginsession to warm a box withrequireRelayfileMount: trueand/workspace, then spawn or reuse one PTY agent with a stable name; concurrent opens re-list and attach to the same agent.fleet-agentagainst the remote broker and keeps the T3/T4 pane model and single-writer status projection.@agent-relay/harness-driver; passesRELAY_BROKER_URL/RELAY_BROKER_API_KEYvia env only, discards the Relayfile token, and avoids putting Cloud/broker credentials in argv or logs. Docs and tests added.Dependencies
@agent-relay/cloudand@agent-relay/harness-driver.Written for commit e7cf2bc. Summary will update on new commits.