fix(mcp): apply the message-id format rule on the agent tool - #1406
Merged
Conversation
The REST body rejects a whitespace-only entry in `messageIds`, but `SessionMarkChatRead` declared its own list and copied only the count bound. `invokeTool` parses the tool's schema and calls the service directly, so the DTO never applies on that path and `[' ']` reached the engine as a receipt key. The pattern and its message move into exported constants next to the existing cap, and the tool holds them rather than restating the rule. Restating it is how the two surfaces drifted in the first place.
Entries under `[Unreleased]` had grown past anything the released sections carry: median 44 words against 34, and a longest of 139 against a historical maximum of 80. They read as explanations rather than release notes. Rewritten to the same distribution (median 39, longest 57), keeping what a reader acts on and dropping the reasoning. Contributor credit and the section headings are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MarkChatReadDtorejects a whitespace-only entry inmessageIds, butSessionMarkChatReaddeclared its own list and copied only the count bound.invokeToolparses the tool's schema and calls the service directly, so the DTO never applies on that path and[' ']reached the engine as a receipt key.What changed
invokeToolpath and asserts the service is never reached, since a 400 that still delegated would leave the defect in place. A well-formed id is sent through as the control.Also in this PR
The
[Unreleased]changelog entries had grown past anything the released sections carry: median 44 words against 34, longest 139 against a historical maximum of 80. They are rewritten to the same distribution (median 39, longest 57), keeping what a reader acts on. Contributor credit and the section headings are unchanged. Bundled here rather than split off because it is prose only and touches no code.Verification
npm run build,npm test,npm run lint,npm run format:check,test:docs,test:scripts, and the openapi, SDK and contract gates.check-contract-shapesreports 320 pairs, unit 5851 tests.Fixes #1405