fix(discord): preserve text after oversized uploads#99577
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 6:21 PM ET / 22:21 UTC. Summary PR surface: Source +52, Tests +45. Total +97 across 2 files. Reproducibility: yes. at source level: current main sends caption text and the file in one multipart Discord request, and the linked issue has production HTTP 413 logs for that failure class. I did not run a live Discord upload in this read-only review. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Land one canonical Discord-owned 413 fallback that preserves visible text, records text-only stripped-media delivery accurately, includes redacted live Discord proof, and closes duplicate candidates after merge. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main sends caption text and the file in one multipart Discord request, and the linked issue has production HTTP 413 logs for that failure class. I did not run a live Discord upload in this read-only review. Is this the best way to solve the issue? No, not yet. The Discord send-boundary fallback is the right owner area, but the PR needs accurate text or stripped-media receipt semantics and real Discord proof before it is the best merge path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c40f5e068387. Label changesLabel justifications:
Evidence reviewedPR surface: Source +52, Tests +45. Total +97 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles)
|
46e22f6 to
bb1375b
Compare
Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com>
4c1df04 to
5c4d645
Compare
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <steipete@gmail.com> Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com> Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com>
Closes #99021
What Problem This Solves
Discord sends captions and attachments in one multipart request. When Discord rejects an oversized upload, the caption is rejected with it, leaving a completed OpenClaw delivery with no visible Discord message.
Why This Change Was Made
Discord upload limits vary by guild/account, so the fix stays at the last-mile send boundary instead of hard-coding a size cap. It recognizes Discord API error
40005and HTTP413, then routes the original text through the canonical text sender with a visible skipped-attachment note. The fallback deliberately omits attachment-coupled embeds and components; unrelated failures still propagate.User Impact
Text remains visible when Discord rejects an oversized attachment. Media-only sends receive an explicit skipped-attachment notice instead of silently disappearing. Reply references, text chunking, silent delivery, embed suppression, delivery receipts, and callbacks continue through the existing text path.
Evidence
pnpm check:changedpassed, including extension typechecks, lint, import-cycle checks, and repository guards.40005, and observed exactly one text fallback with the original text, reply reference, no files, and the fallback message ID.git diff --check: passed.No external Discord channel was mutated by the live proof; the target was an isolated HTTP boundary using Discord's documented error contract.