feat: add workflow for relay bootstrap and messaging fixes#708
feat: add workflow for relay bootstrap and messaging fixes#708khaliqgant merged 19 commits intomainfrom
Conversation
6fbd71d to
c01fab8
Compare
| type: 'deterministic', | ||
| dependsOn: ['smoke-test-local-launcher'], | ||
| command: ` | ||
| set -e |
There was a problem hiding this comment.
🟡 set -e causes orphaned broker process when integration test commands fail
In the integration-test-sage step, set -e (line 164) causes the shell to exit immediately on the first failing command. A broker process is backgrounded on line 167 (agent-relay up ... &), but if any of the subsequent commands (status, spawn, who, send, etc. on lines 170-176) fail, the cleanup commands on lines 177-179 (release, down, wait $BROKER_PID) are never reached, leaving the broker process orphaned. A trap should be added to ensure cleanup runs on exit.
Suggested fix pattern
Replace set -e with a trap that ensures cleanup:
cleanup() {
env PATH="$HOME/.local/bin:$PATH" agent-relay release WorkflowProbe || true
env PATH="$HOME/.local/bin:$PATH" agent-relay down --force --timeout 5000 || true
[ -n "$BROKER_PID" ] && wait $BROKER_PID || true
}
trap cleanup EXITWas this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Resolved — the workflows/relay-fix-workflow.ts file was removed from the repo in commit d283ddd. The orphaned broker concern no longer applies.
|
Ran the workflow locally against a clean PR checkout and fixed the workflow so it can actually execute from a clean state:\n\n- uses a deterministic plan doc instead of depending on a flaky Claude planning step\n- builds before so clean-checkout validation no longer fails\n- reran and validated the corrected build sequence locally (
✓ broker binary (agent-relay-broker) built and copied to packages/sdk/bin/ Tasks: 13 successful, 13 total |
| .agent('lead', { | ||
| cli: 'claude', | ||
| preset: 'lead', | ||
| role: 'Relay fix lead coordinating diagnosis and acceptance checks', | ||
| model: ClaudeModels.SONNET, | ||
| retries: 2, | ||
| }) |
There was a problem hiding this comment.
🟡 lead agent is defined but never referenced by any step
The lead agent is configured at lines 11-17 with ClaudeModels.SONNET, but no step in the workflow uses agent: 'lead'. The three agent-based steps use impl-a (line 69), impl-b (line 94), and reviewer (line 216). This suggests either the lead agent definition is dead code, or a step that should use the lead agent is missing (e.g., a planning/coordination step that was intended to consume the plan document).
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Resolved — the workflows/relay-fix-workflow.ts file was removed from the repo in commit d283ddd. The unused lead agent definition is no longer present.
- align packages/config devDependency typescript to 5.7.3 (matches pinned build script) - fix packages/sdk build:full and check scripts to use npx tsc (consistent with build) - remove workflow files (relay-fix-workflow.ts, relay-fix-long-term-sdk-build.ts, PLAN-*.md) from repo
d3ab5d1 to
d283ddd
Compare
Missed by the workflow (build:esm sub-script not caught in diagnosis). Aligns utils with the rest of the packages.
Instead of each package independently pinning typescript@5.7.3 via npx, use a single exact version at root (5.9.3) and let all packages resolve tsc via npx from node_modules/.bin. This means one version to update, zero hardcoded version strings in build scripts.
npx tsc resolves a package named 'tsc' on npm (v2.0.4, wrong package). Plain 'tsc' in an npm script resolves from node_modules/.bin/tsc, which is the root-hoisted typescript compiler.
Package-local npm install does not install typescript (now root-only). Install at root so the workspace hoists tsc to node_modules/.bin, then invoke via npm run -w which resolves from the workspace root.
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>
Summary
sagerepoWhy
We surfaced several concrete issues while testing local headless orchestration:
agent-relaysendsender identity andhistoryrequiringRELAY_API_KEY)This workflow gives the team a structured way to fix and verify those issues end-to-end.