Skip to content

fix: bound remote tool calls with timeout; remove dead live mode (#19) - #20

Merged
williamzujkowski merged 1 commit into
mainfrom
fix/harness-defects
Jun 16, 2026
Merged

fix: bound remote tool calls with timeout; remove dead live mode (#19)#20
williamzujkowski merged 1 commit into
mainfrom
fix/harness-defects

Conversation

@williamzujkowski

Copy link
Copy Markdown
Collaborator

Fixes #19. Addresses the two confirmed harness defects (B and C). Defects A (error-swallowing) and D (dead-scaffolding) were verified NOT present and left untouched.

(B) No timeout / abort on remote MCP calls

ToolCaller.call was awaited unbounded by fetchStats and runQuery, so a hung nexus-agents server made the benchmark hang forever — including runQuery, which measures durationMs around the call.

  • Adds DEFAULT_TIMEOUT_MS (30s), ToolCallTimeoutError, and a withTimeout(caller, timeoutMs?) wrapper in src/benchmark.ts. It combines an AbortController with a timer so the returned promise always settles, and aborts args.signal on timeout.
  • runBenchmark now routes both fetchStats and runQuery through a boundedCaller, bounding every remote call in the benchmark path.
  • Adds optional BenchmarkConfig.timeoutMs (defaults to DEFAULT_TIMEOUT_MS). Helper signatures unchanged, so existing tests keep passing.

(C) Broken "live mode" (verified-dead removal)

src/run-live.ts imported a non-existent ./live-bridge.js and always process.exit(1); createLiveCaller in src/live-caller.ts was referenced nowhere (not re-exported from src/index.ts).

  • Removed src/run-live.ts and src/live-caller.ts.
  • Removed the "live" script from package.json (fixed trailing comma) and dropped the now-unused tsx direct devDependency; lockfile regenerated.
  • Removed the live-mode section from README.md.

Tests

Appended a withTimeout suite to src/benchmark.test.ts:

  • rejects with ToolCallTimeoutError when the underlying call hangs (10ms timeout)
  • passes through a fast result
  • propagates an underlying thrown error
  • aborts the signal on timeout (args.signal.aborted === true)

CI (all green locally)

  • pnpm install --frozen-lockfile
  • pnpm typecheck
  • pnpm test ✅ (49 tests, 24 in benchmark)
  • pnpm build

🤖 Generated with Claude Code

(B) No timeout / abort on remote MCP calls:
Add ToolCallTimeoutError, DEFAULT_TIMEOUT_MS (30s) and a withTimeout()
wrapper in src/benchmark.ts. The wrapper uses an AbortController plus a
timer so the returned promise always settles even if the underlying call
hangs forever, and aborts args.signal on timeout. runBenchmark now routes
both fetchStats and runQuery through a boundedCaller, so a hung
nexus-agents server can no longer make the benchmark hang. Adds an
optional BenchmarkConfig.timeoutMs (defaults to DEFAULT_TIMEOUT_MS).

(C) Broken "live mode" (verified-dead removal):
src/run-live.ts imported a non-existent './live-bridge.js' and always
exited 1; createLiveCaller in src/live-caller.ts was referenced nowhere
(not re-exported from src/index.ts). Remove both files, the "live"
package.json script, and the README live-mode section. tsx is no longer
a direct devDependency.

Tests: append withTimeout coverage to src/benchmark.test.ts — timeout
rejection, fast pass-through, underlying-error propagation, and
signal-abort-on-timeout.

Fixes #19

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@williamzujkowski
williamzujkowski merged commit 32c5b63 into main Jun 16, 2026
6 checks passed
@williamzujkowski
williamzujkowski deleted the fix/harness-defects branch June 16, 2026 03:45
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.

[QA] harness defects: no-timeout / broken-live-mode

1 participant