Conversation
|
Bug report from the latest full integration rerun: The original Root cause:
Observed failure pattern:
Representative failing suites after the rerun:
There are also a couple of likely real behavior mismatches behind the infrastructure noise:
Repro: RELAY_INTEGRATION_CLI_LIFECYCLE=1 node --test tests/integration/broker/dist/*.test.jsRecommended follow-up:
|
Use fs.realpathSync to resolve symlinks when checking if index.ts is the entrypoint. Without this, npm global installs create a symlink that causes path.resolve(argv[1]) to differ from import.meta.url, silently skipping runCli(). Falls back to path.resolve on error (e.g., non-existent paths).
The release method was dropping the reason parameter. Now sends it as JSON body in the DELETE request when provided.
Reorder dedup key resolution: spawn_token → event_id → agent_name. Previously agent_name was checked before event_id, causing the dedup key to use the agent name even when a unique event_id was available. Also fix test data: falls_back_to_agent_name test should not include event_id (it tests the fallback path when no event_id is present).
The waitForExit helper used Promise.race with setTimeout but never cleared the timer when the exit promise won. This leaked timers that could delay Node.js process exit.
- Added reason field to ListenApiRequest::Release enum
- Parse optional { reason } JSON body from DELETE request
- Log release reason in handler when provided
When AGENT_RELAY_WORKFLOW_DISABLE_RELAYCAST=1 is set, the broker was still receiving --channels which triggered Relaycast registration. Now: - Skip --channels arg when channel list is empty (client.ts) - Pass empty channels to broker when Relaycast is disabled (runner.ts) - Validate config in execute() to catch DAG cycles before run starts - Initialize abortController early so abort() works during setup - Mark pending/running steps as failed on cancellation - Fix continue strategy: treat failed steps as done for run completion - Fix verification test: avoid anti-injection false positive All 28 tests across workflow-dag, workflow-lifecycle, workflow-runner, workflow-verification, and workflow-patterns now pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Fixed in 79b1616. Here's what was wrong and what changed: Root cause: When Fixes applied (all in one commit on
All 28 tests across workflow-dag, workflow-lifecycle, workflow-runner, workflow-verification, and workflow-patterns pass. |
* fix up command
* test fixes and updates for lifecycle
* style: auto-format Rust code with cargo fmt
* fix: resolve symlinks in CLI entrypoint guard
Use fs.realpathSync to resolve symlinks when checking if index.ts is the
entrypoint. Without this, npm global installs create a symlink that
causes path.resolve(argv[1]) to differ from import.meta.url, silently
skipping runCli().
Falls back to path.resolve on error (e.g., non-existent paths).
* fix: forward release reason in HTTP agent management client
The release method was dropping the reason parameter. Now sends it
as JSON body in the DELETE request when provided.
* fix: dedup key priority — event_id before agent name for spawn requests
Reorder dedup key resolution: spawn_token → event_id → agent_name.
Previously agent_name was checked before event_id, causing the dedup
key to use the agent name even when a unique event_id was available.
Also fix test data: falls_back_to_agent_name test should not include
event_id (it tests the fallback path when no event_id is present).
* update wording
* fix: clear timeout timers in SDK client shutdown
The waitForExit helper used Promise.race with setTimeout but never
cleared the timer when the exit promise won. This leaked timers that
could delay Node.js process exit.
* fix: thread release reason through Rust HTTP API handler
- Added reason field to ListenApiRequest::Release enum
- Parse optional { reason } JSON body from DELETE request
- Log release reason in handler when provided
* style: auto-format Rust code with cargo fmt
* fix: workflow local mode — don't connect to Relaycast when disabled
When AGENT_RELAY_WORKFLOW_DISABLE_RELAYCAST=1 is set, the broker was
still receiving --channels which triggered Relaycast registration. Now:
- Skip --channels arg when channel list is empty (client.ts)
- Pass empty channels to broker when Relaycast is disabled (runner.ts)
- Validate config in execute() to catch DAG cycles before run starts
- Initialize abortController early so abort() works during setup
- Mark pending/running steps as failed on cancellation
- Fix continue strategy: treat failed steps as done for run completion
- Fix verification test: avoid anti-injection false positive
All 28 tests across workflow-dag, workflow-lifecycle, workflow-runner,
workflow-verification, and workflow-patterns now pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Collection of CLI and broker fixes addressing entrypoint symlink resolution, agent management improvements, and deduplication correctness.
Changes
CLI Entrypoint
fs.realpathSyncto resolve symlinks before comparing paths, withpath.resolvefallback (src/cli/index.ts)cliScriptfallback frombootstrap.jstoindex.jsto match the single-entrypoint model (src/cli/commands/core.ts)package.jsonbin mapping (src/cli/entrypoint.test.ts)Agent Management
{ reason }in DELETE body (src/cli/commands/agent-management.ts)src/cli/lib/broker-lifecycle.ts)Broker (Rust)
event_idbefore falling back to agent name, preventing false-positive deduplication when multiple spawns share a name (src/main.rs)cargo fmtCI/CD
ci-standalone-smoke.shscript for standalone binary validationSDK
Known limitation
The release reason is now sent from the TS HTTP client, but the Rust
listen_api.rsDELETE handler does not yet parse the request body — so the reason is silently dropped for HTTP-based releases. The WebSocket-based release path (release_agentinmain.rs) correctly handles the reason field. A follow-up PR should add body parsing to the Rust HTTP endpoint.Commits
d1c770e7fix up commandca63089etest fixes and updates for lifecycle4fde8ed5style: auto-format Rust code with cargo fmt738cb7c7fix: resolve symlinks in CLI entrypoint guard89ca732afix: forward release reason in HTTP agent management client2d2bf7f4fix: dedup key priority — event_id before agent name for spawn requestsBreaking changes
None.
Testing done
--versionand--helpwork correctlyln -sf ... && node /tmp/test-relay-symlink --version)whocommand works against running brokerrelease --helpconfirms command structure🤖 Generated with Claude Code