Skip to content

feat(plugin): add trusted Relay rooms and Relayfile access#3

Open
khaliqgant wants to merge 5 commits into
masterfrom
feat/relay-cloud-rooms-master
Open

feat(plugin): add trusted Relay rooms and Relayfile access#3
khaliqgant wants to merge 5 commits into
masterfrom
feat/relay-cloud-rooms-master

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • land the trusted Relay Room and Relayfile plugin work on the actual default branch
  • preserve the reviewed scoped-participant compatibility path for Agent Relay SDK 11.1
  • keep the generic relay_room_inv_ wire contract shared by Cloud, Relay, and Herdr

Why this PR exists

Herdr #2 was merged into its already-landed feature base (feat/agent-relay-sdk) rather than master, so its changes are not present on the default branch. This PR replays the same five reviewed commits directly onto current master; it adds no new product behavior.

Validation

  • npm ci --omit=dev
  • npm test — 34/34 passing
  • Cloud #2833 production migration, deploy, and post-deploy verifier passed
  • live Room participant identity, presence, channel write/read, cleanup, and revoked-token rejection passed

Summary by cubic

Add a trusted Relay Room to the Agent Relay plugin with a new pane for managing rooms, messaging, presence, and Relayfile-backed write access. Keeps the existing bridge unchanged while adding secure invite handling and public workspace binding.

  • New Features

    • New “Relay Room” pane for channel history, sending messages and threads, reactions, presence, members, and Relayfile writeback.
    • Supports generic relay_room_inv_… invites and binds via public rw_… or UUID workspace IDs; separate room.config.example.json config.
    • Secure CLI runner with secret redaction and bounded I/O; @agent-relay/sdk wrapper and event deduper.
  • Bug Fixes

    • Hardened Relayfile mount replacement detection and recovery of mounted workspaces on restart.
    • Validates room state and keeps the scoped-participant path compatible with Agent Relay SDK 11.1.

Written for commit 0187aff. Summary will update on new commits.

Review in cubic

@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Relay Room is added as a plugin pane with dedicated configuration, documented invitation and command flows, private state rules, Relayfile integration behavior, and extensive tests covering routing, sessions, mounts, credentials, and safety.

Changes

Relay Room

Layer / File(s) Summary
Plugin surface and documented behavior
plugins/agent-relay/README.md, plugins/agent-relay/herdr-plugin.toml, plugins/agent-relay/room.config.example.json
Adds the Relay Room pane and example configuration, and documents setup, commands, invitation binding, state, and safety behavior.
Room test foundation and SDK contracts
plugins/agent-relay/test/room.test.mjs
Adds isolated test utilities, CLI and SDK mocks, room construction, configuration validation, credential handling, and SDK compatibility coverage.
Room routing and session lifecycle
plugins/agent-relay/test/room.test.mjs
Tests command routing, event deduplication, device persistence, revocation cleanup, invite-token handling, and workspace binding.
Relayfile integration and safety validation
plugins/agent-relay/test/room.test.mjs
Tests Relayfile commands, mount lifecycle and race protection, environment filtering, redaction, parsing, and discovery guidance.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Poem

I’m a rabbit hopping through the Room,
With tabs that bloom and tests that zoom.
Tokens hide, mounts stay tight,
Messages route both day and night.
Relayfile rests safe and sound—
A carrot-sized release is found!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: adding trusted Relay rooms and Relayfile access.
Description check ✅ Passed The description is directly related and accurately summarizes the Relay Room and Relayfile work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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/relay-cloud-rooms-master

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
plugins/agent-relay/test/room.test.mjs (1)

229-248: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Missing test coverage for apiUrl schema/forwarding rules.

Workspace-binding validation is well covered here, but README documents apiUrl HTTPS/loopback constraints and a hard boundary ("never forwards an API URL to Relayfile"). No test in this file exercises RoomConfigSchema accepting/rejecting apiUrl, or verifies --api-url is forwarded to agent-relay commands but withheld from relayfile calls (e.g. in the "uses Relayfile live catalog..." or "setup reuses Agent Relay Cloud login..." tests at lines 745-821, which construct executions without asserting apiUrl isolation).

🤖 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 `@plugins/agent-relay/test/room.test.mjs` around lines 229 - 248, The tests
need coverage for apiUrl validation and forwarding isolation. Extend
RoomConfigSchema tests near the existing workspaceId assertions to accept
HTTPS/allowed loopback URLs and reject disallowed protocols or hosts, then
update the relevant agent-relay execution tests (such as the live catalog or
Cloud login cases) to verify --api-url reaches agent-relay commands but is
omitted from relayfile invocations.
🤖 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.

Nitpick comments:
In `@plugins/agent-relay/test/room.test.mjs`:
- Around line 229-248: The tests need coverage for apiUrl validation and
forwarding isolation. Extend RoomConfigSchema tests near the existing
workspaceId assertions to accept HTTPS/allowed loopback URLs and reject
disallowed protocols or hosts, then update the relevant agent-relay execution
tests (such as the live catalog or Cloud login cases) to verify --api-url
reaches agent-relay commands but is omitted from relayfile invocations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0be08762-4cdf-4c46-848d-b76cb63714ca

📥 Commits

Reviewing files that changed from the base of the PR and between fbf2e4c and 0187aff.

⛔ Files ignored due to path filters (9)
  • plugins/agent-relay/dist/command-runner.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/config.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/room-cli.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/room-client.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/room-commands.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/room-events.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/room-sdk.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/room.mjs is excluded by !**/dist/**
  • plugins/agent-relay/dist/state.mjs is excluded by !**/dist/**
📒 Files selected for processing (4)
  • plugins/agent-relay/README.md
  • plugins/agent-relay/herdr-plugin.toml
  • plugins/agent-relay/room.config.example.json
  • plugins/agent-relay/test/room.test.mjs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0187aff069

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +138 to +140
const owned =
existingMount?.checkoutPath === checkoutPath &&
existingMount?.mountPath === mountPath;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Verify persisted mount ownership beyond path equality

When a previously stopped mount remains in state, deleting and recreating .integrations with unrelated files still makes owned true because only the two path strings are compared. A later integration setup therefore bypasses the non-empty-directory guard and lets Relayfile mount over a directory the plugin never created, risking hidden or modified user data. Persist and compare the directory identity, or reject non-empty directories after the original directory is replaced.

Useful? React with 👍 / 👎.

Comment on lines +54 to +55
} else if (character === '\\') {
escaped = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve literal backslashes inside quoted chat text

For quoted message text containing a literal backslash, such as message send #general "Use C:\temp", this branch consumes the backslash and silently sends Use C:temp. The same corruption affects threads, DMs, regexes, and code snippets; quoted text should preserve backslashes unless they escape the active quote or another backslash.

Useful? React with 👍 / 👎.

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