feat(cli): add currentRole field to thread show and thread list output #572

Merged
xiaoju merged 1 commits from fix/571-current-role into main 2026-05-28 01:58:23 +00:00
Owner

What

Added currentRole: string | null field to thread show and thread list output.

Why

When monitoring workflows, it's important to know which role is currently executing (for running threads) or which role will execute next (for idle threads). This field makes thread status more actionable.

Changes

  • Protocol: Added currentRole: string | null to StepOutput type
  • CLI: Added resolveCurrentRole() helper that walks the CAS chain and evaluates the workflow graph
  • Logic:
    • status=idle → returns next role from graph evaluation
    • status=running → returns currently executing role
    • status=completed|cancelled → returns null
    • Next role is $END → returns null
  • Tests: Added 9 comprehensive test cases covering all scenarios

Ref

Fixes #571

## What Added `currentRole: string | null` field to `thread show` and `thread list` output. ## Why When monitoring workflows, it's important to know which role is currently executing (for running threads) or which role will execute next (for idle threads). This field makes thread status more actionable. ## Changes - **Protocol**: Added `currentRole: string | null` to `StepOutput` type - **CLI**: Added `resolveCurrentRole()` helper that walks the CAS chain and evaluates the workflow graph - **Logic**: - `status=idle` → returns next role from graph evaluation - `status=running` → returns currently executing role - `status=completed|cancelled` → returns `null` - Next role is `$END` → returns `null` - **Tests**: Added 9 comprehensive test cases covering all scenarios ## Ref Fixes #571
xiaoju added 1 commit 2026-05-28 01:56:59 +00:00
Add currentRole: string | null to StepOutput and ThreadListItemWithStatus.
- idle/running: derives next role via evaluate() on workflow graph
- completed/cancelled: null
-  as next role: null

Includes 9 test cases covering all status combinations and conditional routing.
xiaoju merged commit 0b20e88317 into main 2026-05-28 01:58:23 +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#572