Skip to content

Trim fixed MCP context overhead#94

Merged
Byggarepop merged 1 commit into
mainfrom
trim-mcp-context-overhead
Jun 9, 2026
Merged

Trim fixed MCP context overhead#94
Byggarepop merged 1 commit into
mainfrom
trim-mcp-context-overhead

Conversation

@Byggarepop

Copy link
Copy Markdown
Owner

The /usage breakdown attributes most session context to the tokensaver MCP server. Most of that share is tool results doing their job (they replace larger raw reads), but the fixed per-session overhead was genuinely trimmable. This PR cuts it without removing any behavior rule.

  • ServerInstructions: 2,207 -> 1,583 tokens (print-overhead). Selection rules are tightened to terse form and reordered ahead of the supported-types table, so MCP clients that truncate long server instructions (Claude Code cuts off around 3K characters) keep the behavior-critical rules.
  • Emitter banners collapse to one line per result (was 2-5 lines) across all emitters; same facts, fewer tokens on every call.
  • Session header line shortened to session: N calls / saved X / net Y after Z overhead, and the repeat-view line trimmed. The Tokens without tool first-view marker is unchanged.
  • Header examples in mcp/README.md and .github/copilot-instructions.md synced; test parsers for the session and repeat-view lines updated.

No tool descriptions or schemas change, and no version bump. 172/172 tests pass.

…e-line result banners

ServerInstructions drops from 2,207 to 1,583 tokens with no rule removed:
selection rules are tightened to terse form and moved ahead of the
supported-types table so clients that truncate long instructions keep the
behavior-critical part. Emitter banner notes collapse from 2-5 lines to one
line per result, and the session header line shortens to
"session: N calls - saved X - net Y after Z overhead". Header examples in
mcp/README.md and copilot-instructions.md updated to match; test parsers for
the session and repeat-view lines updated.
@Byggarepop
Byggarepop merged commit 38ea927 into main Jun 9, 2026
1 check passed
Byggarepop added a commit that referenced this pull request Jun 11, 2026
…own banner (#96)

* Never downgrade a newer version pin in self-update; single-line Markdown banner

SetPinnedVersion now refuses to lower an existing --version pin when the
pinned version is newer than the target (core-version comparison via IsNewer,
prerelease suffixes ignored). This stops the background self-update from
stomping a deliberately pinned local dev build (e.g. 9.9.9-dev from a local
feed) with the latest stable from nuget.org — which previously left the entry
pointing at a version the configured --source doesn't have, so the server
failed to launch. Stale-config re-pinning and the manual self-update path
(#68) are unaffected: older pins still upgrade.

MarkdownEmitter's banner note collapses from two lines to one, matching the
other emitters after #94 (it was the only emitter missed in that pass).

* Add PR number to CHANGELOG entries
Byggarepop added a commit that referenced this pull request Jun 11, 2026
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.

1 participant