fix(cli-workflow): resolve step/thread commands on completed threads #478

Merged
xiaoju merged 1 commits from fix/469-step-commands-completed-threads into main 2026-05-24 16:41:07 +00:00
Owner

What

Fixed step list, step show, and thread read commands failing on completed threads with 'thread not active' error.

Why

The root cause was resolveHeadHash() in shared.ts only checking threads.yaml (active threads), not history.jsonl (completed threads). This made step commands unusable for completed threads.

Changes

  • Modified resolveHeadHash() to fallback to history.jsonl when thread not found in threads.yaml
  • Added comprehensive test coverage for all affected commands on completed threads
  • All existing tests continue to pass

Ref

Fixes #469

## What Fixed `step list`, `step show`, and `thread read` commands failing on completed threads with 'thread not active' error. ## Why The root cause was `resolveHeadHash()` in `shared.ts` only checking `threads.yaml` (active threads), not `history.jsonl` (completed threads). This made step commands unusable for completed threads. ## Changes - Modified `resolveHeadHash()` to fallback to `history.jsonl` when thread not found in `threads.yaml` - Added comprehensive test coverage for all affected commands on completed threads - All existing tests continue to pass ## Ref Fixes #469
xiaoju added 1 commit 2026-05-24 16:24:56 +00:00
Fixed issue #469 where `uwf step list`, `uwf step show`, and `uwf thread read`
failed with "thread not active" error when called on completed threads.

The root cause was that resolveHeadHash() in shared.ts only checked threads.yaml
(active threads index) but never fell back to history.jsonl (completed threads log).

Changes:
- Updated resolveHeadHash() in shared.ts to check history.jsonl as fallback
- Changed error message from "thread not active" to "thread not found"
- Added comprehensive test coverage:
  - Unit tests for resolveHeadHash() with active/completed/missing threads
  - Integration tests for cmdStepList() with completed threads
  - Integration tests for cmdStepShow() with completed threads
  - Regression tests for cmdThreadRead() with completed threads

All commands now work identically for active and completed threads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xiaoju merged commit dfdf0ac073 into main 2026-05-24 16:41:07 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#478