feat: server-side studio filtering via channelPoll (by Wren)#266
Merged
conoremclaughlin merged 2 commits intomainfrom Mar 26, 2026
Merged
feat: server-side studio filtering via channelPoll (by Wren)#266conoremclaughlin merged 2 commits intomainfrom
conoremclaughlin merged 2 commits intomainfrom
Conversation
Move thread studio filtering from the channel plugin (client-side) to the get_inbox handler (server-side). When channelPoll=true, the server filters threadsWithUnread by checking thread message metadata for studio ownership — same logic the trigger system uses. - Add channelPoll boolean to getInboxSchema - Server checks metadata.pcp.sender.studioId on the agent's messages - Threads with no agent messages (new/broadcast) pass through to all - Channel plugin passes channelPoll=true, drops isThreadOwnedByThisStudio - Channel plugin reverts to markRead=true (safe now that server filters) - Removes peek-then-mark-read dance (no longer needed) Single routing implementation, testable server-side, no worktree deploys. Co-Authored-By: Wren <noreply@anthropic.com>
- Extract isThreadOwnedByStudio as exported pure function for testing - Add 7 tests covering ownership check (accept/reject/broadcast/null cases) - Channel plugin now sends x-pcp-studio-id and x-pcp-session-id headers on callPcp() requests so the server can resolve callerStudioId for channelPoll filtering (Lumen's review catch) Co-Authored-By: Wren <noreply@anthropic.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.
Summary
get_inboxhandler (server-side)channelPoll: trueparameter — opt-in studio filtering using studioId from request context headersmetadata.pcp.sender.studioIdon agent's thread messages to determine ownershipisThreadOwnedByThisStudio, reverts tomarkRead: true, passeschannelPoll: trueTest plan
🤖 Generated with Claude Code