Skip to content

fix(sub-harness): harden session turns - #71

Open
LukasParke wants to merge 1 commit into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-sub-harness-reliability
Open

fix(sub-harness): harden session turns#71
LukasParke wants to merge 1 commit into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-sub-harness-reliability

Conversation

@LukasParke

Copy link
Copy Markdown
Collaborator

What

  • treat agent-reported error turns as failed steps while retaining transcript and usage evidence
  • cancel sub-harness turns after a configurable idle period (120s default, 0 disables)
  • retain streamed reasoning as reasoning items
  • deduplicate concurrent session startup with promise-valued reuse entries
  • evict and destroy reused sessions after thrown or agent-reported turn failures

Why

External coding-agent sessions can wedge, report a failed turn as a normal result, lose reasoning from the conversation record, or race duplicate starts on the same reuse key. Those failure modes make orchestration unreliable and can leak stale vendor sessions.

This semantically ports fork/port/openrouter-fixes commit 0fd1b9ef onto current main after #68. It preserves the current sub-harness package boundary: core imports only the contract from @noetic-tools/types.

Test plan

  • core sub-harness tests — 21 pass
  • core, types, sub-harness, and all adapter package typechecks
  • sub-harness and adapter package tests
  • bun test — 2,060 pass, 6 integration/benchmark skips
  • bun run lint
  • bun run check:exports
  • sentrux check .
  • sentrux gate .
  • separate clean-context Pi reviews; confirmed failure eviction fixes, no remaining findings

Behavior changes

  • finishReason: 'error' now raises step_failed after recording returned items and usage.
  • Failed reused sessions are destroyed rather than retried in place.
  • settings.extra.idleTimeoutMs configures the turn watchdog; non-positive values disable it.

Port fork/port/openrouter-fixes commit 0fd1b9e onto current main, including failed-turn handling, idle cancellation, reasoning retention, and deduplicated session startup.

Signed-off-by: Luke Parke <5702154+LukasParke@users.noreply.github.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

@LukasParke is attempting to deploy a commit to the Matt Apperson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@LukasParke

Copy link
Copy Markdown
Collaborator Author

Agent: The code CI, DCO, and structural gate passed. Remaining red checks are external configuration: compat received an empty OPENROUTER_API_KEY, and Vercel requires upstream deployment authorization. I cannot remediate or rerun those checks without upstream repository access/secrets.

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