Skip to content

fix(harness): count a crash before the request as a failed attempt - #149

Merged
sanchitrk merged 1 commit into
canaryfrom
fix/durable-attempt-budget
Nov 10, 2026
Merged

sanchitrk merged 1 commit into
canaryfrom
fix/durable-attempt-budget

Conversation

@sanchitrk

@sanchitrk sanchitrk commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After #147, a crash with attempt set and no draft open, before llm.started or asleep in retry backoff, charged neither counter. The restart is uncounted by design (the run was not being worked on), and the resume treated attempt 1 as fresh. A host that kept dying at that point, for example in a request hook or provider setup, was restarted forever.

Fix

The resume counts that attempt as failed, streaming or not, so the retry budget bounds it. A shutdown still resends the same attempt uncharged. One branch in Loop.run; the restart rule is unchanged.

Found by a codex review of #147. The review's other findings are gaps against the reference where nothing is lost and a fix needs a new column or new plumbing; they are recorded in the design notes and left.

Tests

recovery.backoff regenerated: each attempt number moves by one, and the message for a crash with no draft reads "The host stopped before attempt N was sent". Recovery 15/15; harness loop, thread and control suites 86/86; vp check and vp run typecheck clean.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A crash with the attempt set and no draft open, before `llm.started` or
asleep in retry backoff, charged neither counter: the restart is uncounted by
design, and the resume treated attempt 1 as fresh. A host that kept dying
there looped forever. The resume now counts that attempt as failed, so the
retry budget bounds it. A shutdown still resends the same attempt uncharged.

Found by a codex review of the previous change. `recovery.backoff` regenerated:
each attempt number moves by one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit 1f4b876 into canary Nov 10, 2026
1 check passed
@sanchitrk
sanchitrk deleted the fix/durable-attempt-budget branch November 10, 2026 04:30
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