Skip to content

fix(mcp): preserve memory in compact retrieval responses - #63

Closed
dannyward630 wants to merge 1 commit into
orenlab:mainfrom
dannyward630:fix/issue-62-memory-budget
Closed

dannyward630 wants to merge 1 commit into
orenlab:mainfrom
dannyward630:fix/issue-62-memory-budget

Conversation

@dannyward630

Copy link
Copy Markdown

Summary

Fixes #62 by allowing the budget reducer to reduce complete lanes and retain the projection request needed to build a continuation for visible items. Empty lanes no longer receive cursors, each continuation cursor is emitted once, and static drill-down routes move to help(topic="engineering_memory"). If the response cannot fit any memory item, the tool raises an MCPServiceContractError with the empty-response estimate and limit instead of returning an empty success. No schema or contract version bump is needed.

Validation

  • uv run pre-commit run --all-files — passed.
  • uv run pre-commit run --hook-stage pre-push --all-files — passed: 4,254 passed, 2 skipped, 99.16% total coverage.
  • uv run --with zensical==0.0.46 zensical build --clean --strict — passed.

Docs and release notes

Updated the changelog, README, and MCP contract/reference docs.

AI assistance and review status

Prepared with Codex (GPT-6), which implemented the patch and ran the checks above. This is a draft pending human verification of the tests, contract implications, documentation, and final diff. The repository requires substantive human review before merge.

@orenlab

orenlab commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Thanks for looking into #62. We won't merge this one: development continues on a separate branch that is several hundred commits ahead of main, and this patch no longer applies there (6 of the 12 files conflict). The duplicated cursor and the per-response drill-down list described in #62 are already gone on that branch; the remaining part of the issue (continuation cursors crowding out records on wide scopes) will be fixed there directly. Closing — thanks again.

@orenlab orenlab closed this Oct 26, 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.

get_relevant_memory returns zero records at any request size: the response envelope alone exceeds the context budget

2 participants