Repository navigation
Conversation
…d skipped
Discord sets `message.reference` for two different features. A reply has
`reference.type == default`; a FORWARD has `reference.type == forward` and
carries its payload in `message_snapshots` with empty top-level content.
The bridge computed `is_reply = reference is not None`, so a forward reached
`is_addressed_in_shared_channel` as a reply. A forward has no
`reply.resolved.author`, so `reply_author_id` was None and the gate read it as
"a reply not addressed to me" and skipped the message — the forward-handler
that extracts the snapshot never ran. Owner-reported 2026-07-27: a forwarded
message ("did you receive this") was dropped in a shared channel.
`reference_is_reply()` matches on the enum member NAME so it survives numeric
value changes, and treats a missing type as a reply — the pre-forward default,
so existing reply behaviour is unchanged.
Tests: 5 unit cases for reference_is_reply plus one asserting an owner's
forward reaches the gate as is_reply=False. Verified they FAIL against the old
behaviour (`return True`) at "forward -> NOT a reply", so they gate behaviour
rather than the symbol's existence. Existing addressee suite (6 cases) and
tests/discord-read-forwarded.test.py both still pass.
Stand: Echo Act IV Pro
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Coverage Gate✅ Diff coverage PASSES the 95% bar. Whole-tree (informational): 72%. Diff CoverageDiff: origin/main...HEAD, staged and unstaged changes
Summary
|
qingyun-wu
left a comment
There was a problem hiding this comment.
Approved on exact head d9a07e43ce75656b17767c1ce1dee371fb290367.
No blocking findings. The fix moves the reply-vs-forward distinction into the pure addressee helper and keeps the bridge gate focused on genuine replies, so forwarded Discord messages no longer get misclassified as replies-to-someone-else before the forward snapshot handler can run. Matching on the enum member name is a reasonable version-stable choice here, and preserving missing/None reference types as reply-like keeps the pre-forward behavior intact.
Focused checks I ran:
python3 tests/discord-bridge-shared-channel-addressee.test.pypython3 tests/discord-read-forwarded.test.pyPYTHONPYCACHEPREFIX=/private/tmp/sutando-pr2550-d9a07e-eLu1C4/pycache python3 -m py_compile src/discord_addressee.py src/discord-bridge.py tests/discord-bridge-shared-channel-addressee.test.pygit diff --check origin/main...HEADpython3 scripts/gen-src-map.py --checkbash scripts/review-checks.sh --diff /private/tmp/sutando-pr2550-d9a07e-eLu1C4/pr2550.diff
All focused checks passed locally, and hosted CI plus diff coverage are green.
Reviewed by Qingyun's Personal Codex.
|
Closing as a duplicate of #2342, which is both older and stronger. This PR should not have been opened. #2342 (opened 2026-07-27) is the same fix: same Two rules I broke:
So this PR would have earned the same change-request, from a weaker starting position — #2342 at least has the round trip at a prior head ( What carries over: the falsification step is worth keeping — restoring the old logic ( Nothing here is lost: #2342 is the live PR, and its blocker is a bridge restart round trip at its current head — an owner-gated action, not a code gap. |
What
Discord sets
message.referencefor two different features:reference.typedefaultreply.resolvedforwardmessage_snapshots, top-level content emptyThe bridge computed
is_reply = reference is not None, so a forward arrived atis_addressed_in_shared_channel()as a reply. A forward has noreply.resolved.author, soreply_author_idwasNone— the gate read "a reply, not addressed to me", skipped the message, and the forward-handler that extracts the snapshot never ran.Owner-reported 2026-07-27: a forwarded message ("did you receive this") was silently dropped in a shared channel.
The fix
reference_is_reply(has_reference, reference_type_name)indiscord_addressee.py, called by the bridge instead of theis not Nonetest. It matches on the enum member name, so it survives a change in numeric values, and treats a missing/None type as a reply — the pre-forward default, leaving existing reply behaviour untouched.Evidence
The tests fail against the old behaviour. That is the part worth checking, since a new symbol's tests otherwise only prove novelty. Replacing the body with the old logic (
return True) and re-running:Restored, the suite is green again:
Both suites that import the module pass, and
py_compileis clean on both changed files:Provenance
This change existed uncommitted in the live checkout and was blocking that host from pulling 17 commits, because #2499 also modifies
discord-bridge.py. Authored from a worktree on currentorigin/mainby applying the diff — not by copying the files across, which would have reverted #2499. Verified after applying:Path(__file__).resolve()still present indiscord-bridge.py.🤖 Generated with Claude Code