fix: one failed LLM call no longer aborts the whole run - #61
Open
UditAkhourii wants to merge 1 commit into
Open
UditAkhourii wants to merge 1 commit into
UditAkhourii wants to merge 1 commit into
Conversation
run() used Promise.all for the divergence fan-out and the deepen pass, so a single branch's callLLM throwing (rate limit, timeout, an unrecoverable response) rejected the entire run and discarded every other branch's completed work. - Swap Promise.all for Promise.allSettled in both the divergence fan-out and the deepen pass. - Add RunResult.failedFrames so callers/CLI can see which frames/ideas failed and why, instead of a silent gap or a hard crash. - Emit a "frame:failed" RunEvent so cli.ts's progress printer and render.ts's text output can surface partial failures. - A run only hard-fails now if every divergence branch fails. Closes #44 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run()usedPromise.allfor both the divergence fan-out (frames.map(...)) and the deepen pass (toDeepen.map(...)). If a single branch'scallLLMthrew (rate limit, timeout, an unrecoverable malformed response), the whole run rejected and every other already-completed branch's work was discarded.Promise.allSettled. Fulfilled results are kept as before; rejected ones are recorded instead of propagating.RunResult.failedFrames: { frameId: string; error: string }[](types.ts) so callers/the CLI can see partial failure instead of a silent gap or a hard crash."frame:failed"RunEvent, surfaced bycli.ts's progress printer (✗ <frame> failed: <reason>) and byrender.ts's text output ("Partial failures" section) whenfailedFramesis non-empty.divergeBranch,scoreIdeas, andclusterIdeasalready failed open internally on JSON-parse errors; this only changes the network/LLM-call layer that could previously throw before ever reachingparseJSON.Testing
npm run typecheck— clean.npm test— existing suite passes (1/1). I did not add a new automated test for this fix: exercising the failure path would require mocking the Claude Agent SDK'squery()call, and the repo has no existing mocking setup for LLM calls (the one existing engine-adjacent test only covers the purebuildQueryOptionshelper) — introducing one felt out of scope for a targeted bug fix. Verified the reconciliation logic by inspection and by runningnpm run build && node dist/cli.js --help.npm run build— clean.Closes #44
🤖 Generated with Claude Code