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
{{ message }}
Repository navigation
fix(ai): gateway tune fails on large prompts and ignores weight and concurrency settings #669
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/bugType bug: the code does not do what it must
Found in the release/v0.2.23 review (line numbers at 7fdaa9d).
Large prompts fail with "Argument list too long".devops ai gateway tune passes the whole review-page prompt to kubectl debug as a single python -c argument (src/devops_cli/ai/gateway_tune.py:387-397, :514-527). The prompt size comes from src/devops_cli/commands/ai_gateway.py:434-438.
Above about 32K prompt tokens, that argument exceeds Linux's 131,072-byte per-argument limit. At the shipped 64K context it is 148 KB, and --prompt-tokens >= 32047 triggers the same failure.
Each run also appears to add an 80-150 KB ephemeral container to the gateway pod's spec, growing the object (unconfirmed).
Weight overrides are matched inconsistently.ai.gateway_weights is matched by deployment ID after a successful sweep, but by backend label in the hardware-only fallback (gateway_tune.py:151-154 vs :227-229). A label-keyed override such as {vllm: 8} is silently ignored after a sweep.
ai.gateway_concurrency does nothing. It is read from config (src/devops_cli/config/settings.py:415-416), but never used; calculate_hardware_concurrency is only called from tests.
Remediation Plan
Send the prompt through stdin or a file instead of argv, and reuse one debug container per run.
Match weight overrides by deployment ID or backend label on both paths.
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/bugType bug: the code does not do what it must
Activity
fix(ai,k8s): resolve gateway tune argv overflow, weight/concurrency o…
dan-petty commentedon Sep 28, 2026
Resolved by #677 in release/v0.2.23.
docs(tasks): update milestone rollover to v0.2.24 and record complete…