Repository navigation
fix: retain Discord native commands in conversation history - #169200
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. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR retains delivered Discord native command replies and model-picker interactions in conversation history. Example: A Discord native plugin reply contains a Section with text “Actions” and an accessory button labeled “Read”.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a concrete gap still present on main, and the previously reported capture and fixture defects are repaired; no remaining discrete correctness finding was identified. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherDiscord’s native interaction adapters receive commands and component clicks, deliver replies through Discord, then pass visible text and the target session to the existing shared transcript recorder for later history and model requests. flowchart TD
A[Discord command or picker click] --> B[Native interaction adapter]
B --> C[Discord reply delivery]
C --> D[Visible delivered text]
D --> E[Shared command recorder]
E --> F[Session transcript]
F --> G[History and later model requests]
Technical reviewBest possible solution: Retain the focused Discord adapters using the existing post-delivery recorder and preserve transport visibility, redaction, and session targeting. Do we have a high-confidence way to reproduce the issue? Current main’s direct native status, menu, picker, and plugin paths omit transcript capture; source establishes the failure path, while the reported negative controls support the adapter regressions. Is this the best way to solve the issue? The patch uses the established capture owner at successful delivery boundaries and preserves the intentional direct status path instead of forcing native replies through a competing dispatcher. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ca71d282519b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +156, Tests +138, Docs +1. Total +295 across 14 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 11, 2026, 12:44 PM ET / 16:44 UTC (Revision 5). |
|
@clawsweeper re-review: e5d5c64 fixes delivered Components V2/embed capture and preserves mock exports. The assertion and mock-export ratchets pass; 93 focused Discord tests pass, including four delivery regressions that failed before the representation repair. The body records the real gpt-5-mini text-command proof and the manual-only native interaction gap. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 62fbdc1. Discord native command replies are now part of the conversation the agent sees. |
Mattermost native /model and /models replies and model-picker refreshes were visible to the user but never recorded, so the agent could not see them on later turns. This routes them through the shared command-exchange capture owner from #169026 after confirmed delivery, using worker-owned async session reads (including the derived-parent model). The selection confirmation and the picker refresh now share one command identity, so a selection is recorded once. The command identity helper moved into the command-transcript owner, so core and plugins use the same scoping. Proof is test-only, since there is no Mattermost live harness: 16 registered-handler cases fail on main and pass here, plus a persistence test with one user command and two assistant replies. This completes the slash-command parity work after #169026 (core and Telegram), #169200 (Discord) and #169236 (Slack). Co-authored-by: Ayaan Zaidi <[email protected]>
Native Discord status replies are recorded after delivery (#169200), which advances the session activity timestamp. Keep exact equality for every owner and lifecycle field, while requiring nondecreasing activity across both status reads. Retain the runtime-effect and dispatch assertions.
…#169200) Discord command replies sent directly through native paths (the status reply, argument menus, model picker opening, updates and selections, and plugin-command replies) were visible to the user but never recorded, so the agent could not see them on later turns. openclaw#169026 added the shared command-exchange capture owner for core dispatch and Telegram. This PR routes Discord's native direct sends through the same owner after confirmed delivery. The captured text is what the user saw, including Components V2, embed and Section.accessory labels, with no custom IDs. Redaction and conversation-scoped identities come from the owner. Real Discord proof via QA Lab with gpt-5-mini: /status sent as text, then a follow-up that the model answered from the status reply; the next provider request and chat.history contain both the command and the reply. Native slash interactions and component clicks need a human client, so they're covered by registered-entry-point regressions. Slack and Mattermost native paths follow in a separate PR. Co-authored-by: Ayaan Zaidi <[email protected]>
…w#169255) Mattermost native /model and /models replies and model-picker refreshes were visible to the user but never recorded, so the agent could not see them on later turns. This routes them through the shared command-exchange capture owner from openclaw#169026 after confirmed delivery, using worker-owned async session reads (including the derived-parent model). The selection confirmation and the picker refresh now share one command identity, so a selection is recorded once. The command identity helper moved into the command-transcript owner, so core and plugins use the same scoping. Proof is test-only, since there is no Mattermost live harness: 16 registered-handler cases fail on main and pass here, plus a persistence test with one user command and two assistant replies. This completes the slash-command parity work after openclaw#169026 (core and Telegram), openclaw#169200 (Discord) and openclaw#169236 (Slack). Co-authored-by: Ayaan Zaidi <[email protected]>
Native Discord status replies are recorded after delivery (openclaw#169200), which advances the session activity timestamp. Keep exact equality for every owner and lifecycle field, while requiring nondecreasing activity across both status reads. Retain the runtime-effect and dispatch assertions.
What Problem This Solves
Fixes missing conversation history when Discord native commands send status, argument menus, model-picker updates, or plugin replies directly instead of through the shared dispatcher.
Follow-up to #169026. This PR is Discord-only; Slack and Mattermost native adapters are deferred.
User Impact
Discord users can refer back to delivered native command exchanges in later turns and chat history. Failed sends and the transient “Applying model change…” notice are not recorded. Command execution, authorization, reply visibility, and message delivery stay unchanged.
Why This Change Was Made
The native adapters now call the existing delivered-command recorder after successful delivery. That owner retains redaction, idempotency, and transcript persistence. Capture identities include the Discord account and conversation/session; bound model-picker and plugin commands retain their target session. Touched live session reads use the worker-owned async reader. Component capture retains visible labels and text, not interaction IDs or option values.
No new SDK export, database schema, dependency, or configuration option.
Evidence
/status, then asked for the version and build hash without supplying either value. The model answered: “OpenClaw 2026.9.9” and “d4ae04c”. (from /status). The command and delivered status reply were also observed inchat.history./statusand its assistant message includes the delivered status text.chat.historyretained both. This assertion examines raw provider message content, not the debug summary, which omits assistantoutput_text.Live gaps
Discord slash interactions, ephemeral replies, and component clicks require a manual user client and were not automated. Their native entry points are covered by the focused status, argument-menu, model-picker, and plugin-dispatch tests. The live
/statusproof uses a text command, not a fabricated slash interaction. No Slack or Mattermost behavior is claimed by this PR.Merge Risk
Two-way code change: reverting restores the old capture behavior, but does not delete exchanges already appended to conversation history. Blast radius is Discord native command transcript capture and its session reads; ordinary reply transport and other channels are unchanged.
Review fixes
The delivery owner now reports the representation it actually sent: Components V2 text instead of hidden legacy fallback text, and visible embed text where applicable. The recorder mocks preserve the module's other exports, and component traversal no longer adds a type assertion.
The five focused Discord suites pass 93 tests in 32.29s. Before the representation repair, the four added delivery assertions failed against the prior owner. Both the mock-export and assertion-safety ratchets pass, and the full build passed. These fixes are in
e5d5c640427613179bd04bb17e957972a9f6eb4a; the live text-command evidence above is from its parentd4ae04ce19d3b5840d7c629c2796b0de5cb1837d. A fresh hosted review and CI are required on the new head.Interaction fixture isolation
The interaction-boundary fixture now mocks only the delivered-command recorder, preserving the SDK module’s other exports, as the sibling native-command suites do. The production autocomplete and transcript code are unchanged, and the exact
test-modelassertion remains intact. Previously, a status interaction used the real persistence path, which initialized the global runtime config from the test environment; later autocomplete preferred that snapshot over the fixture config. This was fixture contamination, not a stored model override.The original fixture fails with
gpt-6-astrainstead oftest-model. With recorder isolation, the complete native-command selection passes three times: 122 tests across 10 files each, in 62.74s, 41.95s, and 43.37s total runner wall time.A discriminating control kept the real recorder and pinned the fixture config the way Gateway startup does: 12/12 passed, including an immediate status → autocomplete check on the same client and an assertion that recording preserved the runtime snapshot. This distinguishes missing fixture isolation from a production model-resolution change.
Section accessory capture
The late review finding is repaired at the component text traversal: native replies now retain a Section accessory’s visible button label while continuing to omit custom IDs. The existing Components V2 delivery regression now exercises a Section with text
Actionsand button labelRead; on the prior traversal it failed becauseReadwas missing.After the accessory repair, the complete native-command selection passes 122 tests across 10 files, three times (42.55s, 43.07s, 43.45s runner wall time), in the same secretless container. The pre-fix accessory control had 1 failure / 15 passes, failing specifically because the delivered
Readlabel was absent from capture.