feat(tui): show tool and MCP schema costs - #5603
Conversation
Add bounded per-tool catalog estimates and per-server MCP announcement totals to the context inspector without changing prompt assembly or cache behavior. Cover ordering, truncation, and empty-server cases for Hmbown#5553.
|
Thanks @wuisabel-gif for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
Display-only slice of #5553 by Isabel Wu (wuisabel-gif). Estimates bounded schema-token cost for the built-in tool catalog and each discovered MCP server in the context inspector; no prompt assembly, catalog, or cache behavior change.
|
Taken into the 0.9.12 integration branch ( |
Hmbown
left a comment
There was a problem hiding this comment.
Reviewed the context-inspector schema-cost slice. Catalog vs MCP attribution is bounded, prompt assembly is unchanged, and the inspector test covers catalog totals, row cap, MCP match, and empty servers. CI is green. Taking this onto main.
|
Already integrated on |
|
@wuisabel-gif — same class of mistake as #5608, and the same apology. This PR was closed as already on the 0.9.12 integration branch ( On main right now: no The display-only #5553 slice is therefore still outstanding. Closing these PRs as landed was true of a stale integration head, not of Rescue plan: local worktree
That branch is not yet an Credit stays with you. #5553 remains the broader issue and should not auto-close from this slice. |
|
Re-landing this on current #5603 (and the later grok rebase #5611) were closed as already integrated on the 0.9.12 integration branch, but the work never reached |
Rescue of @wuisabel-gif #5603 onto main. Authorship preserved. The original PR never reached origin/main despite being closed as landed.
|
Landed on |
Summary
Addresses the approved display-only slice of #5553.
The context inspector now shows bounded schema-cost estimates from the last model tool catalog:
The estimates serialize the existing
Tooldefinitions and use the same conservative character-to-token approximation already used by the inspector. MCP server rows match announcedmodel_nameentries against the last transmitted catalog, so deferred/not-yet-transmitted tools are not falsely counted as present in the current request.No prompt assembly, tool catalog construction, MCP discovery, or cache behavior changes.
Tests
Passed:
cargo fmt --all -- --checkgit diff --checkcargo test -p codewhale-tui --lib 'tui::context_inspector' --locked(13 passed)CARGO_INCREMENTAL=0 cargo clippy -p codewhale-tui --all-targets --locked -- -D warningsCoverage includes catalog ordering and row bounds, MCP server attribution, empty MCP servers, existing context-inspector output, and localization regression coverage.
No provider credentials or network access are required.
No-Issue: This PR addresses the approved #5553 display-only slice without automatically closing the broader issue.