Repository navigation
feat(broker): declare node_kind broker in spawn capability metadata - #1981
khaliqgant wants to merge 1 commit into
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. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
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-18