Repository navigation
V11: Cap output tokens in scaffolded agents - #681
Merged
Merged
Conversation
Scaffolded agent.ts sets modelSettings { maxTokens: 4096 } so first runs do not
fail on low-credit OpenRouter keys; README gets a troubleshooting entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinuxDevil
force-pushed
the
v11-scaffold-max-tokens
branch
from
October 19, 2026 21:43
f99189e to
19b6406
Compare
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.
Fixes audit finding DX-3 / PM-10 (Vercel competitor audit, 2026-10-19).
What was wrong
create-lousho-agent --provider openrouter --template tools --yesthennpm run devfailed withThis request requires more credits, or fewer max_tokens. You requested up to 65536 tokens: the generated agent set no output cap, so OpenRouter reserved the model's full max output.What changed
create-lousho-agentjust runslousho init, so the shared template source issrc/cli/init/templates.ts. Generatedsrc/agent.ts(minimal and tools templates, every provider) now hasconst modelSettings = { maxTokens: 4096 }with a comment on why and how to raise it, passed to both the default config andbuildAgent(provider).Tests
src/cli/init/templates.test.ts: every provider x non-yaml template has the cap in agent.ts and the README entry.npx tsc --noEmit,typecheck:tests,lintclean;test:coverage406 files passed;fallowexit 0;packages/create-lousho-agente2e (real install, typecheck and test of openai + openrouter projects) passed.Changelog: Scaffolded agents set a default
modelSettings: { maxTokens: 4096 }so first runs do not fail on low-credit keys (OpenRouter), and the scaffold README documents the credit error.🤖 Generated with Claude Code