Skip to content

[BUG] Task titles corrupt to "Work #1 (no message)" after rapid history navigation #1180

Description

@edelauna

Problem

After rapidly expanding, collapsing, or reopening tasks in the history view, the stored title of a task is permanently replaced with the placeholder "Work # 1 (no message)" (or its localized form, e.g., "工作 # 1 (無訊息)" in Traditional Chinese). The real task prompt is lost.

Context

Any user who navigates between history items quickly. More likely to trigger on Windows, where reading a large ui_messages.json file takes longer (files can reach 17–20 MB when tasks include read_file output). First introduced in v3.74.0 with the subtask navigation buttons (Back to parent / Go to subtask).

Reproduction steps

  1. Environment: Zoo Code v3.76.0, Windows, any API provider
  2. Open the task history view.
  3. Click a completed parent task to open it.
  4. Before the chat messages appear, click the Back button or open a different history item.
  5. Repeat steps 3–4 rapidly two or three times (parent and child tasks if available).
  6. Open the history view again.
  7. Observe that the task entry now shows "Work # 1 (no message)" instead of the original prompt.

Expected result

The original task title is preserved in the history list regardless of how quickly the user navigates away.

Actual result

The title permanently changes to "Work # 1 (no message)" / "工作 # 1 (無訊息)". The real prompt is gone from the history entry.

Root cause (confirmed)

Task#resumeTaskFromHistory() starts with an async disk read (getSavedClineMessages()). Until that read completes, this.clineMessages is []. ClineProvider#evictCurrentTask() — called by every navigation away, including the subtask buttons — unconditionally calls abortTask(), which calls saveClineMessages()taskMetadata(). With an empty messages array, taskMetadata() writes the no_messages placeholder as the title, permanently overwriting the real one in the history store.

On Windows with large task files and Defender real-time scanning, the read window is wide enough to hit reliably with fast clicks.

Variations tried

App version

v3.76.0

Logs

Console log from the reporter (v3.74.x, edited for length):

[createTaskWithHistoryItem] parent task <id>.<?> instantiated  messageCount: 4
[Task#getCheckpointService] initializing shadow git ...   ← 14 s
[createTask] parent task <id2>.<?>  instantiated

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions