Skip to content

fix(agent): honor configured model.max_tokens (salvage #19452)#21298

Merged
teknium1 merged 1 commit into
mainfrom
salvage/pr-19452
May 7, 2026
Merged

fix(agent): honor configured model.max_tokens (salvage #19452)#21298
teknium1 merged 1 commit into
mainfrom
salvage/pr-19452

Conversation

@teknium1

@teknium1 teknium1 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Closes #19452 via salvage.

Summary

Read model.max_tokens from config.yaml when AIAgent isn't constructed with an explicit max_tokens. Constructor value wins. Include model.max_tokens in the gateway agent-cache signature so config edits rebuild cached agents.

Validation

scripts/run_tests.sh tests/run_agent/test_run_agent.py tests/gateway/test_agent_cache.py -k max_tokens → 13 passed.

Note: #19515 (batch 4) proposes the same fix — this salvage supersedes it.

Original author: @LeonSGP43.

@teknium1 teknium1 merged commit a78e622 into main May 7, 2026
8 of 11 checks passed
@teknium1 teknium1 deleted the salvage/pr-19452 branch May 7, 2026 13:40
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: salvage/pr-19452 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 7532 on HEAD, 7532 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 3955 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder comp/gateway Gateway runner, session dispatch, delivery labels May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants