Conversation
Enterprise Grids that block client.counts can still serve unreads via a bounded client.dms + users.conversations path, with the same trigger for channel list --via-counts and later list. Co-Authored-By: Paperclip <noreply@paperclip.ing> Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Problem
On some Enterprise Grids
client.countsis blocked org-wide withteam_is_restricted. That is not a token-host mismatch: the same error is returned on both the org shell and the workspace host, with or withoutorg_wide_aware.agent-slack unreads(andchannel list --via-counts) then exit 1 even thoughclient.dms,users.conversations,conversations.info, andconversations.historystill work.What Changed
client.countsas the primary unreads path. Fall back only onteam_is_restricted.client.dmswithcount50 (most recently active conversations), thenconversations.info(last_read) compared to the latest message ts. Call volume is 1 + ≤50 info calls and does not sweep the full IM list.users.conversations(public/private, max 50, newestupdatedfirst when present), thenconversations.infoplusconversations.history.channel list --via-countsuses the same trigger and falls back tousers.conversations.later listuses the same trigger onsaved.listand falls back tosearch.messageswithis:saved.Verification
bun test— 412 pass, 0 fail. Newtest/unreads.test.tscovers theteam_is_restrictedtrigger, the counts-only DM bound, and the primaryclient.countspath. Channel and Later fallbacks are covered in their existing test files.bun run typecheck— clean.Risks
client.counts).is:savedcannot distinguish archived/completed states; those filters return empty items with a total count only.Made with Cursor