Conversation
@doist/comms-sdk 3.3.0 exports isNotFound, isConflict, isMalformedId, getCommsErrorCode and getCommsErrorString, which #66 had to write locally. Delete ours, bump the SDK pin, and import them in api.ts. The SDK's versions narrow with instanceof CommsRequestError, as status.ts already does, where ours duck-typed any object with an httpStatusCode. The 401 and 403 helpers stay here: isForbidden is "a 403 that is not a scope failure", which is CLI policy rather than a property of the response. api.test.ts replaced the whole SDK module with a mock that included a fake CommsRequestError, which an instanceof check can never match. It now fakes only CommsApi and keeps the real error class and helpers, so the status mapping is tested against the code it depends on. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
lmjabreu
requested review from
scottlovegrove
and removed request for
scottlovegrove
October 1, 2026 15:32
Contributor
Author
|
@doistbot /review |
doistbot
reviewed
Oct 1, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR swaps the locally duplicated SDK error predicates (isNotFound, isConflict, isMalformedId, getCommsErrorCode, getCommsErrorString) for the new exports in @doist/comms-sdk 3.3.0, intentionally keeping the 401/403 helpers local since isForbidden encodes CLI policy rather than response shape.
Few things worth tightening:
- The partial SDK mock in
src/commands/migrate/migrate.test.tsonly providesfetchNewCommsUrls, so it no longer covers thegetCommsErrorStringimport thaterrors.tspulls in transitively — update it to spreadimportActual(asapi.test.tsnow does) or supply the missing export.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
lmjabreu
marked this pull request as ready for review
October 1, 2026 19:07
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.
Overview
@doist/comms-sdk3.3.0 now exportsisNotFound,isConflict,isMalformedId,getCommsErrorCodeandgetCommsErrorString, which #66 had to write locally. This deletes our copies and imports the SDK's.Reference
Follows @scottlovegrove's review on #66 and Doist/comms-sdk-typescript#83. The 401 and 403 helpers stay here:
isForbiddenmeans "a 403 that is not a scope failure", which is our policy rather than a property of the response.The SDK helpers check
instanceof CommsRequestError, asstatus.tsalready does, where ours accepted any object with anhttpStatusCode. Nothing in the CLI passes one that isn't an instance.The bump from 3.0.0 also picks up 3.1.0 and 3.2.0 (thread image reads, retry back-off, a clearer message when a request fails at the network layer), and moves
undicito 7.30.0 with it.Changelog
Internal only. Error messages for 404, malformed ids and other 409s are unchanged.
Test plan
tdc thread view id:nopeError: INVALID_REFwith the server's message, no stack tracetdc thread view id:<a well-formed id that does not exist>Error: NOT_FOUNDtdc thread view id:<a thread you can see>🤖 Generated with Claude Code