Repository navigation
Description
Summary
With session.resetByChannel.<channel> = { mode: "daily", atHour: N }, the session rolls over in place on the first incoming message after the boundary. That rollover runs inside the incoming turn, and the reset uses the preempt policy (activeRun: "abort", waitingInputs: "cancel"). The input that triggered the reset gets caught by that preemption: session init logs AsyncWorkScopeClosedError and AbortError for the run being admitted, and the turn fails before producing a reply (run-failed-before-reply).
Reproduction
- Configure a channel with
resetByChannel: { mode: "daily", atHour: <next hour> }. - Have an existing session whose
sessionStartedAtis before that boundary. - After the boundary, send one ordinary message.
- Observe:
- the reset row is written (reason
daily, same session id,firstKeptEntryId= the triggering message); - then the admitted run fails immediately with a closed work scope;
- the user gets no reply.
- the reset row is written (reason
Expected
The reset completes, and the triggering input runs normally in the fresh context, with one reset and one reply.
Suggested fix
In the in-line daily or idle rollover, exclude the admitted triggering input from the preempt set (don't cancel or abort it), and give it a work scope created after the reset commits. Preemption of other active runs and waiting inputs can stay as it is.
Workaround we use
A small timer runs the stock sessions.reset (with expectedSessionId) shortly after the boundary, for idle sessions only. The first real turn then finds an already-fresh session (sessionStartedAt after the boundary) and no in-line rollover happens. A reset before the boundary doesn't help, because the session still counts as stale.
Versions: seen on OpenClaw 2026.11.10. The reset still uses the same preempt policy (activeRun: "abort", waitingInputs: "cancel") in 2026.11.12.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Nov 29, 2026
Codex review: this still needs some work.
Summary
Keep open: this issue reports a lost reply on an official release and contradicts the documented automatic-reset behavior. Existing caller exclusions make the proposed cause uncertain, and no verified fix or duplicate covers the reported closed-scope failure.
Reproducibility: No runtime reproduction was attempted; the report gives a concrete reset-boundary scenario, but current source contains caller exclusions and does not establish which owner closes the triggering turn's scope.
Next step
Establish a failing full-dispatch regression after the daily boundary and identify which owner closes the triggering turn's work scope despite the existing caller exclusions.
Review details
Best possible solution:
Keep the triggering message under valid existing ownership through automatic rollover while preserving cancellation of competing work.
Do we have a high-confidence way to reproduce the issue?
No runtime reproduction was attempted; the report gives a concrete reset-boundary scenario, but current source contains caller exclusions and does not establish which owner closes the triggering turn's scope.
Is this the best way to solve the issue?
The requested behavior matches the documented contract, but the suggested exclusion and replacement scope need a failing full-dispatch regression before they can be judged the correct repair.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against ae3cda6ba3a9.
Label changes
Label changes:
clawsweeper:needs-info: Current issue advisory state selects this label.Label justifications:
P1: The report describes a recurring ordinary channel turn receiving no reply after a configured daily boundary on an official release.impact:message-loss: The incoming message that triggers rollover reportedly fails before its reply is delivered.Evidence reviewed
Acceptance criteria:
What I checked:
docs/concepts/session.md:285, ae3cda6ba3a9)src/sessions/session-controller.lifecycle.ts:290, ae3cda6ba3a9)src/sessions/session-controller.mailbox-cleanup.ts:43, ae3cda6ba3a9)src/auto-reply/reply/dispatch-from-config.lifecycle.ts:189, 8bd1e73f90c0)src/auto-reply/reply/session.test.ts:855, ae3cda6ba3a9)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 29, 2026, 12:54 PM ET / 17:54 UTC.
daniel-lxs commentedon Nov 29, 2026
I couldn't reproduce this. Can you share one redacted failing turn with the channel or connector it came in on, your reset settings and Gateway timezone, and your build, model and runtime?
Include the reset row with the transcript entries around it, plus the first AsyncWorkScopeClosedError.
fix(gateway): keep channel turns working after an account-scheduled r…
fix(gateway): keep channel turns working after an account-scheduled r…
fix(gateway): keep channel turns working after an account-scheduled r…