SIGN IN SIGN UP

fix(harness-claude-code): graceful interrupt, query disposal, quieter aborts (#19099)

## Background

Aborting a turn hard-kills the CLI process, so the in-flight turn never
reaches the session transcript. Turns that end through interrupt or
error paths can leak orphaned `claude` processes. A caller's own abort
is also logged to stderr as a bridge error.

## Summary

- Prefer the SDK's `interrupt()` on host abort (same as pressing Esc),
with a hard abort as a 5s fallback. The interrupted turn stays
resumable, including via `claude --resume`.
- Dispose the query when a turn ends, so the CLI subprocess doesn't
outlive it.
- Settle caller-initiated aborts as aborts without logging them as
errors, in both the bridge and the host.

## End-to-End Verification

Ran against the real `claude` CLI: an aborted turn settles with an
`abort` part and no `error` part, nothing is logged to stderr, and no
`claude` processes remain after `destroy()`.

## Checklist

- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

---------

Co-authored-by: Felix Arntz <felix.arntz@vercel.com>
G
George committed
cc9f6ce4dd7a4c6f45e7f2b398b8ada9de5e72cf
Parent: 6669d69
Committed by GitHub <noreply@github.com> on 8/28/2026, 3:41:00 AM