fix: local agent-relay bootstrap and messaging (rescue of PR #708 workflow)#720
Open
fix: local agent-relay bootstrap and messaging (rescue of PR #708 workflow)#720
Conversation
Implements the fixes that PR #708's workflow was meant to produce but failed to execute (trajectory traj_1775820542976_5e67a482 aborted at plan-fixes with "agent already exists", skipping all 7 downstream steps). - install.sh: harden broker/dashboard binary verification with shared verify_downloaded_executable helper and failure-reason tracking - src/cli/commands/messaging.ts: add broker history path so `history` works without RELAY_API_KEY; resolve sender via AGENT_RELAY_SENDER; fall back to workspace key from broker session - src/listen_api.rs + main.rs: add /api/history/messages endpoint and ListenApiRequest::History variant backing the CLI path - packages/sdk/src/client.ts: expose getMessageHistory on the SDK client - tests updated to cover the new paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/history/messagesendpoint soagent-relay historyworks in local mode withoutRELAY_API_KEYinstall.shbinary verification and sender-identity resolution foragent-relay sendWhy
PR #708 (merged) added a 9-step workflow to diagnose and fix local agent-relay bootstrap/messaging issues (broken launcher shim, installer gaps,
historyrequiringRELAY_API_KEY,sendsender identity). The workflow was then executed on 2026-04-10 and immediately failed at theplan-fixesstep withagent 'plan-fixes-cbe6ef80' already exists, causing all 7 downstream fix/verify steps to be skipped. The trajectory (.trajectories/completed/traj_1775820542976_5e67a482.json, also committed here) captures this.The fixes were done by hand afterward but left uncommitted on a local branch for a day. This PR rescues that work.
Changes
install.sh— sharedverify_downloaded_executablehelper with failure-reason tracking for broker + dashboard binariessrc/cli/commands/messaging.ts— broker history path,AGENT_RELAY_SENDERenv resolution, workspace-key fallback from broker session whenRELAY_API_KEYis unsetsrc/listen_api.rs+src/main.rs— new/api/history/messagesroute andListenApiRequest::Historyvariantpackages/sdk/src/client.ts—getMessageHistoryon the SDK clientsrc/cli/commands/messaging.test.tsandsrc/install-script.test.tsupdated.trajectories/must be trackedTest plan
bun test src/cli/commands/messaging.test.tsbun test src/install-script.test.tscargo test -p agent-relay-broker(listen_api history route)agent-relay historyin a local-mode workspace with noRELAY_API_KEYsetagent-relay sendrespectsAGENT_RELAY_SENDERinstall.shrun on macOS verifies broker + dashboard binaries🤖 Generated with Claude Code