Repository navigation
feat(broker): declare node_kind broker in spawn capability metadata - #1981
Conversation
Cloud placement (cloud#5310) refuses an unclaimed node whose spawn capabilities state no metadata.configured.node_kind. build_node_register now defaults configured.node_kind to "broker" on every spawn:<harness> capability, preserving any kind the manifest already declares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
khaliqgant has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Default and preserve spawn metadata crates/broker/src/node_control.rs, CHANGELOG.md |
build_node_register adds the broker default to spawn: capability metadata when node_kind is absent. Tests cover preservation of existing kinds and other metadata, as well as non-spawn capabilities. |
Relayflow registration validation tests/relayflows/cases/5310-broker-node-kind/* |
The relayflow runner checks the broker’s first registration against local HTTP and WebSocket stand-ins. The case expects missing spawn kinds on the base and broker kinds on the fixed revision. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 35a4d
-
Broker spawn capabilities retain their declared node kind across registration and heartbeats. No issue identified here prevents merging after normal checks.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description includes the required Summary, Test Plan, RelayFlow Proof, and Screenshots sections. It explains the implementation, test results, mutation checks, lint status, and RelayFlow evidence. The test checklist remains unchecked, but the detailed test results make the description mostly complete.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
I’m a rabbit, pleased to see
Spawn kinds set to broker, neatly.
Old configured facts remain,
Tests observe the register train.
I hop through fields, then rest.
Clear metadata is the best.
Comment @coderabbitai help to get the list of available commands.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; no actionable defects were found.
|
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Summary
AgentWorkforce/cloud#5310 makes Cloud spawn placement refuse an unclaimed node unless one of its
spawn:<harness>capabilities declaresmetadata.configured.node_kind("desktop"or"broker"). The CLI broker sentmetadata: Noneon its spawn capacity, so every unclaimed CLI broker became non-spawnable until someone ranagent-relay node claim.build_node_register(crates/broker/src/node_control.rs) now runs every capability through a new helper,spawn_capability_metadata. Onspawn:*capabilities it setsmetadata.configured.node_kind = "broker"only when no kind is already declared, and it leaves the rest ofconfigured(andlive) untouched. Non-spawn capabilities pass through unchanged.build_node_register, and the heartbeat descriptor reuses the registered capabilities, so the declaration is on both frames.probe/src/relay/spawn/wire.rs, which declaresnode_kind: "desktop"). It does not use this code path. If a manifest that reaches the broker already declaresdesktop, that value is preserved (covered by a test).Tests
build_node_register_declares_broker_node_kind_on_every_spawn_capabilitychecks the wire JSON and the heartbeat.build_node_register_preserves_declared_node_kind_and_configured_factschecks that a desktop kind and existingconfigured/livefacts are preserved. Updated:build_node_register_prefers_manifest_identity.cargo test -p agent-relay-broker --lib -- node_control::tests runtime::init: 121 passed, 0 failed.declares_broker_node_kind…,preserves_declared…,prefers_manifest_identity).node_kind): onlypreserves_declared_node_kind…fails, withleft: {"node_kind":"broker",…} right: {"node_kind":"desktop",…}. The other tests surviving is expected, because they never declare a kind.cargo fmt --check: OK.cargo clippy --lib --bins -D warnings: OK.--all-targetsreports 2 existing test-code lints (node_control.rs:8057,:8677) from older commits. This diff does not touch them.RelayFlow proof
feature5310-broker-node-kindThe case runs the broker artifact against a fake Relaycast, accepts the first
node.register, and records each capability'smetadata.configured.node_kind. I verified it locally with the fix mutated out (base) and with it in place (head). Both runs exited 0:absent spawn_capabilities_state_no_node_kind. All sixspawn:*havenode_kind: null.fixed spawn_capabilities_declare_broker_node_kind. All sixspawn:*declare"broker".release, native-delivery and delivery-cursor capabilities staynull.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Narrow registration-metadata change with tests and a relayflow proof; only affects spawn capability wire shape for brokers missing node_kind.
Overview
Fixes Cloud spawn placement for unclaimed CLI brokers after cloud#5310 started requiring
metadata.configured.node_kindonspawn:<harness>capabilities.build_node_registernow runs capabilities throughspawn_capability_metadata, which setsconfigured.node_kindto"broker"only onspawn:*entries when no kind is already present; existing values (e.g."desktop") and otherconfigured/livemetadata are unchanged. Non-spawn capabilities are untouched. Because registration and heartbeats reuse this path, the declaration appears onnode.registerand heartbeat capability snapshots.Adds unit tests for default injection, preservation of declared kinds/facts, and an updated identity test; adds RelayFlow case
5310-broker-node-kindthat observes the firstnode.registerfrom a broker binary. CHANGELOG documents the patch under Unreleased.Reviewed by Cursor Bugbot for commit 57cd580. Bugbot is set up for automated code reviews on this repo. Configure here.
Agent Relay sessions
claudesession942cd2fb· opened viagh pr create· last active 2026-10-18claudesessionad12d71a· contributor · rangh prcommands · last active 2026-10-27