Repository navigation
feat(comments): support clientRequestId on comment creation - #147
Conversation
|
This PR stays in draft until https://github.com/todoist/comms-backend/pull/1442 is merged. |
doistbot
left a comment
There was a problem hiding this comment.
This PR adds an optional clientRequestId to comment creation, flowing through the existing schema, serialization path, and docs, with an MSW regression test covering both supplied and omitted values — a clean, small, additive change with no inline issues flagged.
I also included a few optional follow-up notes in the details below.
Optional follow-up notes (2)
README.md:70: The public README names the internal "Agent Core" service. This repository is public and the README ships in the npm package; the repo privacy check calls out documenting Todoist-internal tools. Rephrase to describe which replies honour
clientRequestIdwithout the internal product name (the JSDoc incomments-client.tshas the same wording).src/types/requests.ts:70: Adding
clientRequestIdtoCreateCommentArgsSchemaalso widensCloseThreadArgs/ReopenThreadArgs, since they derive fromCreateCommentArgsviaThreadActionCommentArgs.threads.closeThread/reopenThreadnow accept and forwardclient_request_id, but the JSDoc and README only documentcomments.createComment. If that forwarding is intended, document the option on those two methods too; otherwise exclude it there, e.g.Omit<CreateCommentArgs, 'threadId' | 'clientRequestId'> & { id: string }.
|
Addressed both optional follow-ups in 686922b.
The README and JSDoc now say "Comms' agent service".
Added the parameter documentation to
|
## [5.1.0](v5.0.2...v5.1.0) (2026-11-13) ### Features * **comments:** support clientRequestId on comment creation ([#147](#147)) ([89b710e](89b710e))
|
🎉 This PR is included in version 5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
Agent Core needs to send the asking comment's ID when posting an answer, so the backend can notify the question's audience. The exported comment request schema drops this field today.
This prepares the SDK for the backend change. Agent Core adoption follows once the SDK version is published.
What was changed
comments.createCommentaccepts optionalclientRequestId, sent asclient_request_id. Schema parsing preserves it; existing calls omit the key.feat:title requests a minor release through the existing version and changelog automation, currently targeting 5.1.0.Proof
clientRequestId: 'abc'and with the field omitted.npm run verify, the docs site build, andnpm run attwpassed.Not verified: real Comms API behavior, an Agent Core consumer integration, or Node 26 locally.
Refs