Skip to content

fix(defty): answer only in a 1:1 DM (FIX158 fallback, do not merge unless #629 slips) - #631

Draft
Maneek21 wants to merge 1 commit into
masterfrom
fix/158-defty-dm-only
Draft

Maneek21 wants to merge 1 commit into
masterfrom
fix/158-defty-dm-only

Conversation

@Maneek21

Copy link
Copy Markdown
Owner

Fallback only. Do not merge unless 158 ships without #629. This is option C for FIX158. Merge it only if the audience-aware fix (#629) isn't merged in time.

The defect: in a public room, Defty's threaded reply named a restricted task. The member and the guest who read it get 404 on the task itself. Defty reads with the asker's access, but answers to everyone who can read the conversation.

With this change, where anyone but the asker can read the conversation, Defty doesn't run. That covers a room, a thread in a room, a group DM and a DM between two people. It makes no reads and no action drafts, and replies once: "I can't answer here: other people can read this conversation, and my answer could include things not all of them can see. Ask me in a direct message."

  • Readers are the conversation's active members and, for an unarchived public room, every active non-guest workspace member. Defty never counts. An agent counts while its employee is active.
  • A followed thread turn stays silent, not "ask me in a DM" on every message.
  • A redelivered job posts once (the existing reply slot guard).
  • An unknown conversation counts as shared.
  • A 1:1 DM with Defty, or a room only the asker reads, answers as before.
  • What it removes: @defty answers in rooms, threads and group DMs. That means thread summaries, room Q&A, and "make a task from this thread".
  • Switch: DEFT_DEFTY_SHARED_ANSWERS=on restores answers in shared conversations, leak included. It is documented in .env.example. The API test runner sets it, so the existing reply suites keep testing Defty's room logic. defty-dm-only-db tests the stop-gap with it off.

Tests:

  • defty-dm-only-db covers rooms, group DM, DM with a person, a thread, a followed turn, redelivery, the switch, a 1:1 DM, a room only the asker reads, and a DM whose other person left. It passes locally.
  • 11 reply-suite files pass with the runner default (78 tests).
  • No local typecheck (laptop rule).

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

…ience

FIX158 fallback (option C), built to ship in 158 only if the
audience-aware fix (#629) is not ready. Defty reads with the asker's
access, so a reply in a public room named a restricted task that the
member and guest reading it get 404 on.

Now, where anyone but the asker can read the conversation, Defty runs
nothing (no reads, no action drafts) and replies once: "I can't answer
here: other people can read this conversation, and my answer could
include things not all of them can see. Ask me in a direct message."
Readers are the conversation's active members and, for an unarchived
public room, every active non-guest workspace member. Defty never
counts; an agent counts while its employee is active. A followed
thread turn stays silent, a redelivered job posts once, and an unknown
conversation counts as shared. A 1:1 DM, or a room only the asker
reads, answers as before.

DEFT_DEFTY_SHARED_ANSWERS=on restores answers in shared conversations.
The API test runner sets it so the reply suites keep testing Defty's
room logic; defty-dm-only-db tests the stop-gap with it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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