Fold task state into one server field; add ready cancel and dismiss

This commit is contained in:
Ian Gulliver
2026-10-20 08:51:32 -07:00
parent 224a0d5a4b
commit e7724977c8
12 changed files with 506 additions and 388 deletions
+17 -8
View File
@@ -483,6 +483,20 @@ paths:
schema: { $ref: "#/components/schemas/Task" }
"404": { $ref: "#/components/responses/Error" }
/api/tasks/{taskId}/ready:
parameters:
- { name: taskId, in: path, required: true, schema: { type: string } }
delete:
operationId: dismissReady
description: Dismisses the agent's standing ready_for_merge or suggest_discard, so the task is no longer ready_to_merge or discard_suggested; a task.ready_cleared event records it.
responses:
"200":
description: Dismissed.
content:
application/json:
schema: { $ref: "#/components/schemas/Task" }
"404": { $ref: "#/components/responses/Error" }
/api/tasks/{taskId}/merge-in:
parameters:
- { name: taskId, in: path, required: true, schema: { type: string } }
@@ -1307,20 +1321,15 @@ components:
workflow_stage: { type: string, description: "With workflow: the name of the stage this task runs." }
state:
type: string
description: "What the task is doing, kept by the store in the same transaction as every change to it (a task.state event carries each change): merged or discarded once closed, else discarding, merging, the state of its agent's latest live session when that isn't idle, reviewing while a review runs, review_pending between a turn's end and its snapshot's review starting or being skipped, idle, or no_agent."
enum: [running, idle, review_pending, reviewing, merging, discarding, merged, discarded, no_agent]
x-enum-varnames: [TaskStateRunning, TaskStateIdle, TaskStateReviewPending, TaskStateReviewing, TaskStateMerging, TaskStateDiscarding, TaskStateMerged, TaskStateDiscarded, TaskStateNoAgent]
description: "The one state the task is in, kept by the store in the same transaction as every change to it (a task.state event carries each change). The first that holds: merged or discarded once closed; discarding; asking while it has an open question; merging while a Merge or a merge into its parent is under way; merge_held while its Merge waits for another merge in the project; merge_after_review while a Merge with after_review waits for its review; running while one of its agents is mid-turn or has subagents running; reviewing while a review runs; review_pending between a turn's end and its snapshot's review starting or being skipped; ready_to_merge or discard_suggested when the agent's latest ready_for_merge or suggest_discard still stands; idle; no_agent when it has no live agent."
enum: [running, idle, review_pending, reviewing, merging, discarding, merged, discarded, no_agent, asking, merge_held, merge_after_review, ready_to_merge, discard_suggested]
x-enum-varnames: [TaskStateRunning, TaskStateIdle, TaskStateReviewPending, TaskStateReviewing, TaskStateMerging, TaskStateDiscarding, TaskStateMerged, TaskStateDiscarded, TaskStateNoAgent, TaskStateAsking, TaskStateMergeHeld, TaskStateMergeAfterReview, TaskStateReadyToMerge, TaskStateDiscardSuggested]
merging: { type: boolean, description: "Whether a Merge was started and hasn't finished: its turn is running, or the turn ended and byre is squashing, pushing and closing the task." }
discarding: { type: boolean, description: "Whether a Discard was started and the task isn't closed yet: its summary turn is waiting for the running turn, running, or done and the task is being removed." }
parent_task_id: { type: string, description: "The task whose agent created this one as its subtask; absent for other tasks." }
merging_into_parent: { type: boolean, description: "Whether a merge of this subtask into its parent was requested and the parent hasn't merged it yet." }
merge_after_review: { type: boolean, description: "Whether a Merge with after_review is waiting for the running review of the latest snapshot to finish." }
summary_seq: { type: integer, format: int64, description: "The seq of the task's latest turn.ended event with summary: true; 0 when it has none." }
ready:
type: string
description: "What the agent last told the human to do with the task: merge (ready_for_merge) or discard (suggest_discard); absent when it hasn't, or when a snapshot other than an answer's or a new question came after."
enum: [merge, discard]
x-enum-varnames: [TaskReadyMerge, TaskReadyDiscard]
Todo:
type: object