fix(mcp): preserve compact conflict judgment contract - #800
Conversation
…ssue #1019) Claude Code's MCP client truncates server instructions at 2048 runes during handshake and SIGINTs the connection when truncation occurs. This test asserts the boundary so any future prose addition that pushes the constant over the cap is caught locally before CI. Rune count is measured with utf8.RuneCountInString; em-dashes, arrows, and other multibyte runes each decode as one rune, so the plain byte len() of the string misleadingly understates the figure Claude Code sees. Issue #1019 reported the failure as "Server instructions truncated from 2539 to 2048 chars".
…#1019) The CONFLICT SURFACING prose ballooned to 2539 runes, pushing the constant past Claude Code's 2048-rune MCP truncation cap and breaking the handshake in the plugin marketplace path. The shorter form keeps all ten required key phrases (judgment_required, candidates[], mem_judge, 0.7, supersedes, conflicts_with, architecture, conversationally, evidence, ## CONFLICT SURFACING) so TestServerInstructions_ConflictSurfacingBlock still passes. Rune count drops from 2539 to 1400. No other section of serverInstructions was modified.
The tripwire test was named after issue #1019 (which lives in the Gentleman-Programming/gentle-ai orchestrator repo), making it cross-repo-coupled. A new engram-native issue will carry the fix; the tripwire is renamed to match. The test comment previously asserted a causal chain (truncation causes the MCP client to SIGINT ~4s after handshake) sourced from a single log correlation. Soften the comment to state the measured fact (2048-rune truncation ceiling) and explicitly mark the SIGINT/timing chain as field-report evidence not reproduced in this repo. No production code change; internal/mcp/mcp.go untouched.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe MCP server’s conflict-surfacing instructions were shortened. New tests enforce the 2048-rune limit and verify candidate-specific ChangesMCP instruction compaction
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This localized change preserves compact conflict instructions while ensuring each candidate retains its own judgment ID; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes address issue
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
The source-level fix for #700 is sound and preserves candidate-specific judgment guidance. The exact head is behind main, so this is not ready for approval. Please rebase onto current main and rerun the full CI suite on the rebased head.
🔗 Linked Issue
Closes #700
🏷️ PR Type
type:bug- Bug fixtype:feature- New featuretype:docs- Documentation onlytype:refactor- Code refactoringtype:chore- Maintenance, dependencies, toolingtype:breaking-change- Breaking change📝 Summary
📂 Changes
internal/mcp/mcp.gointernal/mcp/serverinstructions_length_test.go🧪 Test Plan
go test ./internal/mcp -count=1go test ./...exceeded the 10-minute local limit without reporting a failure; CI is required.🤖 Automated Checks
Closes #700go test ./...✅ Contributor Checklist
Co-Authored-Bytrailers💬 Notes for Reviewers
This maintainer PR supersedes #627 because triage credentials could not update the contributor fork directly. The original implementation and attribution remain with @ardelperal; the dropped-contract finding was independently reported by @yudelsuarez.
The bounded correction commit is
3f7fe83189f817de83fb7de1e42aa1a9d2e5fb87. Its exact two-file candidate completed native RDD approval, focused MCP tests pass, and no merge is requested until CI is green.Summary by CodeRabbit
Bug Fixes
Tests