Skip to content

Daily session rollover preempts the very turn that triggers it: the first message after the reset hour aborts with no reply #208447

Backlog

Description

@itsnimbus

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

  1. Configure a channel with resetByChannel: { mode: "daily", atHour: <next hour> }.
  2. Have an existing session whose sessionStartedAt is before that boundary.
  3. After the boundary, send one ordinary message.
  4. 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.

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.

Activity

  1. added
    clawsweeper:intake:bug
    P1
    clawsweeper:needs-maintainer-review
    clawsweeper:no-new-fix-pr
    impact:message-loss
    issue-rating: 🦪 silver shellfish
    and removed
    clawsweeper:intake:bug
    on Nov 29, 2026
  2. clawsweeper commented on Nov 29, 2026

    @clawsweeper
    Contributor

    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:

    • The affected channel and complete closed-scope stack are missing, and the reported flow was not executed during this review.
    • Adding another caller exclusion or replacing the work scope before identifying its closing owner could leave the actual failure unresolved.

    Codex review notes: model internal, reasoning medium; reviewed against ae3cda6ba3a9.

    Label changes

    Label changes:

    • add 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:

    • A full-dispatch daily-boundary regression fails on the affected implementation and passes with the demonstrated repair.
    • The triggering message remains runnable, produces exactly one reply and causes exactly one reset.
    • Competing runs and queued inputs still follow existing cancellation and settlement policy.
    • Idle rollover and native /new and /reset retain their expected behavior.

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 29, 2026, 12:54 PM ET / 17:54 UTC.

  3. added
    clawsweeper:needs-info
    on Nov 29, 2026
  4. daniel-lxs commented on Nov 29, 2026

    @daniel-lxs
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1clawsweeper:needs-infoclawsweeper:needs-maintainer-reviewclawsweeper:no-new-fix-primpact:message-lossissue-rating: 🦪 silver shellfish

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions