feat(tui): configurable model-visible read/tool-result budgets (#5367) - #5405
Draft
Hmbown wants to merge 1 commit into
Draft
feat(tui): configurable model-visible read/tool-result budgets (#5367)#5405Hmbown wants to merge 1 commit into
Hmbown wants to merge 1 commit into
Conversation
…5367) Extend existing [workshop] / WorkshopConfig with optional read_result_max_bytes and tool_result_max_bytes. Absent keys keep the current conservative constants (read 50 KiB, hidden read_file 16 KiB, tool-result context/wire 12 000 chars or 48 000 on ≥500K windows). Thread Config → Engine / App / DeepSeekClient into compact_tool_result_for_route, compact_tool_result_for_wire, and file.rs READ_MAX_BYTES / MAX_VISIBLE_BYTES / SMALL_FILE_BYTES via unwrap_or. HarnessProfile is unchanged. Requested by @hxfhd in #5367. Agent assistance used for implementation; verification still pending. Co-authored-by: Hunter Bown <Hmbown@users.noreply.github.com>
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.
Summary
Self-hosted long-context DeepSeek V4 users hit conservative per-result ceilings (
read50 KiB, hiddenread_file16 KiB, tool-result context/wire 12 000 chars) and pay ~20 extra reads on a ~64 KiB file. They want optional larger individual-result budgets, not global compaction off (#5367, requested by @hxfhd).This extends the existing
[workshop]/WorkshopConfigtable (already deserialized) with two optional keys. Absent keys keep today's constants via.unwrap_or.Keys added
read_result_max_bytes— model-visibleread/ hiddenread_filebyte budget. Unset:readstays 50 KiB;read_filestays 16 KiB (including the small-file fast path).tool_result_max_bytes— character budget for one tool result on the context path and the Chat Completions wire. Unset: 12 000 chars (48 000 on routes whose window is ≥ 500K). Setting this overrides both hard ceilings. Does not disable session compaction or change the 4K+4K excerpt.Threaded Config → Engine / App / DeepSeekClient into
compact_tool_result_for_route,compact_tool_result_for_wire, andfile.rsREAD_MAX_BYTES/MAX_VISIBLE_BYTES/SMALL_FILE_BYTES.HarnessProfileis unchanged (preview schema, not consumed at runtime).Documented in
docs/CONFIGURATION.mdandconfig.example.toml.Testing
cargo fmt --all -- --check(rancargo fmton this change)cargo clippy --workspace --all-targets --all-features --locked(warning-free under the CI allow list)cargo test --workspace --all-features --lockedTargeted (in progress after this draft):
cargo test -p codewhale-tui --lib workshop_result_budgets_default_absent_and_parse_when_set configured_tool_result_budget_keeps_large_file_read_on_small_context_model v4_keeps_large_file_reads_but_compacts_noisy_shell_output evidence_bounded_preview_is_not_recompacted registry_catalog_bypasses_generic_tool_result_compaction contract_read_ --lockedChecklist
No bot/tool
Co-authored-by. Issue reporter @hxfhd is credited in the commit body (issue-only; no code).v098-final harvest
This is a maintainer-authored branch from current
main(5ac75add4), not a community PR rewrite. Harvest by cherry-pick or merge onto the v098-final landing branch; keep authorship. Changelog should credit @hxfhd as the requester (#5367). Do not useHarvested from PR #N by @…unless harvesting a community PR. After it reachesmain, close #5367 with credit to @hxfhd. Do not tag or publish from this lane.