Skip to content

fix(mcp): keep injected agent context on summaries - #1511

Closed
ScriptedAlchemy wants to merge 3 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/guard-context-window-5c20
Closed

ScriptedAlchemy wants to merge 3 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/guard-context-window-5c20

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • guard-the-context-window: stop the agent-facing defaults that put raw payloads back into the prompt.
  • Merged latest feat: TraceDecay V2 delivery (PR8–PR13) + daemon performance, memory, and reliability overhaul #707 tip 3e6167b265639c17b7d1c174cd3b7baa3116adae into this branch (f88f92659f). Conflicts were only the compile-unblock copies of tip fixes; tip versions were kept.
  • tracedecay_status matches the CLI compact contract. tracedecay_skill_view returns support-file summaries unless include_support_files=true. Truncated responses no longer tell the model to rejoin the stored body. Session steering builders enforce their budgets.

Does not merge #707 into master. Targets the #707 tip only.

Merge

  • Tip SHA merged: 3e6167b265639c17b7d1c174cd3b7baa3116adae (test(code-index): re-pin partitioned codec onto extractor.rust.v8)
  • Merge commit: f88f92659f1c12f18b58aa64b43689da15cab072
  • Conflicts:
    • branch_publication.rs: kept the tip's typed NotApplicable → CODE_INDEX_IDENTITY_MISMATCH (non-retryable). Did not keep the earlier compile-only arm that treated it as queued.
    • publication_store.rs: kept the tip's non-enumerated reuse comment (reused_count / reused_digest; per-chunk Reused rows are ExtraChunkReceipt).

Motivation

The context window is finite. Review of PR #707 through guard-the-context-window found agent-facing surfaces that either dump raw data into the main prompt or instruct the model to reassemble it.

Changes

  • tracedecay_status defaults the expensive sections off. Opt in for the full diagnostic list, storage health, session ingest, or Git staleness.
  • tracedecay_skill_view no longer inlines support-file bytes by default. Path and byte_len summaries stay.
  • Truncation recovery text and tracedecay_retrieve tell the model to use the preview and request one omitted span, not concatenate every page.
  • Cursor/Codex session-context builders cap caller-supplied freshness text and enforce the documented budgets.
  • Regression test keeps the always-loaded MCP core at the agreed seven tools.

Findings not changed

  • tools/list regression ceiling is 640 KiB (measured ~627 KiB). Bounding the remaining canonical schemas is a separate deletion.
  • tracedecay_read still defaults to mode=full.
  • Message search still defaults include_subagents to true.

Test plan

  • After the tip merge: hooks::steering (2), tools::render::tests (9), catalog always-load and summary-default tests, mcp_suite status_runtime_test (10) and managed_skill_mcp_tools_list_and_view_profile_store (1)
  • tracedecay-code-index-runtime compiled as a dependency of those runs after the conflict resolution
  • Full workspace cargo nextest not run

Checklist

  • CHANGELOG.md updated (release-please owns this file; no Unreleased section)
  • No secrets, credentials, or .env files included
  • Behavior change: omitted MCP status/skill-view flags are compact. Opt in to the previous raw sections.
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 17, 2026 01:39
The reused partition is a count and digest, not a chunk list, and demand
admission now returns NotApplicable. Cover both so the scheduler builds.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Status, skill view, and truncated-response recovery were putting raw
payloads back into the prompt. Default those surfaces to summaries and
enforce the session steering budget.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f88f926

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…r/guard-context-window-5c20

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Integrated or superseded directly on the #707 branch at ff36c4f; follow-up compile/typecheck regressions were fixed on that branch.

@ScriptedAlchemy
ScriptedAlchemy deleted the cursor/guard-context-window-5c20 branch October 11, 2026 00:00
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.

2 participants