Skip to content

fix: record tryFinalAcceptance exceptions like _step failures - #45

Open
Flame119052 wants to merge 1 commit into
tscircuit:mainfrom
Flame119052:cursor/final-acceptance-error-73fd
Open

fix: record tryFinalAcceptance exceptions like _step failures#45
Flame119052 wants to merge 1 commit into
tscircuit:mainfrom
Flame119052:cursor/final-acceptance-error-73fd

Conversation

@Flame119052

Copy link
Copy Markdown

Summary

tryFinalAcceptance() runs outside the _step() try/catch. A thrown error escaped step() without setting failed or error, so a later step() retried the hook and incremented iterations past MAX_ITERATIONS.

tryFinalAcceptance now uses the same catch-and-record policy as _step(). Successful acceptance and normal exhaustion are unchanged.

Fixes #44

Test

tests/BaseSolver.test.ts covers a throwing acceptance hook (no retry) and a hook that still accepts a passable solution.

Exceptions from the final-acceptance hook escaped step() without
setting failed/error, so a later step() retried the hook and counted
past MAX_ITERATIONS.
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

@Flame119052 is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

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.

Exceptions from tryFinalAcceptance leave the solver active and unrecorded

1 participant