openclaw - 💡(How to fix) Fix [Feature Request] 临时会话任务完成后自动从会话栏隐藏 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60793Fetched 2026-04-08 02:47:08
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1locked ×1

Code Example

{
  sessions: {
    ephemeralAutoCleanup: true,
    ephemeralAutoCleanupDelay: 5000,
  }
}

---

{
  "deleteAfterRun": true
}
RAW_BUFFERClick to expand / collapse

问题

当使用 sessions_spawncron 配置 sessionTarget: "isolated" 时,临时子任务会话在任务完成后依然显示在控制台的会话栏中,占用空间且对用户没有实际意义。

期望行为

希望孤立会话(isolated session)在任务完成后能自动从会话栏中移除,或者提供配置选项:

{
  sessions: {
    ephemeralAutoCleanup: true,
    ephemeralAutoCleanupDelay: 5000,
  }
}

或者在 cron 任务中增加一个标记:

{
  "deleteAfterRun": true
}

使用场景

  • 每日定时任务(如日报、监控推送)完成并发送结果后,应该从会话栏消失
  • sessions_spawn 的后台任务在交付结果后应该可从 UI 移除
  • 频繁使用自动化任务的用户会积累大量已完成的临时会话

目前可行的替代方案

  • openclaw sessions cleanup — 非自动,需要手动触发
  • 会话过期机制(idle 超时 / 每天 4:00 重置)— 太慢
  • /new 命令 — 只能创建新会话,无法删除旧会话

补充说明

此需求涉及:

  • sessionTarget: "isolated" 的 cron 任务
  • sessions_spawn 发起的后台/孤立会话
  • 任何临时委托(delegate)会话

extent analysis

TL;DR

配置 ephemeralAutoCleanupephemeralAutoCleanupDelay 选项或添加 deleteAfterRun 标记可能可以解决临时子任务会话在任务完成后仍然显示在控制台的会话栏中的问题。

Guidance

  • 检查当前的 sessions 配置,确定是否已经启用了 ephemeralAutoCleanup 选项,如果没有,考虑添加此选项并设置 ephemeralAutoCleanupDelay 以控制自动清理的延迟时间。
  • 在 cron 任务中添加 deleteAfterRun 标记,特别是对于那些不需要保留会话记录的任务。
  • 评估使用 openclaw sessions cleanup 命令作为临时解决方案的可行性,尽管它需要手动触发。
  • 考虑优化会话过期机制的设置,以减少已完成会话在会话栏中停留的时间。

Example

{
  sessions: {
    ephemeralAutoCleanup: true,
    ephemeralAutoCleanupDelay: 5000,
  }
}

{
  "deleteAfterRun": true
}

Notes

此解决方案假设 ephemeralAutoCleanupdeleteAfterRun 选项已经被支持,且能够正常工作。实际效果可能因系统配置和版本而异。

Recommendation

Apply workaround:配置 ephemeralAutoCleanupephemeralAutoCleanupDelay 选项或添加 deleteAfterRun 标记,因为这些方法提供了灵活的控制方式来管理临时会话的清理。

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature Request] 临时会话任务完成后自动从会话栏隐藏 [1 participants]