Skip to content

fix updated broker key needed#72

Merged
khaliqgant merged 1 commit intomainfrom
fix-updated-broker
Apr 7, 2026
Merged

fix updated broker key needed#72
khaliqgant merged 1 commit intomainfrom
fix-updated-broker

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Apr 7, 2026

@khaliqgant khaliqgant merged commit 504b70e into main Apr 7, 2026
1 check passed
@khaliqgant khaliqgant deleted the fix-updated-broker branch April 7, 2026 08:06
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 found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 Broker API key not passed to the hybrid WebSocket connection to the broker

The PR adds brokerApiKey authentication to all HTTP requests to the broker (send, spawned, proxy routes), but the handleHybridWebSocket function in packages/dashboard-server/src/websocket/standalone.ts:144 creates a new WebSocket(brokerWsUrl) connection to the broker without including the x-api-key header. When RELAY_BROKER_API_KEY is configured, the broker presumably requires it on all endpoints. The WebSocket connection will fail to authenticate, triggering the fallback to snapshot polling and losing real-time broker event streaming.

Affected call site and WebSocket creation

The call at packages/dashboard-server/src/proxy-server.ts:521 passes only (ws, getRelaycastSnapshot, relayUrl, verbose)brokerApiKey is never provided. Inside handleHybridWebSocket at packages/dashboard-server/src/websocket/standalone.ts:144, the WebSocket is created with no headers:

const bws = new WebSocket(brokerWsUrl);

The Node.js ws library supports passing headers via new WebSocket(url, { headers: { 'x-api-key': key } }), so this should be straightforward to fix.

(Refers to line 521)

Prompt for agents
The handleHybridWebSocket function in packages/dashboard-server/src/websocket/standalone.ts needs to accept an optional brokerApiKey parameter and pass it as an x-api-key header when creating the broker WebSocket connection at line 144. The call site in packages/dashboard-server/src/proxy-server.ts:521 needs to pass the brokerApiKey value.

1. Update handleHybridWebSocket signature to add brokerApiKey?: string parameter
2. At line 144 in standalone.ts, change: const bws = new WebSocket(brokerWsUrl); to: const bws = new WebSocket(brokerWsUrl, brokerApiKey ? { headers: { 'x-api-key': brokerApiKey } } : undefined);
3. Update the call at proxy-server.ts:521 to pass brokerApiKey: handleHybridWebSocket(ws, getRelaycastSnapshot, relayUrl, verbose, brokerApiKey)
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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