fix: make Ask output token budget configurable - #1247
Open
bferanmi806-sketch wants to merge 2 commits into
Open
Conversation
bferanmi806-sketch
marked this pull request as ready for review
August 6, 2026 11:14
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
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.
Description
Make the Ask/Q&A output token budget configurable so intermediate and final answers are not silently truncated at the strategy step's smaller budget.
2000tokens.OPEN_NOTEBOOK_ASK_MAX_TOKENS.8192tokens.8192with a warning.Related Issue
Fixes #1221
Type of Change
How Has This Been Tested?
uv run pytest)Test Details:
uv sync- completed successfully.uv run pytest tests/test_ask_token_budget.py -v- 9 passed, 1 dependency deprecation warning.uv run pytest tests/ -v- 611 passed, 3 failed, 49 errors, 2 dependency warnings. The failures and errors are pre-existing Windows path, proxy-environment, and temp-directory permission issues; the same representative failures reproduce on clean upstreama7de90d38aaf18ee85fd661854d35c11e44613e2.uv run ruff check .- passed.uv run ruff format --check open_notebook/graphs/ask.py tests/test_ask_token_budget.py- 2 files already formatted.uv run python -m mypy .- no issues found in 131 source files.git diff --check- passed.Design Alignment
Which design principles does this PR support? (See VISION.md)
Explanation:
The change adds one narrow, process-level configuration helper instead of expanding the request/API contract. It preserves provider-agnostic model selection and passes the budget through the existing per-call Esperanto configuration path.
Checklist
Code Quality
Testing
make rufforruff check . --fixmake lintoruv run python -m mypy .Documentation
/docs(if applicable)Database Changes
Breaking Changes
Screenshots (if applicable)
Not applicable; this is a backend-only change.
Additional Context
The strategy step remains deliberately small because it produces a bounded structured
Strategyobject with at most five searches. The two prose-generation stages have different output requirements and therefore use the configurable budget independently.Pre-Submission Verification
Before submitting, please verify:
bferanmi806-sketchfix: make Ask output token budget configurableThank you for contributing to Open Notebook!