Skip to content

[Bug]: cron.remove does not clean up session records in sessions.json #46369

@15881266296-commits

Description

@15881266296-commits

Bug type

Regression (worked before, now fails)

Summary

When deleting a cron job via cron.remove, the session record remains in sessions.json, causing deleted jobs to still appear in the Control UI session dropdown.

Steps to reproduce

  1. Create a cron job via Control UI or cron.add
  2. Delete the cron job via Control UI or cron.remove
  3. Refresh the Control UI
  4. The deleted cron job still appears in the session dropdown list

Expected behavior

When a cron job is deleted, the following should be cleaned up:

  1. Cron configuration (currently working)
  2. ~/.openclaw/cron/runs/*.jsonl history files
  3. Session record in ~/.openclaw/agents/main/sessions/sessions.json

Actual behavior

Only the cron configuration is removed. The session record remains in sessions.json, causing the UI to display "ghost sessions" that cannot be accessed but still appear in the dropdown.

OpenClaw version

openclaw --version

Operating system

Linux (WSL2) - Ubuntu on Windows

Install method

npm global

Model

opus4.6

Provider / routing chain

openclaw

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions