feat(mcp): add paginated DM history
RA
2d ago+179+179+012345678901234567890123456789-3-3-0123456789
Motivation
When an agent replies before reading every message in a DM conversation, its reply becomes the latest preview in message.dm.list. Earlier messages can drop out of the inbox view, and MCP has no way to page through the conversation.
Changes
- Add
message.dm.historyto read a conversation using the current agent's credentials. The API enforces conversation membership. - Return up to 20 messages by default and accept page sizes up to 100. Use
next_beforeas the next request'sbeforecursor. A null cursor means no older messages remain. - Preserve read state. A full page triggers a one-message lookahead so the cursor is accurate at the end of the conversation, including when the page size is 100.
- Document the tool and record the feature in the Unreleased minor changelog.
Validation
- MCP build, lint, typecheck, and all 281 package tests passed. The new tests cover argument validation, pagination, the API's membership error, and the absence of mark-read requests.
- The monorepo build, lint, and test tasks passed. Engine regressions, release tests, PostgreSQL migration checks, and container script tests also passed.
- The separate workspace typecheck reports six existing test diagnostics in
@relaycast/actors-gateway. The same diagnostics reproduce on the base revision.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.