Fix media delivery identity accounting#93090
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the useful media identity-accounting change is already covered by the broader, open, clean, proof-positive accounting PR, while the live QQBot cron auto-TTS delivery fix is tracked separately. Canonical path: Close this branch and keep shared empty-identity accounting review on #79811; keep live QQBot cron auto-TTS delivery review on #92947. So I’m closing this here and keeping the remaining discussion on #79811, #92947, and #92826. Review detailsBest possible solution: Close this branch and keep shared empty-identity accounting review on #79811; keep live QQBot cron auto-TTS delivery review on #92947. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main can push a media adapter result with an empty messageId, making durable send see a non-empty result set. I did not run a live QQBot cron reproduction for this branch. Is this the best way to solve the issue? No, not as the best landing path. The patch is plausible for media-only accounting, but the broader open PR is the better canonical fix because it applies the same identity contract across sibling outbound result paths. Security review: Security review cleared: The diff only changes TypeScript delivery accounting and a colocated regression test; it does not touch dependencies, workflows, credentials, auth, secrets, or supply-chain execution. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 9ba6ed1d5cb8. |
Summary
Fixes #92816.
The shared media delivery path counted any adapter media result as delivered, even when the adapter returned no delivery identity. QQBot can return that shape when generated TTS media cannot be sent, which made cron report
deliveredeven though no platform message existed.This applies the same invariant the
sendPayloadpath already uses: adapter results without a message/chat/channel identity are suppressed, not mirrored, and do not emit a successfulmessage_senthook.Verification
pnpm install --frozen-lockfilenode scripts/run-vitest.mjs src/infra/outbound/deliver.test.tsgit diff --check