Repository navigation
fix(discord): honor persona text limits and preserve reply receipts - #144629
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 11:43 PM ET / September 11, 2026, 03:43 UTC. ClawSweeper reviewWhat this changesMakes Discord thread-persona replies honor caller-supplied character limits after formatting and mention expansion, and preserves each chunk’s reply target in delivery receipts. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still lacks both repairs. The patch follows the existing sender and receipt contracts, and no blocking correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s Discord plugin turns agent replies into bot messages or thread-persona webhook messages. Its senders format and split outgoing text, then return delivery receipts to shared delivery tracking. flowchart TD
A[Agent reply and caller limits] --> B[Discord outbound adapter]
B --> C[Bot sender]
B --> D[Thread persona webhook sender]
C --> E[Shared formatting and mention expansion]
D --> E
E --> F[Sender character and line limits]
F --> G[Discord HTTP delivery]
G --> H[Per-chunk receipts and progress]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +55, Docs +2. Total +64 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep final text limits with Discord’s senders and record each physical chunk’s selected reply target through the existing receipt owner. Do we have a high-confidence way to reproduce the issue? Yes, from source: expand thirty mention aliases under a 500-character caller cap, or inspect receipts for chunked webhook replies. Current main omits the cap and passes a receipt property the constructor does not consume; no runtime reproduction was executed here. Is this the best way to solve the issue? Yes. The patch repairs the existing adapter-to-sender handoff and uses the canonical receipt contract, preserving defaults and avoiding another formatting or reply-policy owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ae94766f288b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where thread-bound Discord persona replies could exceed a caller's character limit after mention expansion, even though ordinary bot replies honored that limit. It also fixes missing reply-target metadata in the direct webhook delivery receipts and progress callbacks for chunked replies.
Why This Change Was Made
Both Discord transports now consume the character limit normalized by their existing shared text-preparation owner. The persona adapter forwards the caller's limit through to final webhook chunking, after formatting and mention expansion.
Webhook results now pass each physical chunk's reply reference to the canonical receipt constructor using its current contract. This replaces an ignored legacy property and preserves first-only, all-chunk, and absent reply scope in returned receipts and progress callbacks.
User Impact
Persona replies honor the caller's requested character cap after rendering, with the same normalization as bot replies. Their delivery receipts accurately retain the reply target selected for each chunk. Existing defaults, line limits, and requested webhook reply fields are preserved.
Evidence
Independent review completed two clean passes through P2 on the final source.
Transport proof uses synthetic loopback HTTP servers. It verifies requested webhook fields and receipt metadata; it does not establish whether Discord applies the existing webhook reply-reference field. No live Discord or Gateway send was run.