Skip to content

feat: unified workspace ID across relay services#664

Merged
khaliqgant merged 4 commits into
mainfrom
unified-workspace-id
Mar 31, 2026
Merged

feat: unified workspace ID across relay services#664
khaliqgant merged 4 commits into
mainfrom
unified-workspace-id

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Mar 28, 2026

Summary

  • AgentRelay SDK accepts workspaceId option to link relaycast, relayfile, and relayauth to the same rw_ workspace ID
  • Workspace registry persists mappings in .relay/workspaces.json
  • Enables agent-relay on --workspace rw_xxx for joining existing workspaces across machines

Changes

  • packages/sdk/src/relay.ts — workspaceId option, workspace registry, mapping persistence
  • scripts/postinstall.js — updated for workspace support

How it works

# Machine A:
agent-relay on codex
  Workspace: rw_a7f3x9k2
  Join: agent-relay on <cli> --workspace rw_a7f3x9k2

# Machine B:
agent-relay on claude --workspace rw_a7f3x9k2
  Workspace: rw_a7f3x9k2 (joined)

One rw_ ID used by relaycast (messaging), relayfile (files), and relayauth (auth).

Test plan

  • SDK accepts workspaceId and propagates to spawned agents
  • Workspace registry persists and reads from .relay/workspaces.json
  • Join by workspace ID connects to existing relaycast channel

🤖 Generated with Claude Code


Open with Devin

- AgentRelay accepts workspaceId option to link relaycast, relayfile,
  and relayauth to the same rw_ workspace ID
- Workspace registry persists mappings in .relay/workspaces.json
- persistWorkspaceMapping stores relaycast API key + relayfile URL
  per workspace ID
- Enables: agent-relay on --workspace rw_xxx (join existing workspace)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread scripts/postinstall.js Fixed
devin-ai-integration[bot]

This comment was marked as resolved.

- Take main's safety improvements: try/catch on persistWorkspaceMapping,
  mode 0o600 on registry file write
- Fix verifyChecksum to follow HTTP redirects (GitHub release URLs 302)
- Clean up duplicate try-catch nesting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread scripts/postinstall.js
const checksumContent = await new Promise((resolve, reject) => {
const fetchWithRedirects = (url, remaining = 5) => {
const chunks = [];
const request = https.get(url, res => {

Check warning

Code scanning / CodeQL

File data in outbound network request Medium

Outbound network request depends on
file data
.
devin-ai-integration[bot]

This comment was marked as resolved.

Keep deprecation warning for workspaceName without workspaceId from main.
Fix Devin review: resolve relative redirect URLs in verifyChecksum's
fetchWithRedirects to match downloadBinary behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…etch

Add res.resume() before rejecting on the too-many-redirects path in
verifyChecksum's fetchWithRedirects to prevent TCP socket leaks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit bb4b5ce into main Mar 31, 2026
33 checks passed
@khaliqgant khaliqgant deleted the unified-workspace-id branch March 31, 2026 10:49
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.

2 participants