Skip to content

Migrate Relay-broker into relay main#412

Closed
willwashburn wants to merge 1 commit intomainfrom
migration
Closed

Migrate Relay-broker into relay main#412
willwashburn wants to merge 1 commit intomainfrom
migration

Conversation

@willwashburn
Copy link
Copy Markdown
Member

@willwashburn willwashburn commented Feb 13, 2026

Major repository restructuring: migrate core to Rust and introduce a new TypeScript SDK package. Added Cargo.toml and Cargo.lock plus several Rust sources (src/auth.rs, src/config.rs, src/control.rs, src/conversation_log.rs) and a .github CI workflow. Removed many legacy JS/TS packages, tooling, examples, and workflow files; cleaned up docs and references. Updated top-level README, .gitignore, package.json, package-lock.json, install.sh, and refreshed relay-snippets. This change consolidates the project around a Rust core while providing an SDK for TypeScript consumers.


Open with Devin

Major repository restructuring: migrate core to Rust and introduce a new TypeScript SDK package. Added Cargo.toml and Cargo.lock plus several Rust sources (src/auth.rs, src/config.rs, src/control.rs, src/conversation_log.rs) and a .github CI workflow. Removed many legacy JS/TS packages, tooling, examples, and workflow files; cleaned up docs and references. Updated top-level README, .gitignore, package.json, package-lock.json, install.sh, and refreshed relay-snippets. This change consolidates the project around a Rust core while providing an SDK for TypeScript consumers.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the project to a Rust-based broker with a new TypeScript SDK, along with a large cleanup/restructure of legacy Node tooling and documentation to match the new architecture.

Changes:

  • Replaces legacy daemon/dashboard-centric docs with SDK-first + Relaycast transport documentation.
  • Introduces a new Rust crate (Cargo.toml) and a simplified GitHub Actions CI focused on Rust + SDK typechecking.
  • Removes large amounts of legacy docs, workflows, and auxiliary tooling that no longer apply.

Reviewed changes

Copilot reviewed 61 out of 665 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/reference/api.mdx Removes legacy JS/TS API reference page.
docs/quickstart.mdx Rewrites quickstart around @agent-relay/sdk orchestration flow.
docs/mint.json Updates docs navigation to remove deprecated pages and rename groups.
docs/introduction.mdx Updates product positioning and architecture overview to SDK + broker + Relaycast.
docs/guides/session-continuity.mdx Removes continuity guide (legacy feature set).
docs/guides/multi-project.mdx Removes multi-project coordination guide (bridge-era docs).
docs/guides/editor-integration.mdx Removes ACP editor integration guide (legacy integration).
docs/guide/agent-setup.md Removes legacy setup guide focused on daemon/dashboard/MCP.
docs/features/spawning.mdx Reworks spawning docs for SDK and broker-managed PTY/headless agents.
docs/features/messaging.mdx Reworks messaging docs around Relaycast channels/DMs/threads and SDK APIs.
docs/features/hooks.mdx Removes hooks documentation (legacy package/feature).
docs/features/dashboard.mdx Removes dashboard documentation (legacy UI).
docs/features/shadows.mdx Removes shadow agents documentation (legacy mechanism).
docs/features/cloud.mdx Replaces “Cloud Features” with Relaycast transport documentation.
docs/features/bridging.mdx Removes multi-project bridging docs (legacy topology).
docs/architecture/storage.md Removes storage architecture documentation (legacy adapters).
docker-compose.test.yml Removes full cloud QA docker-compose stack.
docker-compose.browser.yml Removes browser testing docker-compose setup.
TRAIL_GIT_AUTH_FIX.md Removes trail doc artifact from repo root.
TESTING.md Removes manual testing guide for legacy daemon/bridge/dashboard flows.
README.md Updates README to Rust broker + TS SDK (new install, usage, CLI modes).
Cargo.toml Adds Rust crate definition and dependencies for the broker.
CLAUDE.md Replaces placeholder with full project + workflow guidance for agents.
AGENTS.md Removes legacy agent instruction/manifest content.
.openskills/frontend-design/SKILL.md Removes openskills skill doc (repo cleanup).
.npmignore Removes legacy npmignore (old packaging model).
.mcp.json Removes MCP server config (legacy integration).
.github/workflows/test.yml Removes old Node-centric CI workflow.
.github/workflows/test-install.yml Removes install-script CI workflow.
.github/workflows/test-build.yml Removes build-script CI workflow.
.github/workflows/stress-tests.yml Removes legacy stress-test workflow (Node-based).
.github/workflows/storage-testing.yml Removes storage-focused workflow (Node adapters).
.github/workflows/security.yml Removes Node security scanning workflow (npm/CodeQL JS).
.github/workflows/package-validation.yml Removes Node package validation workflow.
.github/workflows/node-compat.yml Removes Node compatibility workflow.
.github/workflows/e2e-tests.yml Removes Node E2E workflow.
.github/workflows/cancel-on-merge.yml Removes post-merge workflow cancellation job.
.github/workflows/ci.yml Adds new consolidated CI for Rust tests/clippy/fmt + SDK typecheck.
.eslintrc.cjs Removes legacy ESLint config.
.env.example Removes legacy env example (telemetry/storage/cloud stack).
.dockerignore Removes legacy dockerignore (old dockerized stack).
.claude/rules/wrapper.md Removes wrapper conventions (legacy tmux wrapper).
.claude/rules/wrapper-inheritance.md Removes wrapper inheritance guidance (legacy TS wrappers).
.claude/rules/testing.md Removes Vitest testing conventions (legacy TS tests).
.claude/rules/sdk-daemon-parity.md Removes SDK/daemon parity guidelines (legacy architecture).
.claude/rules/protocol.md Removes old protocol conventions doc (legacy TS protocol package).
.claude/rules/protocol-schema-sync.md Removes protocol schema sync guidance (legacy relay-pty + TS protocol).
.claude/rules/hooks.md Removes hooks conventions (legacy TS hooks).
.claude/rules/daemon.md Removes daemon conventions (legacy TS daemon).
.claude/rules/bridge.md Removes bridge conventions (legacy TS bridge).
.claude/rules/rust.md Adds Rust conventions for src/ and tests/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test
- run: cargo test --test 'stress_*' -- --ignored
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo test --test does not support glob patterns (it expects an exact integration test target name), so --test 'stress_*' will fail the workflow. If the goal is to run all ignored “stress” tests, use the standard name filter instead (e.g., run ignored tests with a substring filter) or explicitly enumerate each stress test target.

