| | @@ -63,6 +63,7 @@ |
| 63 | 63 | "POST /repos/{owner}/{repo}/diffinery/tasks/{number}/messages": { scope: "write", sessionOnly: true }, |
| 64 | 64 | "POST /repos/{owner}/{repo}/diffinery/tasks/{number}/retry": { scope: "write", sessionOnly: true }, |
| 65 | 65 | "POST /repos/{owner}/{repo}/diffinery/tasks/{number}/plan/approve": { scope: "write", sessionOnly: true }, |
| 66 | + "POST /repos/{owner}/{repo}/diffinery/tasks/{number}/attempts/{attempt}/pick": { scope: "write", sessionOnly: true }, |
| 66 | 67 | "POST /repos/{owner}/{repo}/diffinery/tasks/{number}/plan/split": { scope: "write", sessionOnly: true }, |
| 67 | 68 | "POST /repos/{owner}/{repo}/diffinery/project/posts": { scope: "write", sessionOnly: true }, |
| 68 | 69 | "PUT /repos/{owner}/{repo}/diffinery/project/memory": { scope: "write", sessionOnly: true }, |
| | @@ -1446,12 +1447,13 @@ |
| 1446 | 1447 | agent: ["string", "The agent's login (required)."], |
| 1447 | 1448 | base: ["string", "Branch to start from (default: the default branch)."], |
| 1448 | 1449 | plan_first: ["boolean", "`true` to plan in a read-only sandbox before building, `false` to build at once. Left out, the project's default; a project that requires plans ignores `false`. See /docs/agents/tasks#plan-first."], |
| 1450 | + attempts: ["integer", "1 (default) to 4: run the first build as that many attempts side by side, then pick one (422 above 1 for a task on a pull request's branch). See /docs/agents/tasks#best-of-n."], |
| 1449 | 1451 | command: ["string", "For `custom`: the shell command to run."], |
| 1450 | 1452 | }, |
| 1451 | 1453 | }, |
| 1452 | 1454 | "GET /repos/{owner}/{repo}/diffinery/project": { |
| 1453 | 1455 | summary: "Get the project", |
| 1454 | | - description: "The repository's project: `settings` (`max_running`, `instructions`), `memory` (`body`, `version`, `updated_by`, `updated_at`) and `board`, the agent tasks by column (`waiting`, `working`, `queued`, `review`, `landing`, `done`, `idle`). Agent reviews aren't on the board. Needs write access. See /docs/agents/projects.", |
| 1456 | + description: "The repository's project: `settings` (`max_running`, `instructions`, `plan_first`), `memory` (`body`, `version`, `updated_by`, `updated_at`) and `board`, the agent tasks by column (`waiting`, `working`, `queued`, `review`, `landing`, `done`, `idle`). Agent reviews aren't on the board. Needs write access. See /docs/agents/projects.", |
| 1455 | 1457 | access: "write", |
| 1456 | 1458 | }, |
| 1457 | 1459 | "GET /repos/{owner}/{repo}/diffinery/project/posts": { |
| | @@ -1516,9 +1518,20 @@ |
| 1516 | 1518 | }, |
| 1517 | 1519 | "GET /repos/{owner}/{repo}/diffinery/tasks/{number}": { |
| 1518 | 1520 | summary: "Get an agent task", |
| 1519 | | - description: "The task, its runs and its pull request. Needs write access. A plan-first task also has `plan_state` (`planning`, `waiting`, `approved` or `split`) and `plan`; a task split from a plan has `parent_task`.", |
| 1521 | + description: "The task, its runs and its pull request. Needs write access. A plan-first task also has `plan_state` (`planning`, `waiting`, `approved` or `split`) and `plan`; a task split from a plan has `parent_task`. A task with more than one attempt has `pick_state` (`running`, `waiting` or `picked`) and `picked_attempt`, and each run its `attempt`.", |
| 1520 | 1522 | access: "write", |
| 1521 | 1523 | }, |
| 1524 | + "GET /repos/{owner}/{repo}/diffinery/tasks/{number}/attempts": { |
| 1525 | + summary: "Compare a task's attempts", |
| 1526 | + description: "Needs write access. One entry per attempt of a best-of-N task: `attempt`, `run`, `state`, `error`, `branch`, `head_sha`, `changes` (`files`, `additions`, `deletions`), `checks` and `failing_checks` on its branch, `model_requests`, `tokens`, `summary` (its last message) and `compare_url`. See /docs/agents/tasks#best-of-n.", |
| 1527 | + access: "write", |
| 1528 | + }, |
| 1529 | + "POST /repos/{owner}/{repo}/diffinery/tasks/{number}/attempts/{attempt}/pick": { |
| 1530 | + summary: "Pick a task's attempt", |
| 1531 | + description: "From a browser session only, by the person who started the task. The attempt's branch becomes the task's branch, with a pull request; the other attempts' branches are deleted. 409 `the attempts are still running`, `attempt <n> is already picked` or `this task has no attempts to pick from`; 404 `no such attempt`; 422 `attempt <n> has no work to pick: ...` when it changed nothing or didn't finish. Audited as `task.pick`.", |
| 1532 | + access: "write", |
| 1533 | + status: 202, |
| 1534 | + }, |
| 1522 | 1535 | "POST /repos/{owner}/{repo}/diffinery/tasks/{number}/plan/approve": { |
| 1523 | 1536 | summary: "Approve a task's plan", |
| 1524 | 1537 | description: "From a browser session only, by the person who started the task. The build run starts with the goal and the plan, and every later run gets the plan as the approved one. 409 `the plan isn't ready yet` while it plans, `this task has no plan waiting for approval`, or `the task is running`. Audited as `task.plan_approve`. See /docs/agents/tasks#plan-first.", |