Skip to content

feat(broker): origin_actor — bump relaycast crate 3.0.0, emit CLI path#1085

Merged
willwashburn merged 1 commit into
mainfrom
feat/origin-actor-broker
Jun 10, 2026
Merged

feat(broker): origin_actor — bump relaycast crate 3.0.0, emit CLI path#1085
willwashburn merged 1 commit into
mainfrom
feat/origin-actor-broker

Conversation

@willwashburn

Copy link
Copy Markdown
Member

PR4 (core) of the origin_actor rollout — plan: cloud/plans/origin-actor.md. Aligns the broker producer with the engine 3.0.0 contract (harnessorigin_actor, relaycast#184).

Changes

  • Bump the relaycast crate pin =2.4.0 → =3.0.0 (the SDK renamed with_harnesswith_origin_actor; 3.0.0 is published to crates.io).
  • The broker's own relaycast traffic (workspace stream + agent registration) now sends origin_actor = agent-relay-cli/cli via with_origin_actor, at all three client sites (the WS handshake + both build_relay_client helpers). New telemetry::BROKER_ORIGIN_ACTOR const.

This fixes attribution for the broker's own @relaycast/sdk-rust traffic — the majority of relaycast_server_* events — which would otherwise go unknown once the gateway (engine 3.0.0) stops reading the old X-Relaycast-Harness header.

Scope (core only, per direction)

This lands the harness + crate-bump core. Deliberate fast-follows:

  1. Per-worker spawned-agent path agent-relay-cli/agent/<harness> — extends the open #1078, and needs the relay JS SDK (@relaycast/sdk) renamed to send X-Relaycast-Origin-Actor so spawned agents are attributed.
  2. Model + version in the name segment (@<version>-<model>) — the per-harness sourcing.

Verification

  • Builds against crate 3.0.0 with no other reconciliation needed (clean major bump).
  • 709 broker lib tests pass; clippy + cargo fmt --check clean.

Note

The broker's own traffic is attributed to agent-relay-cli/cli (per the plan's "CLI driving directly" case). The previously-forwarded orchestrator harness (claude-code/codex) now surfaces on the spawned agents instead (fast-follow #1), not on the broker's own events.

🤖 Generated with Claude Code

PR4 (core) of the origin_actor rollout (cloud/plans/origin-actor.md). Aligns
the broker producer with the engine 3.0.0 contract (harness -> origin_actor).

- Bump the `relaycast` crate pin =2.4.0 -> =3.0.0 (the SDK renamed
  `with_harness` -> `with_origin_actor`; published 3.0.0 to crates.io).
- The broker's own relaycast traffic (workspace stream + agent registration)
  now sends `origin_actor = agent-relay-cli/cli` via the renamed
  `with_origin_actor`, at all three client sites (WS handshake + both
  `build_relay_client` helpers). New `telemetry::BROKER_ORIGIN_ACTOR` const.

This fixes attribution for the broker's own (@relaycast/sdk-rust) traffic —
the majority of `relaycast_server_*` events.

Fast-follows (separate PRs):
- per-worker spawned-agent path `agent-relay-cli/agent/<harness>` (extends the
  open #1078) + the relay JS SDK rename so spawned agents send the new header.
- model + version in the name segment (`@<version>-<model>`) — sourcing.

709 broker tests pass; clippy + fmt clean; builds against crate 3.0.0 with no
other reconciliation needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@willwashburn willwashburn requested a review from khaliqgant as a code owner June 10, 2026 20:06
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 52ac9fe4-233c-4501-8b13-e34094f601c6

📥 Commits

Reviewing files that changed from the base of the PR and between 040da37 and b41590e.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • crates/broker/Cargo.toml
  • crates/broker/src/relaycast/auth.rs
  • crates/broker/src/relaycast/ws.rs
  • crates/broker/src/telemetry.rs

📝 Walkthrough

Walkthrough

The broker's relaycast integration switches from conditional harness forwarding to a fixed origin actor constant. A new BROKER_ORIGIN_ACTOR constant is added to distinguish broker traffic from spawned agent traffic. The relaycast dependency is bumped to 3.0.0, and both HTTP client and WebSocket setup code now set the origin actor instead of forwarding harness values.

Changes

Broker origin actor for relaycast

Layer / File(s) Summary
Define broker origin actor constant
crates/broker/src/telemetry.rs
New constant BROKER_ORIGIN_ACTOR defines the broker's origin actor string ("agent-relay-cli/cli") for relaycast traffic, distinguishing it from harness attribution for spawned agents.
Wire origin actor in relaycast integration
crates/broker/Cargo.toml, crates/broker/src/relaycast/auth.rs, crates/broker/src/relaycast/ws.rs
Relaycast dependency is updated to =3.0.0. HTTP client construction in build_relay_client and WebSocket upgrade in WsClientOptions both now set the origin actor via the new constant, removing previous conditional harness forwarding logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • AgentWorkforce/relay#1069: Both PRs modify the relaycast client setup in auth.rs and ws.rs to configure metadata on client options; this PR switches from harness forwarding to a fixed origin actor.

Suggested reviewers

  • khaliqgant

Poem

🐰 The broker hops with clarity,
No more harness mystery—
One actor name, forever true,
Relaycast flows, shiny and new! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: bumping the relaycast crate to 3.0.0 and implementing the origin_actor feature for the broker.
Description check ✅ Passed The PR description is comprehensive and covers all essential information: context (origin_actor rollout plan), changes made, scope, and verification. However, it omits the template's 'Test Plan' and 'Screenshots' sections.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/origin-actor-broker

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@willwashburn willwashburn merged commit 9244d9d into main Jun 10, 2026
44 of 45 checks passed
@willwashburn willwashburn deleted the feat/origin-actor-broker branch June 10, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant