-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Perf/bound review latency #803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
e2e461d
6d4649b
4f3971d
a64777c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,7 +40,7 @@ type commonContext struct { | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // loadCommonContext validates the working directory, loads the embedded | ||||||||||||||
| // template, raises MaxToolRequestTimes when maxTools exceeds the default, | ||||||||||||||
| // template, overrides MaxToolRequestTimes when maxTools is explicitly set, | ||||||||||||||
| // resolves the absolute repo path, loads system review rules, and creates | ||||||||||||||
| // the global git subprocess limiter. Both review and scan callers go | ||||||||||||||
| // through this so the startup sequence stays consistent. | ||||||||||||||
|
|
@@ -53,7 +53,7 @@ func loadCommonContext(repoDirInput, rulePath string, maxTools, maxGitProcs int, | |||||||||||||
| if err != nil { | ||||||||||||||
| return nil, fmt.Errorf("load default template: %w", err) | ||||||||||||||
| } | ||||||||||||||
| if maxTools > tpl.MaxToolRequestTimes { | ||||||||||||||
| if maxTools > 0 { | ||||||||||||||
| tpl.MaxToolRequestTimes = maxTools | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+77
to
79
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [bug · high] In if opts.maxTools > scanTpl.MaxToolRequestTimes {
scanTpl.MaxToolRequestTimes = opts.maxTools
}But now The review command should also only raise the limit, not lower it, to match user expectations and the documented behavior. Suggestion:
Suggested change
|
||||||||||||||
| if err := tpl.Validate(); err != nil { | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,5 +31,5 @@ | |
| }, | ||
| "MAX_TOOL_REQUEST_TIMES": 30, | ||
| "PLAN_MODE_LINE_THRESHOLD": 50, | ||
| "MAX_TOKENS": 58888 | ||
| "MAX_TOKENS": 30000 | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[bug · high]
Bug: When
maxToolsis 0 (the default), the template'sMaxToolRequestTimesis never overridden. However, the template validation inloadCommonContextchecksif t.MaxToolRequestTimes <= 0and returns an error. If the embedded template hasMaxToolRequestTimes = 0, this will fail validation even though the user didn't explicitly set the flag. The old logic (if maxTools > tpl.MaxToolRequestTimes) would only override when the user explicitly set a higher value, preserving the template's default. The new logic breaks this by treating 0 as "use template default" but the template might have 0, causing validation to fail.