Commit 1febc15
committed
fix: enforce tier-aware max_tokens in AutoAgents LLM calls
CodeGraphChatAdapter was creating GenerationConfig with max_tokens: None,
ignoring tier-based token limits. This caused all responses to use
default limits regardless of tier.
Changes:
- Store tier in CodeGraphChatAdapter
- Add get_max_tokens() method with env var override
- Set max_tokens in GenerationConfig based on tier
Token limits by tier:
- Small: 2,048 tokens
- Medium: 4,096 tokens
- Large: 8,192 tokens
- Massive: 16,384 tokens
Environment variable override:
- Set MCP_CODE_AGENT_MAX_OUTPUT_TOKENS to override tier defaults
- Useful for testing or specific deployment constraints
This ensures analysis output length matches tier expectations.1 parent fa91915 commit 1febc15
1 file changed
+26
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
42 | 64 | | |
43 | 65 | | |
44 | 66 | | |
| |||
80 | 102 | | |
81 | 103 | | |
82 | 104 | | |
83 | | - | |
| 105 | + | |
84 | 106 | | |
85 | 107 | | |
86 | 108 | | |
| |||
357 | 379 | | |
358 | 380 | | |
359 | 381 | | |
360 | | - | |
| 382 | + | |
361 | 383 | | |
362 | 384 | | |
363 | 385 | | |
| |||
0 commit comments