Skip to content

fix(dm): a thread reply under a DM is a DM to the other participant - #44

Merged
khaliqgant merged 2 commits into
mainfrom
fix/dm-thread-reply
Nov 17, 2026
Merged

khaliqgant merged 2 commits into
mainfrom
fix/dm-thread-reply

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Problem

After a local agent DMs another (dm.send allowed), the recipient's answer via thread.reply on relaycast:message/<dm message id> was denied at stage mode, reason dm_message. Agent Relay clients (relay-node auto-answers, MCP reply) reply to DMs this way, so replies between local agents never arrived.

Fix

POST /v1/messages/:id/replies on a DM message:

  • the caller must be a participant (Relaycast's GET /v1/dm/<conversation>/messages answers participants only); otherwise deny, dm_reply_not_participant
  • the other participant is the message's author, or, when replying under your own message, the conversation's other author
  • decided exactly like POST /v1/dm to them: gateWrite on relaycast:inbox/<other> (mode, ACL, ceilings, classifier on cross-group), audited under that inbox id
  • forwarded upstream as before (from stripped, provenance stamped)

So local↔local is allowed; pit→local is still denied by the local inbox mode/ACL. Reactions under a DM stay refused. docs/contract.md route table updated. Independent of #43 (which makes cursor-…/claude-… inboxes resolvable); both are needed for Desktop agents.

Tests

test/relaycast.test.ts, "a thread reply under a DM is a DM to the other participant": local B replies to local A's DM → 201, forwarded, audited against A's inbox; A replies under its own message → B's inbox; non-participant local C → 403; pit replying to local A's DM → 403 (mode:660+acl:22:r); reactions under DM → 403. Typecheck + full suite green.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Thread replies under DMs now work as DMs to the other participant, allowing local agents to answer through POST /v1/messages/:id/replies.

  • The recipient comes from Relaycast’s 1:1 participant list, including when the sender follows up before the recipient replies.
  • Replies use the recipient’s inbox permissions and are forwarded with provenance; lookup failures are passed through.
  • Non-participants are denied (dm_reply_not_participant); reactions remain refused. docs/contract.md is updated.

Written for commit b323cde. Summary will update on new commits.

View guided diff Turn on auto-fix

Agent Relay clients (relay-node auto-answers, MCP reply) answer a DM with
POST /v1/messages/:id/replies, which relaygate refused as dm_message, so
replies between local agents never arrived. A participant's reply is now
decided exactly as POST /v1/dm to the other participant (w on their inbox,
classifier as usual) and forwarded with provenance. Non-participants are
refused (dm_reply_not_participant); reactions under a DM stay refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T09:27:43.053106Z 0b7a945 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment thread src/relaycast.ts Resolved
Comment thread src/relaycast.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b7a945a3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/relaycast.ts Resolved
Resolving the other participant from message authors failed when the
sender followed up before the recipient wrote anything. Use GET
/v1/dm/conversations (the caller's conversations, unpaged, with
participants) instead, and pass an upstream failure (429/5xx) back
rather than refusing the reply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@khaliqgant
khaliqgant merged commit 3e38008 into main Nov 17, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant