feat(llm-council): add --max-tokens CLI flag - #89
Conversation
Hardcoded max_tokens: 4000 is too small for reasoning models (Nemotron Ultra, GLM-5.2, DeepSeek-V4, Claude thinking) which need 8K-32K output tokens for their reasoning chain or they emit empty content. Introduce RUN_OPTS struct + --max-tokens flag (default 4000, preserves current behavior). Both callOpenAICompat and callAnthropic read from RUN_OPTS.max_tokens. Fixes rohitg00#88.
|
Warning Review limit reached
Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe council script adds a ChangesMaximum token configuration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/llm-council/scripts/council.js`:
- Line 171: Validate args['max-tokens'] before assigning RUN_OPTS.max_tokens:
require a fully numeric, integer value greater than zero, rejecting malformed
inputs such as prefixes and NaN. On invalid input, emit a clear CLI error and
stop without mutating the runtime configuration; otherwise assign the parsed
value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f02f9fe6-a774-4b65-95b0-a8ef044affb4
📒 Files selected for processing (1)
skills/llm-council/scripts/council.js
- Fix runCalls: invoke callables before Promise.allSettled (was passing function objects instead of promises, breaking Phase 1/2) - Add parseIntSafe helper: validate --max-tokens, --timeout, --max-retries are positive integers, reject NaN/negative/non-integer - Validate --reasoning-effort: only low|medium|high accepted - Fix Anthropic thinking: use adaptive type instead of fixed budget_tokens - Add 5xx-specific error hint (retry later, check provider status) - Update SKILL.md with all new CLI flags and runtime options table Addresses CodeRabbit comments on PRs rohitg00#89-rohitg00#101.
Add parseIntSafe: require positive integer, reject NaN/negative. Addresses CodeRabbit comment on PR rohitg00#89.
Fixes #88.
What
skills/llm-council/scripts/council.jshardcodedmax_tokens: 4000in bothcallOpenAICompat(line 87) andcallAnthropic(line 103). This is too small for modern reasoning models (Nemotron-3-Ultra, GLM-5.2, DeepSeek-V4, Claude with thinking enabled), which routinely need 8K–32K output tokens for their reasoning chain. With the current default they either:choices[0].message.content(the model exhausted its budget before emitting any final answer), orThere's no way to override this from the CLI — users have to monkey-patch the constant.
Change
RUN_OPTSstruct (const RUN_OPTS = { max_tokens: 4000 };) at the top of the file.RUN_OPTS.max_tokensinstead of the literal.--max-tokens Nparsing incmdRun(default preserves current behavior).usage().Reproduction (before this PR)
After this PR
Scope
This PR is intentionally minimal — only adds the knob, doesn't touch retry/timeout/sequential logic (separate concerns for separate PRs). Diff: 13 +, 4 -.
Backward compatibility
Default
4000preserved verbatim. Existing users see no behavior change unless they pass--max-tokens.Summary by CodeRabbit
New Features
--max-tokensoption to customize the maximum response length when running the council script.Documentation