feat(cli): add status field to thread show output #563

Closed
xiaoju wants to merge 0 commits from fix/559-thread-show-status into main
Owner

What

Add unified status field to uwf thread show output, consistent with uwf thread list.

Why

Issue #559 identified an inconsistency: uwf thread list includes a status field (idle/running/completed/cancelled) but uwf thread show uses deprecated done and background fields instead.

Changes

Type System Updates

  • Added ThreadStatus type to workflow-protocol: "idle" | "running" | "completed" | "cancelled"
  • Updated StepOutput type to include status: ThreadStatus field
  • Maintained deprecated done and background fields for backward compatibility
  • Added JSDoc @deprecated tags to legacy fields

Implementation

  • Updated cmdThreadShow() to compute status field:
    • Active threads: check isThreadRunning()"running" or "idle"
    • Completed threads: check hist.reason"cancelled" or "completed"
  • Updated cmdThreadStepOnce() to include status in all return paths
  • Updated background execution path to return status: "running"

Tests

  • Added comprehensive test suite: thread-show-status.test.ts
  • 5 test scenarios covering all status states: idle, running, completed, cancelled, legacy
  • All 5 new tests pass
  • All 668 existing tests pass (1 pre-existing failure unrelated)

Ref

Fixes #559

## What Add unified `status` field to `uwf thread show` output, consistent with `uwf thread list`. ## Why Issue #559 identified an inconsistency: `uwf thread list` includes a `status` field (idle/running/completed/cancelled) but `uwf thread show` uses deprecated `done` and `background` fields instead. ## Changes ### Type System Updates - Added `ThreadStatus` type to `workflow-protocol`: `"idle" | "running" | "completed" | "cancelled"` - Updated `StepOutput` type to include `status: ThreadStatus` field - Maintained deprecated `done` and `background` fields for backward compatibility - Added JSDoc `@deprecated` tags to legacy fields ### Implementation - Updated `cmdThreadShow()` to compute status field: - Active threads: check `isThreadRunning()` → `"running"` or `"idle"` - Completed threads: check `hist.reason` → `"cancelled"` or `"completed"` - Updated `cmdThreadStepOnce()` to include status in all return paths - Updated background execution path to return `status: "running"` ### Tests - Added comprehensive test suite: `thread-show-status.test.ts` - 5 test scenarios covering all status states: idle, running, completed, cancelled, legacy - All 5 new tests pass - All 668 existing tests pass (1 pre-existing failure unrelated) ## Ref Fixes #559
xiaoju added 1 commit 2026-05-27 16:38:17 +00:00
feat(cli): add status field to thread show output
CI / test (pull_request) Successful in 1m30s
d9f7648fdd
- Add ThreadStatus type to workflow-protocol
- Update StepOutput type to include status field alongside deprecated done/background fields
- Implement status computation in cmdThreadShow (idle/running/completed/cancelled)
- Update cmdThreadStepOnce to include status in return values
- Add comprehensive test suite for thread show status scenarios

Fixes #559

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xiaonuo closed this pull request 2026-05-27 23:50:16 +00:00
Some checks are pending
CI / test (pull_request) Successful in 1m30s

Pull request closed

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#563