Suggested change
- run: cargo test --test 'stress_*' -- --ignored
- run: cargo test stress_ -- --ignored

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +61 to +66
relay.onMessageReceived = (msg) => {
console.log(`${msg.from}: ${msg.body}`);
};

# for Claude
npx prpm install @agent-relay/agent-relay-snippet --location CLAUDE.md
```
// Send messages
await codex.sendMessage({ body: "Ready for review" });
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README example is internally inconsistent with the updated docs elsewhere in this PR (quickstart.mdx, messaging.mdx) where messages use text (not body). This will confuse SDK users and may be incorrect if the SDK’s public types are text-based. Align the README snippet to the SDK’s actual message shape (field names and required routing fields like to, if applicable) and keep it consistent across docs.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

khaliqgant added a commit that referenced this pull request Feb 13, 2026
Pull relay-broker directory from relay-broker-integration branch as the
foundation for the hybrid approach. Will apply bug fixes from PR #412 on top.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Prevent agents from spoofing human identity by naming themselves
"human:..." to bypass release ACL checks. When sender_kind is
explicitly Agent, immediately return false regardless of name string.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
When base URL already ends with /stream (e.g. wss://rt.relaycast.dev/stream),
avoid appending /v1/stream which produced invalid double-path URLs like
wss://host/stream/v1/stream. Now correctly preserves the existing /stream path.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Rename ensure_reaycast_mcp_config to ensure_relaycast_mcp_config
(missing 'l' in relaycast). Updated all call sites in main.rs.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Without a body-size bound, a burst of large messages from the same
sender within the coalesce window would concatenate without limit,
potentially causing large memory allocations. Add MAX_COALESCED_BODY_SIZE
(32 KiB) check that flushes the current group when exceeded.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Make terminate_child public so it can be reused from main.rs instead
of being duplicated inline, reducing code duplication.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
* feat: add relay-broker Rust binary from PR #404

Pull relay-broker directory from relay-broker-integration branch as the
foundation for the hybrid approach. Will apply bug fixes from PR #412 on top.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(security): add sender_kind guard in control.rs

Prevent agents from spoofing human identity by naming themselves
"human:..." to bypass release ACL checks. When sender_kind is
explicitly Agent, immediately return false regardless of name string.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(relaycast): prevent URL double-path construction

When base URL already ends with /stream (e.g. wss://rt.relaycast.dev/stream),
avoid appending /v1/stream which produced invalid double-path URLs like
wss://host/stream/v1/stream. Now correctly preserves the existing /stream path.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(snippets): correct relaycast typo in function name

Rename ensure_reaycast_mcp_config to ensure_relaycast_mcp_config
(missing 'l' in relaycast). Updated all call sites in main.rs.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(scheduler): add 32KiB coalescing body size limit

Without a body-size bound, a burst of large messages from the same
sender within the coalesce window would concatenate without limit,
potentially causing large memory allocations. Add MAX_COALESCED_BODY_SIZE
(32 KiB) check that flushes the current group when exceeded.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor(spawner): export terminate_child as pub

Make terminate_child public so it can be reused from main.rs instead
of being duplicated inline, reducing code duplication.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(security): remove leaked live API key from .mcp.json

Replace committed rk_live_... key with environment variable placeholder.
The exposed key (rk_live_b00fd0ddeca96468d72140c9c4b3a910) must be
rotated immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(compat): add agent-relay-path aliases and env fallback in utils

* fix(compat): export RelayBrokerOrchestrator alias from wrapper

* fix(utf8): use char-boundary-safe string truncation

Fix potential panics when truncating multi-byte UTF-8 strings (emoji,
CJK, accented characters) in conversation_log.rs and main.rs listen mode.

Adds floor_char_boundary helper to conversation_log.rs and applies it
to truncate(), pad_or_truncate(), and short_id(). Also fixes the same
pattern in main.rs listen-mode message display.

Addresses Devin review finding on PR #415.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Pull relay-broker directory from relay-broker-integration branch as the
foundation for the hybrid approach. Will apply bug fixes from PR #412 on top.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Prevent agents from spoofing human identity by naming themselves
"human:..." to bypass release ACL checks. When sender_kind is
explicitly Agent, immediately return false regardless of name string.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
When base URL already ends with /stream (e.g. wss://rt.relaycast.dev/stream),
avoid appending /v1/stream which produced invalid double-path URLs like
wss://host/stream/v1/stream. Now correctly preserves the existing /stream path.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Rename ensure_reaycast_mcp_config to ensure_relaycast_mcp_config
(missing 'l' in relaycast). Updated all call sites in main.rs.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Without a body-size bound, a burst of large messages from the same
sender within the coalesce window would concatenate without limit,
potentially causing large memory allocations. Add MAX_COALESCED_BODY_SIZE
(32 KiB) check that flushes the current group when exceeded.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Feb 13, 2026
Make terminate_child public so it can be reused from main.rs instead
of being duplicated inline, reducing code duplication.

Cherry-picked from PR #412.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

🤖 Agent Analysis: PR #412 Impact Assessment

Analyzed by: DeepThinker-1 + DeepThinker-2


🔴 Critical Breaking Changes

Impact Description
relay-dashboard Will break - imports @agent-relay/bridge, utils, wrapper (all deleted)
npm users Package becomes private: true, all @agent-relay/* imports fail
Protocol Wire format changes from framed binary → newline-delimited JSON
CLI Commands completely changed (up/downinit/pty/headless/listen)
API Port Dashboard :3888 → API :3889

📊 Change Summary

  • 664 files changed (+18,124 / -178,397 lines)
  • 23 packages deleted → 1 package retained (sdk-ts)
  • 12 CI workflows deleted → 1 new Rust CI
  • Version: 2.1.6 → 3.0.0

⚠️ Operational Gotchas

  1. Build trap: npm ci fails tests without --include=dev flag
  2. Test coverage gap: 3/4 SDK tests skip without RELAY_API_KEY
  3. Platform mismatch: Windows built in CI but not in install.sh
  4. Rust verification: Cannot verify without cargo toolchain

✅ Must-Run Before Merge

  • Create relay-dashboard migration PR
  • Verify relay-cloud dependencies
  • Test binary install (macOS arm64, Linux x64)
  • Test PTY injection with Claude Code
  • Verify Relaycast WebSocket connection
  • Add RELAY_API_KEY to CI for real test coverage

💡 Recommendations

  1. Do not merge until relay-dashboard PR is ready
  2. Consider beta release (3.0.0-beta.1) first
  3. Create migration guide for existing users
  4. Update docs.agent-relay.com with new API

This analysis was performed by AI agents coordinating via agent-relay protocol.

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.

3 participants