openclaw - ✅(Solved) Fix /status task line displays completed cron job output, flooding the status card [1 pull requests, 2 comments, 2 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#59877Fetched 2026-04-08 02:39:24
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×2cross-referenced ×1

/status in chat surfaces the full terminalSummary of completed background tasks (cron jobs), flooding the status card with content that was already delivered to the user independently.

Error Message

: latest.error?.trim() || latest.terminalSummary?.trim();

Root Cause

formatSessionTaskLine in commands-status-*.js (built from src/auto-reply/reply/commands-status.ts):

function formatSessionTaskLine(sessionKey) {
    const tasks = listTasksForSessionKey(sessionKey);
    if (tasks.length === 0) return;
    const latest = tasks[0];
    // ...
    const detail = latest.status === "running" || latest.status === "queued"
        ? latest.progressSummary?.trim()
        : latest.error?.trim() || latest.terminalSummary?.trim();
    // ...
}

The function lists ALL tasks associated with the session (via taskIdsByRelatedSessionKey), including completed isolated cron tasks. When the latest task is a finished cron job, it renders terminalSummary — the full task output — inline in the status card.

The causal chain:

  1. Isolated cron tasks set their ownerKey to the main session (correct — the main agent owns the cron)
  2. listTasksForSessionKey indexes by both ownerKey and childSessionKey, so completed cron tasks appear in the main session's task list
  3. formatSessionTaskLine picks the latest task regardless of status or runtime type
  4. For non-running tasks, it falls through to terminalSummary with no filtering or length limit

Fix Action

Fixed

PR fix notes

PR #59903: Status: hide completed task output

Description (problem / solution / changelog)

Issue: #59877

Summary:

  • Hide completed background task output from /status so the task line stays operational instead of replaying deliverables.
  • Keep active and recent failure task summaries intact.

Validation:

  • pnpm test -- src/auto-reply/reply/commands-status.test.ts

Changed files

  • src/auto-reply/reply/commands-status.test.ts (modified, +43/-0)
  • src/auto-reply/reply/commands-status.ts (modified, +12/-5)

Code Example

function formatSessionTaskLine(sessionKey) {
    const tasks = listTasksForSessionKey(sessionKey);
    if (tasks.length === 0) return;
    const latest = tasks[0];
    // ...
    const detail = latest.status === "running" || latest.status === "queued"
        ? latest.progressSummary?.trim()
        : latest.error?.trim() || latest.terminalSummary?.trim();
    // ...
}

---

function formatSessionTaskLine(sessionKey) {
    const allTasks = listTasksForSessionKey(sessionKey);
    if (allTasks.length === 0) return;
    const activeTasks = allTasks.filter((task) => task.status === "queued" || task.status === "running");
    if (activeTasks.length === 0) return;
    const latest = activeTasks[0];
    const headline = `${activeTasks.length} active`;
    const title = latest.label?.trim() || latest.task.trim();
    const detail = latest.progressSummary?.trim();
    const parts = [headline, latest.runtime, title, detail].filter(Boolean);
    return parts.length ? `📌 Tasks: ${parts.join(" · ")}` : void 0;
}
RAW_BUFFERClick to expand / collapse

Summary

/status in chat surfaces the full terminalSummary of completed background tasks (cron jobs), flooding the status card with content that was already delivered to the user independently.

Version

OpenClaw 2026.3.31 (213a704)

Steps to Reproduce

  1. Create an agentTurn cron job with sessionTarget: "isolated" and delivery.mode: "announce" (e.g. a daily briefing that produces ~500 words of output)
  2. Let the cron run and deliver successfully
  3. Send /status in Telegram (or any chat surface)

Expected

Clean status card showing session info, model, tokens, queue, etc. Completed background tasks that already delivered their output should not appear.

Actual

The entire terminalSummary of the last completed cron task is appended to the status card via the 📌 Tasks: line, producing a wall of text.

Root Cause

formatSessionTaskLine in commands-status-*.js (built from src/auto-reply/reply/commands-status.ts):

function formatSessionTaskLine(sessionKey) {
    const tasks = listTasksForSessionKey(sessionKey);
    if (tasks.length === 0) return;
    const latest = tasks[0];
    // ...
    const detail = latest.status === "running" || latest.status === "queued"
        ? latest.progressSummary?.trim()
        : latest.error?.trim() || latest.terminalSummary?.trim();
    // ...
}

The function lists ALL tasks associated with the session (via taskIdsByRelatedSessionKey), including completed isolated cron tasks. When the latest task is a finished cron job, it renders terminalSummary — the full task output — inline in the status card.

The causal chain:

  1. Isolated cron tasks set their ownerKey to the main session (correct — the main agent owns the cron)
  2. listTasksForSessionKey indexes by both ownerKey and childSessionKey, so completed cron tasks appear in the main session's task list
  3. formatSessionTaskLine picks the latest task regardless of status or runtime type
  4. For non-running tasks, it falls through to terminalSummary with no filtering or length limit

Suggested Fix

The status card task line should only display active (queued/running) tasks. Completed tasks have already delivered their output via their configured delivery mechanism — the status card should show operational status, not replay deliverables.

function formatSessionTaskLine(sessionKey) {
    const allTasks = listTasksForSessionKey(sessionKey);
    if (allTasks.length === 0) return;
    const activeTasks = allTasks.filter((task) => task.status === "queued" || task.status === "running");
    if (activeTasks.length === 0) return;
    const latest = activeTasks[0];
    const headline = `${activeTasks.length} active`;
    const title = latest.label?.trim() || latest.task.trim();
    const detail = latest.progressSummary?.trim();
    const parts = [headline, latest.runtime, title, detail].filter(Boolean);
    return parts.length ? `📌 Tasks: ${parts.join(" · ")}` : void 0;
}

Alternative: if showing completed task count is desirable, add a summary count without rendering terminalSummary (e.g. 📌 Tasks: 0 active · 2 completed).

extent analysis

TL;DR

Modify the formatSessionTaskLine function to only display active tasks and exclude completed tasks that have already delivered their output.

Guidance

  • Filter tasks by status to only include "queued" or "running" tasks, as shown in the suggested fix.
  • Consider adding a summary count of completed tasks without rendering terminalSummary for a better user experience.
  • Review the listTasksForSessionKey function to ensure it correctly indexes tasks by ownerKey and childSessionKey.
  • Test the updated formatSessionTaskLine function with different task statuses and types to verify the fix.

Example

The suggested fix provides an updated implementation of the formatSessionTaskLine function:

function formatSessionTaskLine(sessionKey) {
    const allTasks = listTasksForSessionKey(sessionKey);
    if (allTasks.length === 0) return;
    const activeTasks = allTasks.filter((task) => task.status === "queued" || task.status === "running");
    if (activeTasks.length === 0) return;
    const latest = activeTasks[0];
    const headline = `${activeTasks.length} active`;
    const title = latest.label?.trim() || latest.task.trim();
    const detail = latest.progressSummary?.trim();
    const parts = [headline, latest.runtime, title, detail].filter(Boolean);
    return parts.length ? `📌 Tasks: ${parts.join(" · ")}` : void 0;
}

Notes

The fix assumes that the listTasksForSessionKey function correctly returns all tasks associated with the session key. If this function is not working as expected, additional debugging may be necessary.

Recommendation

Apply the suggested fix to modify the formatSessionTaskLine function, as it directly addresses the issue of displaying completed tasks in the status card. This change will improve the user experience by only showing active tasks and excluding completed tasks that have already delivered their output.

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