Skip to content

[Bug] Live Block occasionally fails to mark tools as completed #94

@randomm

Description

@randomm

Problem

In the Live Block tool display, some tools occasionally remain showing the "running" status (◇) even after they've completed, while other tools on the same screen correctly show the "completed" checkmark (✓).

Screenshot Evidence

In the screenshot:

  • ✓ task @git-agent — correctly marked done
  • ✓ bash remory search ... — correctly marked done
  • ✓ read ratcher/README.md — correctly marked done
  • ✓ read ratcher/AGENTS.md — correctly marked done
  • ◇ read ratcher/CONTRIBUTING.md — STILL SHOWS RUNNING (bug)
  • ✓ bash remory add ... — correctly marked done (tools after it completed fine)

Expected

All completed tools should show checkmark.

Actual

Occasional tools get "stuck" showing running status even though they completed.

Likely Causes

  1. Race condition in liveblock.ts — tool_end event arrives but the render doesn't update that specific tool
  2. ID mismatch — the tool_end callID doesn't match the tool_start callID in the idMap
  3. Dedup logic interference — the deduplication logic (lastToolKey) might be causing some tool_end events to update the wrong tool
  4. log-update timing — the rewrite might be happening before the state is fully updated

Key Files

  • packages/opencode/src/cli/lite/liveblock.tstoolStart(), toolEnd(), render()
  • packages/opencode/src/cli/lite/index.ts — tool event handling with idMap and dedup

Acceptance Criteria

  • All completed tools show ✓ checkmark
  • No race conditions in tool state updates
  • Consistent rendering regardless of event timing

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions