Skip to content

Make harness continuation retries idempotent - #238

Merged
actus7 merged 1 commit into
mainfrom
agent/fix-harness-maxsteps
Aug 19, 2026
Merged

Make harness continuation retries idempotent#238
actus7 merged 1 commit into
mainfrom
agent/fix-harness-maxsteps

Conversation

@actus7

@actus7 actus7 commented Aug 19, 2026

Copy link
Copy Markdown
Owner

What changed

  • makes POST /harness/agent-runs/:id/continue idempotent for terminal runs
  • replays the terminal run status through the existing SSE protocol instead of returning a conflict
  • removes the duplicate database lookup between route authorization and stream startup
  • avoids persisting duplicate terminal status events on harmless retries
  • adds regression coverage for an empty terminal continuation replay

Root cause

A continuation request can race with the worker that changes a yielded run to a terminal state. The endpoint rejected that retry instead of returning the already-known final state. A second lookup inside stream startup also left an unnecessary time-of-check/time-of-use gap.

Impact

The chat client now treats late or repeated continuation requests as successful terminal replays, so a completed, failed, or cancelled run cannot become a misleading raw continuation error in the interface.

Validation

  • pnpm test — 464 passed, 1 skipped
  • pnpm typecheck — passed
  • pnpm build — passed
  • pnpm lint — 0 errors; 1 pre-existing warning in .remember/tmp/last-ndc.ts

Copilot AI lite review requested due to automatic review settings August 19, 2026 19:07
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modelhub Ready Ready Preview Aug 19, 2026 7:07pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added backend Backend changes tests Test changes labels Aug 19, 2026
@actus7
actus7 merged commit 17e08a5 into main Aug 19, 2026
12 checks passed
@actus7
actus7 deleted the agent/fix-harness-maxsteps branch August 19, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants