feat(action): expose effort and max_tokens_budget inputs - #1157
Closed
ylcn91 wants to merge 1 commit into
Closed
Conversation
The composite action builds the `ocr review` command itself and exposes only --concurrency, --timeout, --background and --rule, so two flags were unreachable from a workflow: --effort, which picks the review-round preset, and --max-tokens-budget, the only aggregate cap on a review's token spend (review_cmd.go gives it no config or environment fallback). Add both as optional inputs, appended to the review args only when non-empty so an unset input keeps the CLI default: the configured effort (otherwise medium), and an unlimited budget. An explicit 0 budget is forwarded rather than dropped and means unlimited too, matching the flag's own documentation. Both are validated before the npm install, so a typo fails with an annotation in seconds instead of after the whole review setup. effort accepts low/medium/high in any case, because `ocr review` lower-cases the preset itself; the budget must be a non-negative integer without leading zeros, because the CLI parses integer flags with a base-0 strconv where "010" would silently mean 8. effort also joins the checkpoint fingerprint: a checkpoint recorded by a low-effort run must not narrow a later high-effort one. max_tokens_budget deliberately stays out, since a run that hits its budget is partial and only a complete run advances a checkpoint.
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). |
Contributor
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.
Description
The composite action builds the
ocr reviewcommand itself and exposes only--concurrency,--timeout,--backgroundand--rule, so two flags were unreachable from a workflow:--effort, which picks the review-round preset, and--max-tokens-budget, the only aggregate cap on a review's token spend (review_cmd.gogives it no config or environment fallback).This adds both as optional inputs, appended to the review args only when non-empty, so an unset input keeps the CLI default: the configured effort (otherwise medium) and an unlimited budget. An explicit
0budget is forwarded rather than dropped and means unlimited, matching the flag's own documentation.Both are validated before the npm install, so a typo fails with an annotation in seconds instead of after the whole review setup.
effortaccepts low/medium/high in any case, becauseocr reviewlower-cases the preset itself; the budget must be a non-negative integer without leading zeros, because the CLI parses integer flags with base-0strconv, where010would silently mean 8.effortalso joins the checkpoint fingerprint: a checkpoint recorded by a low-effort run must not narrow a later high-effort one.max_tokens_budgetdeliberately stays out of it, since a run that hits its budget is partial and only a complete run should advance a checkpoint.Type of Change
How Has This Been Tested?
make testpasses locallyManual testing (describe below)
npm run test:github-actions: action-contract cases for both inputs (unset, set,0budget, invalid values, case handling ofeffort) and the fingerprint change inpost-review-comments.test.js.make teston this branch (Go packages plus the node script tests).Only
action.yml, the scripts underscripts/github-actions/andexamples/github_actions/README.mdchange; there is no Go change.Checklist
go fmt,go vet)Related Issues
Closes #1147