Repository navigation
fix(session): preserve reset message payloads - #116195
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 3:14 AM ET / 07:14 UTC. ClawSweeper reviewWhat this changesThe branch introduces a shared reset-command parser so Merge readinessKeep this PR open for normal maintainer review. It addresses a real session-state regression with an owner-boundary fix shared by full and fast reply initialization, and its QA scenario supplies sufficient channel-visible behavior proof; exact-head CI still has active lanes and one Priority: P1 Review scores
Verification
How this fits togetherInbound channel text is finalized into command, agent, and raw projections before reply handling. The session layer decides whether a reset is authorized, rolls the session lifecycle when needed, and supplies the retained message text to the model and eventual channel reply. flowchart LR
A[Inbound channel message] --> B[Command, agent, and raw projections]
B --> C[Reset command parser]
C --> D[Session initialization]
D --> E[Lifecycle reset or continuation]
E --> F[Model prompt payload]
F --> G[Channel reply]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +235, Tests +457, Other +163. Total +855 across 14 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the shared session-owned parser only after the failing lint check is resolved and exact-head CI confirms both ordinary reset triggers and the safer no-guess projection cases remain compatible. Do we have a high-confidence way to reproduce the issue? Yes, source and the committed QA scenario define a high-signal path: send a multiline Is this the best way to solve the issue? Yes. A session-owned parser reused by normal and fast initialization is the narrowest maintainable fix because detection may use normalized command text while retained payload bytes must come from the current raw inbound projection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ba756a23ad43. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
5d4518e to
a6b808a
Compare
|
@clawsweeper re-run |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Use the raw command body when it directly matches a reset trigger so code, logs, bracketed text, and line breaks reach the new session intact. Keep structural normalization only for prefixed messages that require it to match.
a6b808a to
046a478
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer proof note before merge:
No ClawSweeper rank-up move is being skipped silently. |
|
Merged via squash.
|
* repair/pr-111802-preserve: (3263 commits) test: type session request parameters (openclaw#116713) fix: retain event invalidation for pagination docs: note queued session refresh fix fix: preserve queued session refresh options fix(exec): require approval for abbreviated inline eval flags [AI] (openclaw#116529) fix: keep owner-only tools out of non-owner skill commands [AI] (openclaw#116532) fix(ui): bound Talk relay microphone uplink fix(tui): require a fresh agent roster (openclaw#116715) fix(memory-wiki): preserve user edits when rolling back ChatGPT imports (openclaw#116517) fix(agents): cron failures preserve timeout and cancellation reasons (openclaw#116566) fix(release): unblock beta validation workflows (openclaw#116708) fix(ci): discover frozen target startup benchmark cases (openclaw#116711) fix(session): preserve reset message payloads (openclaw#116195) fix(qa): tolerate loaded-runner bus delivery stalls (openclaw#116448) improve(ci): rebalance embedded agent test configs (openclaw#116436) fix(browser): return committed trace path (openclaw#116702) fix(qa): exceed Slack table aggregate limit in fallback probe (openclaw#116447) fix(qa): use built plugin tools server (openclaw#116442) fix(test): keep memory FD repro config valid (openclaw#116698) fix(telegram): keep queued tool progress in one message (openclaw#116685) ...
* preserve/pr-109971-ollama-show-inspection-20260731: (4302 commits) fix(agents): resume interrupted turns past progress commentary (openclaw#116725) fix(gateway): sign device proofs with challenge time (openclaw#116679) fix(testing): load relay smoke through UI Vite config test(testing): guard realtime relay smoke module path fix(testing): repair realtime relay live smoke import test: type session request parameters (openclaw#116713) fix: retain event invalidation for pagination docs: note queued session refresh fix fix: preserve queued session refresh options fix(exec): require approval for abbreviated inline eval flags [AI] (openclaw#116529) fix: keep owner-only tools out of non-owner skill commands [AI] (openclaw#116532) fix(ui): bound Talk relay microphone uplink fix(tui): require a fresh agent roster (openclaw#116715) fix(memory-wiki): preserve user edits when rolling back ChatGPT imports (openclaw#116517) fix(agents): cron failures preserve timeout and cancellation reasons (openclaw#116566) fix(release): unblock beta validation workflows (openclaw#116708) fix(ci): discover frozen target startup benchmark cases (openclaw#116711) fix(session): preserve reset message payloads (openclaw#116195) fix(qa): tolerate loaded-runner bus delivery stalls (openclaw#116448) improve(ci): rebalance embedded agent test configs (openclaw#116436) ...
* preserve/pr-107473-ollama-stream-ndjson-cap: (5598 commits) chore(changelog): remove release-owned entry fix(agents): resume interrupted turns past progress commentary (openclaw#116725) fix(gateway): sign device proofs with challenge time (openclaw#116679) fix(testing): load relay smoke through UI Vite config test(testing): guard realtime relay smoke module path fix(testing): repair realtime relay live smoke import test: type session request parameters (openclaw#116713) fix: retain event invalidation for pagination docs: note queued session refresh fix fix: preserve queued session refresh options fix(exec): require approval for abbreviated inline eval flags [AI] (openclaw#116529) fix: keep owner-only tools out of non-owner skill commands [AI] (openclaw#116532) fix(ui): bound Talk relay microphone uplink fix(tui): require a fresh agent roster (openclaw#116715) fix(memory-wiki): preserve user edits when rolling back ChatGPT imports (openclaw#116517) fix(agents): cron failures preserve timeout and cancellation reasons (openclaw#116566) fix(release): unblock beta validation workflows (openclaw#116708) fix(ci): discover frozen target startup benchmark cases (openclaw#116711) fix(session): preserve reset message payloads (openclaw#116195) fix(qa): tolerate loaded-runner bus delivery stalls (openclaw#116448) ...
…-supported-paths * origin/main: (115 commits) test: type session request parameters (#116713) fix: retain event invalidation for pagination docs: note queued session refresh fix fix: preserve queued session refresh options fix(exec): require approval for abbreviated inline eval flags [AI] (#116529) fix: keep owner-only tools out of non-owner skill commands [AI] (#116532) fix(tui): require a fresh agent roster (#116715) fix(memory-wiki): preserve user edits when rolling back ChatGPT imports (#116517) fix(agents): cron failures preserve timeout and cancellation reasons (#116566) fix(release): unblock beta validation workflows (#116708) fix(ci): discover frozen target startup benchmark cases (#116711) fix(session): preserve reset message payloads (#116195) fix(qa): tolerate loaded-runner bus delivery stalls (#116448) improve(ci): rebalance embedded agent test configs (#116436) fix(browser): return committed trace path (#116702) fix(qa): exceed Slack table aggregate limit in fallback probe (#116447) fix(qa): use built plugin tools server (#116442) fix(test): keep memory FD repro config valid (#116698) fix(telegram): keep queued tool progress in one message (#116685) fix(qa): stop waiting on yielded fanout runs (#116440) ... # Conflicts: # src/system-agent/setup-inference-detect.ts # ui/src/e2e/model-setup.e2e.test.ts
* fix(session): preserve reset message payloads Use the raw command body when it directly matches a reset trigger so code, logs, bracketed text, and line breaks reach the new session intact. Keep structural normalization only for prefixed messages that require it to match. * fix(session): anchor reset payloads to original input * fix(session): anchor reset parsing to inbound projections * fix(session): keep reset result type internal * test(qa): prove reset payload preservation --------- Co-authored-by: Vincent Koc <[email protected]>
…-supported-paths * origin/main: (115 commits) test: type session request parameters (openclaw#116713) fix: retain event invalidation for pagination docs: note queued session refresh fix fix: preserve queued session refresh options fix(exec): require approval for abbreviated inline eval flags [AI] (openclaw#116529) fix: keep owner-only tools out of non-owner skill commands [AI] (openclaw#116532) fix(tui): require a fresh agent roster (openclaw#116715) fix(memory-wiki): preserve user edits when rolling back ChatGPT imports (openclaw#116517) fix(agents): cron failures preserve timeout and cancellation reasons (openclaw#116566) fix(release): unblock beta validation workflows (openclaw#116708) fix(ci): discover frozen target startup benchmark cases (openclaw#116711) fix(session): preserve reset message payloads (openclaw#116195) fix(qa): tolerate loaded-runner bus delivery stalls (openclaw#116448) improve(ci): rebalance embedded agent test configs (openclaw#116436) fix(browser): return committed trace path (openclaw#116702) fix(qa): exceed Slack table aggregate limit in fallback probe (openclaw#116447) fix(qa): use built plugin tools server (openclaw#116442) fix(test): keep memory FD repro config valid (openclaw#116698) fix(telegram): keep queued tool progress in one message (openclaw#116685) fix(qa): stop waiting on yielded fanout runs (openclaw#116440) ... # Conflicts: # src/system-agent/setup-inference-detect.ts # ui/src/e2e/model-setup.e2e.test.ts
What Problem This Solves
Fixes corruption of the message retained after
/new <message>,/reset <message>, or a configured reset trigger. Bracketed text, multiline code/logs, mention-wrapped commands, and structural channel wrappers now reach the reset session intact.Root Cause
Reset detection intentionally uses normalized projections that strip channel wrappers, mentions, bracketed metadata, and whitespace. The retained payload was then inferred from those lossy projections or marker-shaped history text, so detection normalization silently became a user-message transform.
Fix
initSessionStateremains the owner boundary: it detects explicit resets and constructssessionCtx.agentText, which becomes the model prompt body.Evidence
Final patched head:
e9cfc70e7cc332f6243335c3de620f52529103f8session.test.ts: 160 passed.get-reply.fast-path.test.ts: 26 passed.get-reply-directives.target-session.test.ts: 29 passed.get-reply-native-slash-fast-path.test.ts: 9 passed.abort.test.ts: 33 passed.mentions.test.ts: 24 passed.inbound-context.test.ts: 29 passed.pnpm build: passed.pnpm check: passed.git diff --check, and TruffleHog: passed.A separate pre-push full-suite Testbox lease produced no test verdict for 1h32m and exited
-1at the transport layer. It is not counted as proof. Hosted exact-head CI, including its full suite, is mandatory before merge.Real Behavior Proof
The committed
session-reset-payload-preservationQA scenario drives a real ephemeral Gateway child, the QA channel API, and the mock OpenAI provider. It seeds a direct channel session, sends this exact inbound turn, inspects the provider request, and waits for the visible channel reply:Final verdict:
{ "verdict": "PASS", "scenario": "session-reset-payload-preservation", "channel": "qa-channel", "provider": "mock-openai", "gateway": "ephemeral-child", "lifecycleReset": true, "durableSessionRetained": true, "payloadPreserved": true, "commandRemoved": true, "replyDelivered": true }The provider received the exact multiline payload once without the
/newprefix, the durable channel session retained its ID while its lifecycle revision reset, and the channel deliveredQA-RESET-PAYLOAD-OK. This satisfies the repository real-behavior gate for channel-visible changes. Deterministic Telegram dispatch-context coverage separately exercises the Telegram projection seam.