Skip to content

fix: bound MCP live message responses - #114

Open
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/bound-mcp-live-read-responses
Open

fix: bound MCP live message responses#114
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/bound-mcp-live-read-responses

Conversation

@vycdev2

@vycdev2 vycdev2 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bound read-messages MCP responses to a configurable 120,000-character default, retaining the newest live messages when a response is oversized.
  • Preserve the existing JSON response and image hint for responses within the configured limit.
  • Document MCP_READ_MESSAGES_MAX_CHARS and add behavioral coverage through the public MCP tool path.

TDD evidence

  • RED on untouched upstream/main: node --test tests/mcpReadMessagesOutput.test.mjs failed because the 100-message live MCP response exceeded 120,000 characters.
  • GREEN after the fix: the same focused test passed, retaining newest-marker, omitting oldest-marker, and reporting truncation.

Verification

  • npm ci — passed; npm reported 13 audit vulnerabilities and a pending node-pty@1.1.0 install-script approval warning.
  • npm run build — passed.
  • node --test tests/mcpReadMessagesOutput.test.mjs — passed (1 test).
  • npm test — passed (66 tests).
  • node --input-type=module -e 'const p=await import("node-pty"); console.log(typeof p.spawn)' — passed (function).
  • git diff --cached --check — passed before commit.
  • npm run format:check — unavailable; the repository defines no format script.
  • No linter is configured in the repository.

Risk

Low. Normal-sized read-messages responses are byte-for-byte unchanged. Oversized responses now retain the newest complete message entries and append an explicit truncation note; no Discord API request behavior or message fields changed.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

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