Repository navigation
fix: messages sent to another chat are missing from that chat's model history - #182329
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 real behavior proof before merge. What this changesThe PR consolidates confirmed outbound messages into model-visible destination history while skipping the producing conversation. Example: An automation sends “Inventory: 6 blue folders” from Telegram topic 7 to topic 42.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 5 items remain Keep this PR open: it addresses a confirmed history defect, but duplicate Gateway recording and unguarded Google Chat discovery need repair. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherChannel delivery accepts outbound payloads and receipts; the new shared recorder resolves their destination and appends through the existing background-result transcript writer. flowchart TD
A[Message tools and automation] --> B[Outbound delivery]
B --> C[Channel transport]
C --> D[Confirmed delivery]
D --> E[Destination recorder]
E --> F[Background result writer]
F --> G[Conversation transcript]
G --> H[Next model request]
Technical reviewBest possible solution: Keep recording with the actual delivery owner, remove duplicate caller recording, and carry live discovery authority through Google Chat’s existing HTTP boundary. Do we have a high-confidence way to reproduce the issue? Current-main mirror production and replay exclusion establish the reported defect; source tracing establishes the introduced paths, without executing target code. Is this the best way to solve the issue? The shared destination writer is appropriate, but the cutover retains duplicate Gateway recording and does not complete Google Chat’s discovery-authority handoff. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d2425ddc44cd. Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Google Chat’s new post-send discovery path does not enforce the supplied live-authority callback. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes:
Label justifications:
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 Reviewed October 24, 2026, 3:15 AM ET / 07:15 UTC. |
3496367 to
d349962
Compare
d349962 to
3b1e746
Compare
Isolated real-Gateway proofSetup: QA Lab on a fresh AWS Crabbox lease. Each scenario starts a real Gateway child with the QA channel and a mock OpenAI model. No operator Gateway or live credentials are used.
New scenario
Existing delivery scenarios (pass)
Scenarios that fail on main too
Fixes the proof and review found (included in this head)
|
d646a71 to
0a20447
Compare
… plugin extraction (#173557) ## What Problem This Solves Skill Workshop is moving from core into a bundled, enabled-by-default plugin (#173605). Its current tests mostly call Workshop internals directly, so they can't show that behavior stays the same after the code moves. ## User Impact None. This PR adds tests only: no production changes. ## Why This Change Was Made These are characterization tests: each one pins the behavior an operator sees today at the entry point they use. They import only modules that stay in core after the move (the agent tool set, the Gateway dispatcher, the CLI program, the command pipeline, the skills loader, Doctor, Gateway maintenance, the Gateway server, and the Control UI app), never Workshop modules. The same files are meant to pass unchanged before and after the cutover. Refreshed on current `main`. Updated to intended changes since the first draft: - The CLI archive hint now names `--agent`. - The tool has `draft` and `discard`. - Doctor exports retired proposals to `.drafts/`, and moves earlier `.archive/.retired-proposals/` exports there too. - Background reviews call `skill_workshop` directly, without Tool Search (#173889). - Channel notices carry the Learned marker (#182329). - The `/learn` tests now pin how the request reaches the agent, not the full prompt wording, which Workshop owns. New contracts: - **Propose mode and drafts:** a review in `propose` mode can only save drafts and cannot discard them; the foreground lists, views and discards drafts (tool). `skills.workshop.list`/`read` return on-disk drafts for `operator.read`; `applyDraft` and `discardDraft` are `operator.admin` only, and apply refuses a mismatched skill name (RPC). A real-Gateway review in `propose` mode saves one draft, changes no skill and posts no notice (e2e). The Control UI shows drafts as a diff against the live skill and sends `applyDraft`/`discardDraft` (UI e2e). - **`/learn drafts`:** with no drafts it answers without a model turn; otherwise it rewrites the turn over the selected drafts, narrowed by skill name, with the focus text. - **`/learn` and memory plugins:** with a selected memory plugin's learning tools, one turn routes to both skills and memory; with `skill_workshop` denied it learns into memory alone; with both denied it replies with the combined refusal. - **Review timing and admission:** the 30-second quiet period and the recheck of current config and tool policy when a review becomes due are timer contracts. They are covered with a controlled clock in the scheduler and review unit tests, which move with the Workshop code. The real-Gateway e2e checks only effects, and waits for the review's Gateway root work to settle before it asserts that nothing changed. - **Daily maintenance:** an oversized, settled learned skill is dieted as one `curator` change that `restore` undoes. Unused-skill cleanup does not run in `propose` mode or when tool policy denies `skill_workshop`. ## Evidence Local runs on this branch (the Gateway e2e and unit tests after merging `main` at `e125921a28ebb`): | Area | Result | | --- | --- | | Tool, RPC, CLI, `/learn`, config, Doctor, skill loading, maintenance (10 files) | 64 tests pass | | Real-Gateway review (e2e file) | 9 pass | | Scheduler and review unit tests (controlled clock) | all pass; the 2 new tests fail when the quiet-period restart or the due-time config read is removed | | Control UI (app e2e) | 5 pass | `pnpm tsgo:core:test`, oxfmt, type-aware oxlint and `git diff --check` pass on the changed files. Merge danger: two-way door. Blast radius: tests only. Tracking issue: #173605 Co-authored-by: Ayaan Zaidi <[email protected]>
… plugin extraction (openclaw#173557) ## What Problem This Solves Skill Workshop is moving from core into a bundled, enabled-by-default plugin (openclaw#173605). Its current tests mostly call Workshop internals directly, so they can't show that behavior stays the same after the code moves. ## User Impact None. This PR adds tests only: no production changes. ## Why This Change Was Made These are characterization tests: each one pins the behavior an operator sees today at the entry point they use. They import only modules that stay in core after the move (the agent tool set, the Gateway dispatcher, the CLI program, the command pipeline, the skills loader, Doctor, Gateway maintenance, the Gateway server, and the Control UI app), never Workshop modules. The same files are meant to pass unchanged before and after the cutover. Refreshed on current `main`. Updated to intended changes since the first draft: - The CLI archive hint now names `--agent`. - The tool has `draft` and `discard`. - Doctor exports retired proposals to `.drafts/`, and moves earlier `.archive/.retired-proposals/` exports there too. - Background reviews call `skill_workshop` directly, without Tool Search (openclaw#173889). - Channel notices carry the Learned marker (openclaw#182329). - The `/learn` tests now pin how the request reaches the agent, not the full prompt wording, which Workshop owns. New contracts: - **Propose mode and drafts:** a review in `propose` mode can only save drafts and cannot discard them; the foreground lists, views and discards drafts (tool). `skills.workshop.list`/`read` return on-disk drafts for `operator.read`; `applyDraft` and `discardDraft` are `operator.admin` only, and apply refuses a mismatched skill name (RPC). A real-Gateway review in `propose` mode saves one draft, changes no skill and posts no notice (e2e). The Control UI shows drafts as a diff against the live skill and sends `applyDraft`/`discardDraft` (UI e2e). - **`/learn drafts`:** with no drafts it answers without a model turn; otherwise it rewrites the turn over the selected drafts, narrowed by skill name, with the focus text. - **`/learn` and memory plugins:** with a selected memory plugin's learning tools, one turn routes to both skills and memory; with `skill_workshop` denied it learns into memory alone; with both denied it replies with the combined refusal. - **Review timing and admission:** the 30-second quiet period and the recheck of current config and tool policy when a review becomes due are timer contracts. They are covered with a controlled clock in the scheduler and review unit tests, which move with the Workshop code. The real-Gateway e2e checks only effects, and waits for the review's Gateway root work to settle before it asserts that nothing changed. - **Daily maintenance:** an oversized, settled learned skill is dieted as one `curator` change that `restore` undoes. Unused-skill cleanup does not run in `propose` mode or when tool policy denies `skill_workshop`. ## Evidence Local runs on this branch (the Gateway e2e and unit tests after merging `main` at `2592002ce0ede`): | Area | Result | | --- | --- | | Tool, RPC, CLI, `/learn`, config, Doctor, skill loading, maintenance (10 files) | 64 tests pass | | Real-Gateway review (e2e file) | 9 pass | | Scheduler and review unit tests (controlled clock) | all pass; the 2 new tests fail when the quiet-period restart or the due-time config read is removed | | Control UI (app e2e) | 5 pass | `pnpm tsgo:core:test`, oxfmt, type-aware oxlint and `git diff --check` pass on the changed files. Merge danger: two-way door. Blast radius: tests only. Tracking issue: openclaw#173605 Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #168683
Closes #168684
Rebuild of #169438 by @obviyus on current main. It keeps his design and his conversation transcript ownership ADR, and it credits him as co-author.
What Problem This Solves
Fixes: some messages a chat shows are missing from that chat's model history. Messages sent to another chat through the
messagetool were stored as transcript-only mirrors. Cron failure alerts were not recorded anywhere. Each outbound path also had its own transcript writer.User Impact
User impact: messages sent to another chat now enter that chat's model history once. This covers cross-chat message-tool sends, cron results and failure alerts, routed replies, subagent completions, Workshop notices and Gateway-executed plugin sends. A follow-up such as "what did you just send here?" can now see the message. Normal replies and same-chat sends do not gain a second row. There is no configuration, schema or stored-queue change.
The Plugin SDK
mirrorinput is still accepted until the next SDK major. Using it logs one deprecation warning, and it no longer selects where history is written.session.keynow names the conversation whose turn produced the send. A sender with no producing turn should pass the destination aspolicyKey; the migration guide documents this.Why This Change Was Made
This is step 2 of
docs/refactor/conversation-transcript-ownership.md. The outbound send owner records each confirmed payload throughsrc/sessions/confirmed-visible-message.ts. That module resolves the destination from the carried route, then the producer's delivery context, then an exact current local binding, and finally the channel resolver. It skips the producing conversation, cross-agent destinations, ambiguous destinations and native-only payloads, recording a diagnostic where useful. It writes through the existing background-result commit, which uses main's newerallow-livepolicy (#181506), so recording never waits for the destination's active turn. If recording fails after a send, it logs a warning and never resends.Differences from #169438:
commitBackgroundResultToSessionkeeps main's text API. Payload and media preparation moved tosrc/sessions/background-result-payloads.ts.openclawAutomationcron provenance.subagent-completion. The existing out-of-turn and prior-delivery checks recognize them.Evidence
pnpm tsgo:coreandpnpm tsgo:core:testpass on this head.oxlintreports no errors in the changed files.mirrorthat cannot redirect historycross-conversation-send-history, has a message-tool send from one room into another. The receiving room gets exactly one history row and the sending room gets none. The receiving room's next model request replays that row once as assistant history. The same scenario fails on main, where no row is recorded. The proof comment has the Crabbox run details.session.keynames the destination would silently lose rows. I addressed it with migration-guide and type documentation.