Snapshot task worktrees to hidden refs as agents work

This commit is contained in:
Ian Gulliver
2026-10-14 22:52:02 -07:00
parent c3ed243573
commit 9039860594
22 changed files with 926 additions and 202 deletions
+61
View File
@@ -274,6 +274,25 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/tasks/{taskId}/snapshots": {
parameters: {
query?: never;
header?: never;
path: {
taskId: string;
};
cookie?: never;
};
/** @description The task's snapshots, oldest first. Each is a commit of the worktree as if everything were staged, kept at refs/byre/tasks/{taskId}/snap/{n} until the task is merged or discarded; the rows remain after that. */
get: operations["listSnapshots"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/tasks/{taskId}/sessions": {
parameters: {
query?: never;
@@ -600,6 +619,25 @@ export interface components {
path: string;
patch: string;
};
Snapshot: {
id: string;
task_id: string;
agent_session_id: string;
/** @description Position in the task's snapshots, from 1; the ref is refs/byre/tasks/{task_id}/snap/{n}. */
n: number;
/** @description A commit of tree_sha whose parent is the worktree's HEAD when it was taken. */
commit_sha: string;
tree_sha: string;
/**
* Format: int64
* @description The task's latest event when the snapshot was started: the tree holds at least the work up to it.
*/
event_seq: number;
/** @enum {string} */
trigger: "tool_call" | "turn_end" | "ask_human" | "timer";
/** Format: date-time */
created_at: string;
};
AgentSession: {
id: string;
task_id: string;
@@ -1292,6 +1330,29 @@ export interface operations {
409: components["responses"]["Error"];
};
};
listSnapshots: {
parameters: {
query?: never;
header?: never;
path: {
taskId: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description The snapshots. */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Snapshot"][];
};
};
404: components["responses"]["Error"];
};
};
listSessions: {
parameters: {
query?: never;