Skip to content

Separate output and context token budgets#71

Open
Aawegg wants to merge 1 commit into
ArtificialAnalysis:mainfrom
Aawegg:fix/separate-context-window
Open

Separate output and context token budgets#71
Aawegg wants to merge 1 commit into
ArtificialAnalysis:mainfrom
Aawegg:fix/separate-context-window

Conversation

@Aawegg

@Aawegg Aawegg commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • add an independent context_window client setting while keeping max_tokens as the per-request output cap
  • use the real context window for Agent summarization thresholds, with a runtime fallback for legacy custom clients
  • document the split and clarify overflow error messages across built-in clients

Closes #55

Test plan

  • uv run pytest tests/test_clients_context_window.py tests/test_agent.py::test_summarization_uses_context_window_not_max_tokens tests/test_agent.py::test_legacy_client_without_context_window_falls_back_to_max_tokens -q
  • broader non-optional suite: 93 passed, 4 skipped
  • uv run ruff check src/stirrup/clients src/stirrup/core tests/test_clients_context_window.py tests/test_agent.py

Allow models to use their real context window for summarization without inflating per-request output limits, while preserving legacy client behavior.
@Aawegg
Aawegg force-pushed the fix/separate-context-window branch from 3d1eac7 to 7279396 Compare July 15, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: max_tokens conflates per-request output cap and context-window/summarization budget

1 participant