Repository navigation
refactor: one timing budget and shared candidate checks in pull request reviews - #42
Merged
Merged
Conversation
Member
Author
|
@gitdogai review |
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
A structure cleanup of the review code that changed over the last day (PRs 37–41), from four independent cleanup reviews (reuse, simplification, efficiency, altitude). Behavior is unchanged except where noted.
reviewWithContext. The timing constants form one commented timeline at the top ofworkflow.ts:REQUEST_END_MS,REQUEST_TIMEOUT_MS, the final and late end targets,MIN_SLOW_TIMEOUT_MS,SLOW_REQUEST_MIN_MSandOPTIONAL_PASS_CUTOFF_MS.COVERAGE_REQUEST_CUTOFF_MSis renamed toOPTIONAL_PASS_CUTOFF_MS. It also gates second looks and the second check now, and its old comment cited a two-minute request limit that no longer holds.beforeOptionalCutoff(),slowRequest(endMs, maxMs)andlateRequest(). They replace three copies of the cutoff test, two hand-written timeout clamps and fourtimeoutMs/minTimeMspairs.verifyonly passed along is gone:verifytimes its first check when it is entered, before the guard, as before. The second check now computes its own timeout when sent instead of reusing the first check's. That is the only timing difference, and the end time still caps it.findingPathandvalidateEach(keep the candidates that validate, return the rest), plus theconfidentItemsclosure (decode, confidence floor, cap), replace three near-copies in coverage passes, second looks and the closing synthesis. Each caller keeps only its own rule for where rejected findings count as not reviewed.VERIFY_INSTRUCTION,RECHECK_INSTRUCTION).rebuildWithinBudget()replaces three copies of the rebuild-and-trim loop, and the always-true turn-start condition is dropped.CONVERSATION_BYTESreplaces the repeated 180 KB literal, andREVIEW_TURNS - 1replaces the literal 7.withTruncation()replaces four copies of the source mapping.systemPromptis computed once.EFFORTSis shared, and the stale "stop after two minutes" comment on own-key models is corrected.Left for later
{ context, state }split inreviewContextMessage, replacing theTURN_STATE_KEYSallowlist and the way second looks take apart the last request. It changes the context module's interface.doubtfulPaths, coverage'sdoubtfulset and theexcludedPathspushes.showRead, one options object forrequest(), and a single-passcachedPrefixBytes(findLastIndexis not in the Convex target library).Verification
bun run lint,bun run typecheck,bun run build,bunx prettier --check .bun run test: 2113 passed, unchanged.🤖 Generated with Claude Code