Skip to content

[Bug]: Gateway hangs from session cleanup 2026.4.x #73924

Closed

Description

@keough99

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

After 2026.4.x the gateway hangs and session cleanup writes are spammed to console.
https://pastebin.com/jCc0pVHJ
https://pastebin.com/xTtva5XD
https://pastebin.com/3h6TbxGE
Disabling Active-Memory and Dreaming made a very slight improvement
Current version im using is 2026.4.26 Happening since atleast 2026.4.11 but worse after upgrading to 2026.4.26

Steps to reproduce

NOT_ENOUGH_INFO

Expected behavior

Gateway isnt supposed to hang with the session cleanup spam.

Actual behavior

gateway hangs with session cleanup in console while the gateway is hanging.

OpenClaw version

2026.4.26 (be8c246)

Operating system

Ubuntu Server 24.04 LTS

Install method

npm

Model

ollama/gemma4:31b-cloud openrouter/google/gemini-3.1-flash-lite-preview

Provider / routing chain

openclaw > openrouter > gemini or openclaw > ollama

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. clawsweeper commented on Apr 29, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

    Current main already removes the session-store rotation path that matches the reported v2026.4.26 log spam. The user-linked logs show repeated sessions/store sessions.json.bak.* backup/cleanup messages around a 15 MB store, and current main commit 490e6d6 removes rotateSessionFile, ignores legacy session.maintenance.rotateBytes, documents that behavior, and adds regression tests that hot oversized writes no longer create rotation backups. The fix is on main only; no release tag contains it yet.

    Best possible solution:

    Close this as implemented on current main, keep the 490e6d6 session-store maintenance behavior, and ship it in the next release. If a build containing that commit still hangs without sessions.json.bak.* spam, open a new focused bug with fresh logs and the remaining gateway timeout/provider/channel symptoms.

    What I checked:

    • Reporter log matches removed rotation path: The user-linked Pastebin log for v2026.4.26 shows repeated sessions/store messages backing up sessions.json.bak.* for a 15,330,788-byte session store, cleaning old backups, and then gateway connect timeouts. citeturn2view0.
    • Old release implemented noisy rotation: In v2026.4.26, rotateSessionFile copied oversized sessions.json to sessions.json.bak.<timestamp> and logged backed up session store file before rotation plus old-backup cleanup; saveSessionStoreUnlocked called it before disk-budget enforcement. (src/config/sessions/store-maintenance.ts:351, be8c24633aaa)
    • Current main removes rotation from runtime config: Current main's resolved session maintenance config no longer includes rotateBytes, and rg finds no live rotateSessionFile, backup-spam log strings, or default rotate-size constant in runtime source. (src/config/sessions/store-maintenance.ts:121, 7a88117f429c)
    • Regression tests cover hot oversized writes: Current tests explicitly save an oversized hot session store repeatedly with legacy rotateBytes configured and assert no sessions.json.bak.* files are created; a second test covers destructive maintenance rewrites. (src/config/sessions/store.pruning.integration.test.ts:580, 7a88117f429c)
    • Docs and doctor mark rotateBytes as ignored: Current docs say OpenClaw no longer creates automatic sessions.json.bak.* backups during Gateway writes, and the doctor legacy migration warns that session.maintenance.rotateBytes is deprecated and removes it with doctor --fix. Public docs: docs/reference/session-management-compaction.md. (docs/reference/session-management-compaction.md:84, 7a88117f429c)
    • Fix provenance: Commit 490e6d6 removed rotateSessionFile/rotateBytes from session maintenance, added no-backup regression tests, and updated session docs. Its commit timestamp is 2026-04-28T18:50:51-04:00. (src/config/sessions/store-maintenance.ts:1, 490e6d6dc590)

    Likely related people:

    • jinjim coriase@gmail.com: Authored commit 490e6d6, which removed session-store rotation backups, updated docs, and added the no-backup regression tests that now define the current behavior. (role: fixed current behavior; confidence: high; commits: 490e6d6dc590; files: src/config/sessions/store-maintenance.ts, src/config/sessions/store.ts, src/config/sessions/store.pruning.integration.test.ts)
    • sallyom: Commit 490e6d6 lists sallyom as co-author/reviewer for the change that removed the rotation backup path and documented the deprecated config key. (role: reviewer/co-author on current fix; confidence: medium; commits: 490e6d6dc590; files: src/config/sessions/store-maintenance.ts, src/config/sessions/store.pruning.integration.test.ts, docs/reference/session-management-compaction.md)
    • Peter Steinberger steipete@gmail.com: The v2026.4.26 tag and shallow blame for the old rotateSessionFile implementation attribute the shipped release snapshot containing the noisy backup path to Peter; this is routing context, not fault attribution. (role: release snapshot provenance; confidence: low; commits: be8c24633aaa; files: src/config/sessions/store-maintenance.ts, src/config/sessions/store.ts)

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 7a88117f429c; fix evidence: commit 490e6d6dc590, main fix timestamp 2026-04-28T18:50:51-04:00.

  2. locked as resolved and limited conversation to collaborators on May 1, 2026
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

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions