You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: raise default max_tokens from 4000 to 8192, add --llm-max-tokens CLI flag (#51)
* fix: raise default max_tokens from 4000 to 8192
The default max_tokens of 4000 for LLMAnalyzer (and 8000 for
MetaAnalyzer) frequently causes truncated JSON responses. In a batch
of 200 skills, 30.5% of scans produced truncated output at the
4000-token limit; raising to 32768 at the call site eliminated all
truncation.
Set the default to 8192 — the Gemini API default for maxOutputTokens,
and safely within the output ceiling of all major providers.
Fixes#50
Made-with: Cursor
* feat: add --llm-max-tokens CLI flag
Expose max_tokens as a CLI argument so users can tune the output
token budget without dropping to the Python SDK. Threaded through
to both LLMAnalyzer and MetaAnalyzer via the centralized
analyzer_factory.
Made-with: Cursor
* feat: add max_output_tokens to scan policy
Add llm_analysis.max_output_tokens as a policy-level knob alongside
the existing input budget fields. The CLI --llm-max-tokens flag
overrides the policy value. Both the analyzer factory and
_build_meta_analyzer now read from the policy when no CLI override is
given.
Update docs: custom-policy-configuration, policy-quick-reference,
cli-command-reference, and llm-analyzer architecture.
Made-with: Cursor
* fix: add max_output_tokens to TUI, use is-not-None checks, add round-trip tests
- Add max_output_tokens Input widget to policy TUI (configure-policy)
so users can set the output token budget interactively
- Replace `or` with `is not None` in analyzer_factory and cli for
correct handling of explicit zero values
- Add TestMaxOutputTokensPolicy with YAML round-trip, _to_dict, and
preset coverage tests
* fix: add max_output_tokens to all presets, expand test coverage
- Explicitly set max_output_tokens: 8192 in strict_policy.yaml and
permissive_policy.yaml (previously only inherited via deep merge)
- Add tests: custom YAML override, CLI-beats-policy in build_analyzers,
policy-used-when-CLI-is-None, MetaAnalyzer forwarding from CLI,
MetaAnalyzer fallback to policy
---------
Co-authored-by: vnarajal <vnarajal@cisco.com>
Copy file name to clipboardExpand all lines: docs/user-guide/custom-policy-configuration.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -518,12 +518,14 @@ llm_analysis:
518
518
max_code_file_chars: 15000 # Max chars per individual code file
519
519
max_referenced_file_chars: 10000 # Max chars per referenced file
520
520
max_total_prompt_chars: 100000 # Total prompt budget across all files
521
+
max_output_tokens: 8192 # Max tokens for LLM responses
521
522
meta_budget_multiplier: 3.0 # Meta-analyzer multiplies above limits by this factor
522
523
```
523
524
524
525
**Impact:**
525
526
- Files or instruction bodies exceeding these limits are skipped entirely (no truncation) and a budget-skip metadata entry is attached to the scan result.
526
-
- The meta-analyzer applies `meta_budget_multiplier` on top of the base limits. With the defaults, the meta-analyzer gets 60K instruction, 45K per file, and 300K total.
527
+
- `max_output_tokens` controls the output token budget for both the LLM analyzer and meta-analyzer. Raise this if scans produce truncated JSON (`LLM_ANALYSIS_FAILED` findings). The CLI flag `--llm-max-tokens` overrides this value.
528
+
- The meta-analyzer applies `meta_budget_multiplier` on top of the base input limits. With the defaults, the meta-analyzer gets 60K instruction, 45K per file, and 300K total.
527
529
- Increase these values for skills with large codebases or extensive instructions. Decrease them to reduce LLM API costs.
0 commit comments