fix(mcp): Align context and status surfaces - #121
Conversation
Keep legacy JSON responses complete while bounding ordinary text and structured content. Resolve request-local roots with native paths and stabilize status ordering. Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
The status tool now points clients at the protocol's tools/list instead of
embedding a hand-maintained tool inventory, so the surfaced tool set always
matches the registered tools. Home-relative ("~") project paths expand via
$HOME.
Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
c56c990 to
25f8bf1
Compare
JordanCoin
left a comment
There was a problem hiding this comment.
Verified independently. The status tool was advertising 10 tools while 16 are registered — deleting that hand-maintained list is a real truthfulness fix, and a list like that could only ever drift. Confirmed the new tests aren't vacuous: reverted the source to main and 8 of 10 fail with the exact symptoms claimed.
Noted for follow-up, not blocking: mcp/main.go:334 uses os.Getenv("HOME") for ~ expansion, which is unset on Windows (os.UserHomeDir() reads USERPROFILE), so ~/proj resolves against the server's cwd. It's propagation rather than regression — 8 such sites on main, 9 here — and skills/loader.go:40 already has the right idiom. Worth knowing that CI's test matrix is ubuntu+macos only, so this class is invisible to CI.
What does this PR do?
Keeps MCP results honest and deterministic: ordinary text is bounded to the output budget, legacy JSON responses stay complete, project paths resolve to native/request-local roots (including
~home expansion), and the status surface is stable and exact. The tool inventory is served by the protocol'stools/list(the SDK's live registry) instead of a hand-maintained embedded list that could drift from the registered set.Type of change
Checklist
go build && ./codemap .Additional notes
limits.MaxContextOutputBytes;completeJSONResultpreserves complete, valid JSON.tools/list.~/paths expand via$HOME.Developed with carefully directed, manually reviewed AI assistance.