Skip to content

fix: preserve real errors, add MCP call timeout, remove dead scaffolding - #19

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

fix: preserve real errors, add MCP call timeout, remove dead scaffolding#19
williamzujkowski merged 1 commit into
mainfrom
fix/harness-defects

Conversation

@williamzujkowski

Copy link
Copy Markdown
Collaborator

Fixes four harness defects from the QA/cleanup review. Full CI green locally (pnpm install --frozen-lockfile, pnpm typecheck, pnpm test, pnpm build).

#15 — Pipeline swallowed real errors (fixed)

runWorkflowPipeline collapsed every failed graph execution to the literal "Execution failed", discarding the actual cause. Now the caught error's real message is preserved on the WorkflowRunResult (transport errors, Zod schema mismatches, and timeouts each surface distinctly). A failed query_trace is now distinguishable from "trace never requested": a new RunnerReport.traceError field carries the message and the error is logged to stderr instead of being silently nulled.

#16 — No timeout/abort on MCP calls (fixed)

Added RunnerConfig.timeoutMs, enforced per MCP call via AbortController + Promise.race (new ToolCallTimeoutError). A hung server now produces an error result for the offending workflow and the run proceeds instead of hanging forever. The AbortSignal is forwarded to the caller for best-effort cancellation. Omitting timeoutMs (or <= 0) preserves the prior unbounded behavior, so existing callers are unaffected.

#17 — Broken live mode (removed)

Live integration mode never worked: run-live.ts dynamically imported a non-existent ./live-bridge.js (createMcpCaller appeared only inside that failing import), so pnpm live always exited 1. createLiveCaller/isLiveMode in live-caller.ts were dead. Verified via grep that nothing else references any of these. Removed run-live.ts, live-caller.ts, the live package script, the now-unused tsx devDependency, and the README "Live integration mode" section.

#18 — Dead run_workflow scaffolding (removed)

The run_workflow contract (schemas/types in types.ts, MOCK_RUN_WORKFLOW_* fixtures, ~17 schema tests, and the index.ts re-exports) was never called by the pipeline, which only chains list_workflows, run_graph_workflow, query_trace (matching the README and package description). Verified no caller exists. Removed all of it.

Tests

  • Removed ~17 dead run_workflow schema tests.
  • Added 8 tests: real-error preservation, Zod-mismatch surfacing, trace-error vs trace-not-requested, AbortSignal forwarding, no-signal when timeout omitted, and timeout enforcement (hung call aborts and reports).

Verification

Step Result
pnpm install --frozen-lockfile pass
pnpm typecheck pass
pnpm test pass (59 tests, 3 files)
pnpm build pass

🤖 Generated with Claude Code

…_workflow code

Addresses four harness defects found in QA/cleanup review.

#15 — Pipeline no longer collapses every failure to the literal
"Execution failed". The caught error's real message (transport error,
Zod schema mismatch, timeout) is now carried onto the WorkflowRunResult.
A failed query_trace is distinguished from "trace not requested" via a
new RunnerReport.traceError field and a stderr log, instead of silently
nulling.

#16 — Added a configurable RunnerConfig.timeoutMs enforced per MCP call
via AbortController + Promise.race (ToolCallTimeoutError). A hung server
now yields an error result for the offending workflow and the run
proceeds instead of hanging forever. The signal is forwarded to the
caller for best-effort cancellation; omitting timeoutMs preserves the
prior unbounded behavior.

#17 — Removed the live-integration mode that never worked: run-live.ts
imported a non-existent ./live-bridge.js (createMcpCaller existed only
in that failing import), createLiveCaller was a dead export, and the
`live` script always exited 1. Verified via grep that nothing else
references run-live.ts, live-caller.ts, createLiveCaller, isLiveMode,
createMcpCaller, or live-bridge. Removed both files, the `live` script,
the now-unused tsx devDependency, and the README section.

#18 — Removed the run_workflow contract scaffolding (RunWorkflow* schemas
/types in types.ts, MOCK_RUN_WORKFLOW_* fixtures, the ~17 schema tests,
and the index.ts re-exports). Verified run_workflow / RunWorkflow* are
never referenced by runner-pipeline.ts — the pipeline only chains
list_workflows, run_graph_workflow, query_trace, matching the README and
package description.

Tests: removed ~17 dead run_workflow schema tests; added 8 tests covering
error-message preservation, Zod-mismatch surfacing, trace-error vs
not-requested, AbortSignal forwarding, and timeout enforcement.

Fixes #15
Fixes #16
Fixes #17
Fixes #18

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