Let task agents create and manage subtasks

This commit is contained in:
Ian Gulliver
2026-10-16 10:36:38 -07:00
parent fd63a0dfbc
commit 0f2415570c
30 changed files with 1067 additions and 287 deletions
+13 -4
View File
@@ -282,7 +282,7 @@ export interface paths {
};
get?: never;
put?: never;
/** @description Sets the task's merge_title to the confirmed title, then starts the same agent turn as merge-in, without its invitation to revise the title. When that turn ends normally, byre squashes the task's worktree into one commit titled with the task's merge_title on the project's default branch, authored by the caller with a Co-authored-by trailer for each of the task's co-authors, pushes it to origin, fast-forwards the project's checkout to it, then removes the worktree and branch and marks the task merged. While another task in the project is merging, the merge is held instead (merge_queued_at is set) and starts when no merge is in progress in the project and the task's session is idle, oldest first. The title is fixed from here until the task closes. Refused while a turn is running, or the merge is already held. */
/** @description Sets the task's merge_title to the confirmed title, then starts the same agent turn as merge-in, without its invitation to revise the title. When that turn ends normally, byre squashes the task's worktree into one commit titled with the task's merge_title on the project's default branch, authored by the caller with a Co-authored-by trailer for each of the task's co-authors, pushes it to origin, fast-forwards the project's checkout to it, then removes the worktree and branch and marks the task merged. While another task in the project is merging, the merge is held instead (merge_queued_at is set) and starts when no merge is in progress in the project and the task's session is idle, oldest first. The title is fixed from here until the task closes. Refused while a turn is running, or the merge is already held. With target parent, for a subtask only, the subtask's branch is merged into its parent task's branch instead: the parent's agent is asked to merge it (queued if it is mid-turn), and the subtask closes as merged once its branch is in the parent's HEAD at the end of one of the parent's turns (merging_into_parent is set until then). Refused while the subtask's turn is running or it is already merging into its parent. Either target is refused while the task has active subtasks of its own. */
post: operations["mergeTask"];
delete?: never;
options?: never;
@@ -320,7 +320,7 @@ export interface paths {
};
get?: never;
put?: never;
/** @description Gives the task's agent one dedicated turn to write the task summary, started at once when its session is idle (or in a new session when it has none) and otherwise as soon as the running turn ends, with no other turn admitted meanwhile; drops any held merge; and when that turn ends however it ends, removes the task's worktree and branch without merging and marks the task discarded. The task's record, summary and events remain. Refused while the task is merging or already being discarded; on a task whose cleanup failed, retries the cleanup. */
/** @description Gives the task's agent one dedicated turn to write the task summary, started at once when its session is idle (or in a new session when it has none) and otherwise as soon as the running turn ends, with no other turn admitted meanwhile; drops any held merge; and when that turn ends however it ends, removes the task's worktree and branch without merging and marks the task discarded. The task's record, summary and events remain. Refused while the task is merging, already being discarded, or has active subtasks; on a task whose cleanup failed, retries the cleanup. */
post: operations["discardTask"];
delete?: never;
options?: never;
@@ -878,6 +878,10 @@ export interface components {
merging: 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. */
discarding: boolean;
/** @description The task whose agent created this one as its subtask; absent for other tasks. */
parent_task_id?: string;
/** @description Whether a merge of this subtask into its parent was requested and the parent hasn't merged it yet. */
merging_into_parent: boolean;
};
Todo: {
/** @description Whether the default branch has a TODO.md at its root. */
@@ -1766,8 +1770,13 @@ export interface operations {
requestBody: {
content: {
"application/json": {
/** @description The squash commit's title: one line, at most 72 characters. */
merge_title: string;
/** @description The squash commit's title: one line, at most 72 characters. Required for target main. */
merge_title?: string;
/**
* @description main (the default): squash onto the project's default branch. parent: merge into the parent task's branch; only for a subtask.
* @enum {string}
*/
target?: "main" | "parent";
};
};
};