Improve orch status reconciliation view

This commit is contained in:
2026-03-20 17:57:58 +08:00
parent 693a79345b
commit cf3c3cbe60
11 changed files with 374 additions and 21 deletions
+18 -6
View File
@@ -11,6 +11,7 @@ In normal operation:
- leaders use `orch`
- `orch` creates and monitors `inbox` threads
- workers continue using `inbox`
- a separate worker runtime or worker agent must still consume the assigned inbox thread after `dispatch`
## Responsibilities
@@ -34,6 +35,7 @@ In normal operation:
- worker claiming
- direct worker polling
- automatic worker-runtime launch
- raw message append storage
- low-level thread history management
@@ -93,12 +95,13 @@ The normal leader loop is:
3. add dependencies
4. inspect `ready`
5. `dispatch` tasks
6. `reconcile` inbox state back into task state
7. inspect `blocked`
8. answer blocked questions
9. if nothing is actionable, call `wait`
10. retry or reassign failures when needed
11. finish when all required tasks are `done`
6. arrange or launch a separate worker runtime that consumes the assigned inbox threads
7. use `status` for the current operational view; it reconciles first and includes latest attempt and message context
8. inspect `blocked`
9. answer blocked questions
10. if nothing is actionable, call `wait`
11. retry or reassign failures when needed
12. finish when all required tasks are `done`
The leader should block on `orch wait`, not on ad hoc `sleep`.
@@ -194,6 +197,7 @@ Behavior:
- creates or links an `inbox` thread
- writes workspace metadata into attempt storage and task payload
- moves the task to `dispatched`
- does not start a worker runtime on its own
Strict-mode recommendation:
@@ -316,6 +320,14 @@ Suggested flags:
- `--run RUN_ID`
Behavior:
- reconciles inbox thread state before returning the view
- returns run aggregate counts plus per-task detail
- includes the latest attempt for each task when one exists
- includes the latest thread message for each task when one exists
- includes the latest blocked question for blocked tasks so the leader can inspect the current issue without a separate `blocked` call in the common case
### `orch show`
Show one task with dependencies, attempts, and inbox mapping.