Skip to content

v0.7.1 — fix Node runner EPIPE crash when agent exits early

Choose a tag to compare

@jeffkit jeffkit released this 13 Jul 12:09
· 91 commits to main since this release

fix(sdk/node): swallow EPIPE on agent stdin write when agent exits early

Patch over 0.7.0. Recommended install: upgrade to 0.7.1.

The bug

The Node runner writes the turn object to the agent's stdin on every run. If the agent exits (or closes its stdin) before the write lands — e.g. a one-shot CLI that reads nothing from stdin — the write fails with EPIPE, which Node emits asynchronously as an 'error' event on the stdin stream. With no listener attached, that became an uncaughtException and crashed the bridge.

The crash was timing-sensitive and surfaced on Node 22 in CI (conformance and test-node (22) jobs). Node 20/24 and the Python runner (which already wrapped the write in try/except (BrokenPipeError, ...)) were unaffected — which is why 0.7.0 shipped green on its own publish pipeline but the main-branch Tests workflow caught it on the Node 22 matrix entry.

The fix

sdk/node/src/runner.js attaches an 'error' listener to child.stdin after spawn that swallows EPIPE (an early-exit agent is a legitimate condition; the run result is derived from stdout / exit code) and re-throws any other stream error. The existing synchronous try/catch around stdin.write stays.

Versioning

  • Wire protocol: 0.3 (unchanged)
  • Spec document revision: 1.0 (unchanged)
  • SDK packages: 0.7.0 → 0.7.1 (Python + Node, patch)
  • Python code is unchanged; it is re-versioned to 0.7.1 to keep the dual-SDK version track in sync.

Full changelog: https://github.com/jeffkit/agentproc/blob/main/CHANGELOG.md