You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cce650b
Browse filesBrowse the repository at this point in the historyBrowse files
F: start and resume a task's plan through /api/runner (#91, part 2) (#105)
* F: wire the runner and startup recovery into the server (#91, part 1)
An opt-in `runner` block in review.json turns on the production runner. After
the Store opens and before the server listens, setUpRunner verifies the lock,
reads the database's runner token, builds the agent image and runs startup
recovery with D's own recoverLeftovers, exportTaskDiff and removal. It then
assembles the execution deps over the real workspace and a Claude launcher.
- Schema v9 saves each allocation's metadataBaseline and seeded commit, so
recovery can export a recovered storage. Handles must match the row's
attempt and allocation IDs. Diffs go through saveDiagnostic.
- RunnerDeps.kinds: admission refuses attempt kinds the deps cannot run.
- ItemExecutor.close(): shutdown awaits plan runs in progress before the
Store closes.
- GhIssueGateway.issueText: the issue's title, body and collaborators'
comments, bounded, for the execute prompt.
- CLI: --release-preparation; "Still stopping agents…" on a second Ctrl+C;
refused runner startups print their message and exit 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Close the gaps review round 1 found in the runner wiring (#91)
- The execute schema is chmod 0444 after writing: a restrictive umask
made it unreadable to the container user, failing every launch.
- Recovery's retention keeps every diff the same recovery saved; before,
the second save could delete the first before finalization referenced it.
- The agent image is built after D's recovery stopped leftover agents.
- Unowned objects are listed one shell line each, the reason as a comment.
- Issue text drops other people's comments before checking their body, and
exactly 1000 comments no longer fails.
- /api/runner refuses to retry an execute attempt outside ItemExecutor.
- A failing shutdown step no longer skips stopping the runner or closing
the Store; --release-preparation prints its error as a message.
- Tests: materialize saves the baseline; D adapter arguments; server close
order with the executor; retry refusal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Close the gaps review round 2 found in the runner wiring (#91)
- Build the agent image as soon as D's recovery returns storage, before
recoverStartup arms the first export deadline: the build blocks, so a
cold build used up that deadline and lost the partial output.
- Shutdown runs every step even when one fails, awaiting plan runs before
the Store closes, and reports the first failure, not a later one.
- /api/runner's view no longer offers retry for an execute attempt that
the action refuses.
- CLI refusals before the lock (bad port, config, runner block) print
their message instead of a stack.
- Unowned object names are shell-quoted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Review round 3: the runner view offers retry only when admission would take it (#91)
- retryable also requires the deps to run the attempt's kind and no
unconfirmed cleanup (runner.unreleased), as admission does.
- Later shutdown failures are logged, not dropped behind the first.
- dRecoveryDeps keeps its doc comment; startup order wording fixed in
setUpRunner's comment and the README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review (high) round 1 fixes for the runner wiring (#91)
- ReviewService.planContext reads a base commit's tree once: each runner
item no longer runs blocking git on the server's thread.
- The runner reuses the issue text across a run's items for up to five
minutes instead of rereading every collaborator and comment page.
- A partial diff D cut at its limit ends with a codeboost: notice line.
- A Ctrl+C during startup takes effect after startup recovery finishes.
- removalCommand is shared by the runner's and Ask's leftover messages;
RecoveryBlocked lists its items one per line.
- CLI tests run web/cli.ts: runner refusal, bad port, release-preparation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review (high) round 2 fixes for the runner wiring (#91)
- The issue reuse window runs on the monotonic clock.
- A second Ctrl+C during startup stops at once (recovery reruns at the
next start); the first says so, and that a running image build stops.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review (high) round 3: demos get their own runner refusal (#91)
Demos never run the runner, so telling a demo to add a runner block
was advice that changed nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* F: start and resume a task's plan through /api/runner (#91, part 2)
- start runs a task that is in review or queued and has not begun at its
plan revision; an in-review task moves to queued in the same action.
- resume continues a begun or requeued task from its first unfinished
item (completed, failed or stopped last item alike) and claims the
requeue in the admitting transaction, which also covers a task stopped
between items.
- ItemExecutor.begin admits the first item synchronously inside the user
action, throwing the refusal so the action's own writes roll back;
runTask keeps reporting it as not started.
- GET /api/runner adds startable and resumable from the same checks.
- Retrying an execute attempt points to resume.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Close the gaps review round 1 found in start and resume (#91)
- A plan revised after it started running is refused by both actions,
with #88 named, instead of each pointing at the other.
- An owed safety finding settles only once the escalation commits: a
user action rolling back after begin keeps it owed.
- runChoice also refuses a closed task first, a runner that cannot run
execute attempts, an active merge and a spent task budget, so the
view's startable and resumable match the actions.
- Tests: the settled-finding outcome, budget and revision refusals, replay
and stale version, shutdown, begin under a rolled-back action; the
between-items setup saves result as production does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Close the gaps review round 2 found in start and resume (#91)
- A spent budget is refused by admission again, not by runChoice, so the
refusal's effect still moves the idle task to needs human; the view
alone checks the budget.
- The #88 refusal applies only when an earlier revision's items made
runner commits; a revised plan whose earlier attempts committed nothing
resumes from its first item.
- The view and runChoice see a run still finishing in ItemExecutor, and
the view no longer hides a storage error as "not offered".
- Tests: the shutdown case now reaches the action (rejectAdmission with the
server open); budget asserts the needs-human move; the settled finding
is no longer owed after the commit; both revision cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Review round 3: one start/resume rule in code and docs (#91)
- start needs no attempt at the current plan revision; resume needs one
at any revision (or a requeue). An in-review task whose only attempts
were at an earlier, uncommitted revision can start again.
- The doc and runChoice comment state that rule.
- A strict begin throws on a revision change instead of reporting a
settled run.
- Tests: an earlier item completed unchanged is no commit and reruns at
the new revision; a 503 start is not recorded and its action ID is
refused afresh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Review round 4: tests for the start rule, doc precision (#91)
- Tests: an in-review task whose only attempts were at an earlier,
uncommitted revision can start; a queued one is offered both actions,
which run the same item; the unchanged-item test checks the revision.
- Doc: start also refuses a pending requeue; a spent budget moves only a
running or queued task to needs human.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Status polls read run progress with one targeted query (#91)
Copilot review on #105: progress() loaded and decoded every attempt
(results up to 1 MiB) twice per /api/runner poll. Store.executeProgress
now aggregates only the execute attempts' item, state, plan revision and
unchanged flag in SQL, and the view computes it once for both flags.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review: refuse a runner root Docker cannot mount; check the schema with D's reader (#91)
A comma or line break in runner.root or diagnosticsDir passed the config
and then failed every launch in D's mount check; it is refused at config
time now. The launcher test also reads schema.json through D's own
readCapturedFile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address Copilot review on #102 (#91)
- issueText checks the issue against the execute prompt's own budget and
serializer (dataJSON, 32 KiB), so an issue it accepts is one a prompt can
carry; a larger one is refused at the fetch with the reason.
- Storage limits must be own keys: inherited names such as toString are
refused like any unknown limit.
- README: the diagnostics cap is a retention target, not a hard limit.
- CLI tests drive Ctrl+C during startup in a child process held by a fake
docker: the first waits and exits 0 after startup, the second exits 130.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address Copilot review round 2 on #102 (#91)
- Diagnostics live per database, in <diagnosticsDir or root>/<runnerOwner>/
diagnostics: retention reads references from one Store only, so runners
of databases sharing a root never delete each other's diffs.
- --release-preparation without --config reports that it needs one,
instead of printing help and exiting 0.
- A demo configuration ignores its runner block however it is opened
(config.demo, not the --demo flag).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review round 1 on #105: count every writable kind's earlier commit; clearer start refusal; tests that fail when broken (#91)
- earlierCommits counts fix and rebase-fix commits too, as hasRunnerCommit does, and a result that is not valid JSON counts as a commit (fail closed).
- start names the task's status, not resume, for a task resume cannot run either.
- The rollback test now reaches the move to queued (admission refuses a spent budget) and replays the recorded refusal.
- New tests: begin's in-flight guard between items, an owed scope pause on resume, an owed finding on start from in review, a fix attempt's earlier commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review round 2 on #105: point a running task's start to resume; tests for the queue move and paying nothing at shutdown (#91)
- start points to resume for a running task that ran only an earlier revision, where resume runs.
- Tests: start from in review queues before it escalates an owed finding; begin pays nothing owed once admission closed.
- Docs: GET /api/runner's field list; when the view withholds start and resume. Comment on how earlierCommits differs from hasRunnerCommit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review round 3 on #105: 503 before any start/resume refusal at shutdown; refusals point only to an action that runs (#91)
- During shutdown, start and resume answer 503 before any refusal, so nothing is recorded under the action ID (test: a body that finishes arriving after shutdown began).
- A run still finishing between items is refused as such, not as an active attempt.
- Start no longer points a fully run task to resume; resume names the status of a task that is neither running, queued nor in review.
- Docs: owed work is acted on before admission refuses a spent budget; the full refusal list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review round 4 on #105: test the view between items; refusal messages name an action that runs (#91)
- Test: while a run is still finishing between items, the view offers neither action and resume is refused.
- "Still finishing" says try again, not start; resume points to start only where start's checks pass; start names the task's status for a run revision.
- Docs: resume is no longer a later part. Test title matches what the 503 test checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Code review round 5 on #105: wording and docs (#91)
- start states a pending requeue as the reason when nothing ran at this revision.
- Docs list start and resume among user actions; the in-flight comment covers begin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fix the three Copilot findings deferred from #102 (#91)
- issueText refuses a title and body already over the prompt budget
before reading any collaborator or comment page.
- Recovery warnings (recoveryWarnings) quote Docker labels and file
names, so a newline or control character cannot forge a line of output.
- A lock.verify failure after startup prints its message and exits 1,
not a stack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address Copilot review on #105: serializer pre-check, terminal quoting (#91)
- issueText runs the prompt's own serializer on the title and body before
reading any collaborator or comment page, so text that only exceeds the
budget once escaped is refused just as early.
- quoteForTerminal (lifecycle.ts) escapes what JSON quoting leaves literal
and a terminal still acts on: C1 controls, U+2028/U+2029, and invisible
format and bidi characters. Recovery warnings use it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ A configuration with a `github` block may also add a `runner` block. The runner
51
51
-`diagnosticsCapBytes`: the size retention trims that directory back to. It is a target, not a hard limit: the file just saved is always kept, even when it alone passes the cap. The default is 256 MiB.
The runner needs Docker and `CLAUDE_CODE_OAUTH_TOKEN`. At start, before the server opens, codeboost recovers what an earlier run left and builds the agent image; a recovery it cannot finish safely stops startup with what to do. Nothing in the review screen starts a run yet (#91 part 2).
54
+
The runner needs Docker and `CLAUDE_CODE_OAUTH_TOKEN`. At start, before the server opens, codeboost recovers what an earlier run left and builds the agent image; a recovery it cannot finish safely stops startup with what to do. `POST /api/runner` with `start` or `resume` runs the plan; the review screen has no buttons for them yet.
Copy file name to clipboardExpand all lines: docs/implementation/runner-lifecycle.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -319,11 +319,17 @@ This runs before the coordinator opens.
319
319
7.**Unowned preparation check.** If any attempt has `preparation_started_at` set and `preparation_pgid` null (see "Launch"), stop here: do not open the coordinator, name each attempt and directory, and wait for `--release-preparation`. Step 4 does not remove those directories.
320
320
8. Open the coordinator.
321
321
322
-
**Production wiring (#91).** The runner is opt-in: the review configuration's `runner` block names its root, an optional diagnostics directory and cap, the committer and optional storage limits (`runner/production.ts`, `parseRunnerConfig`). Without the block, or in a demo, there is no coordinator and runner actions answer that the runner is not configured. With it, `web/cli.ts` takes the lock, `startServer` opens the `Store` and then, before it listens, runs `setUpRunner`: it checks for the github block (the prompt carries the issue) and `CLAUDE_CODE_OAUTH_TOKEN`, calls the lock's `verify()` (decision 1, step 4), reads the runner token for the locked file, and runs `recoverStartup` with D's own `recoverLeftovers`, `exportTaskDiff` and `removeTaskFilesystemsAsync`. The agent image is built after D's recovery has stopped every leftover agent, so no agent keeps writing to its storage during a long build, and before the first export's deadline starts (the build blocks the event loop, so a deadline armed before it would expire as soon as it returned). Any failure closes the `Store`, releases the lock and exits with its message. To export a recovered storage, F saves the storage's `metadataBaseline` and the commit it was seeded from (`attempts.metadata_baseline`, `attempts.storage_base`, schema v9) as soon as D's allocation returns; a row without them gets "Partial output could not be exported: its storage baseline was never saved". Diagnostics are kept per database, in `<diagnosticsDir or root>/<runnerOwner>/diagnostics`: retention reads references only from its own `Store`, so runners of databases sharing a directory must never see each other's files. Recovered diffs are saved through `saveDiagnostic`, with the same owner-only file and retention as the live path; retention keeps every diff this recovery saved, because none is referenced until the finalization transaction. A diff D cut at its byte limit ends with a `codeboost:` line that says so, on this path and the live one. The issue text a prompt carries (title, body and collaborators' comments) is read once and reused for later items for up to five minutes; the base tree listing is read once per base commit. A first Ctrl+C during startup waits for startup to finish; a second stops the process at once, which recovery treats like a crash at the next start. The deps accept execute attempts only (`RunnerDeps.kinds`): admission refuses any other kind before it writes anything. A plan item runs only through `ItemExecutor`, so `/api/runner` refuses to retry an execute attempt on its own; resuming a task comes in #91 part 2.
322
+
**Production wiring (#91).** The runner is opt-in: the review configuration's `runner` block names its root, an optional diagnostics directory and cap, the committer and optional storage limits (`runner/production.ts`, `parseRunnerConfig`). Without the block, or in a demo, there is no coordinator and runner actions answer that the runner is not configured. With it, `web/cli.ts` takes the lock, `startServer` opens the `Store` and then, before it listens, runs `setUpRunner`: it checks for the github block (the prompt carries the issue) and `CLAUDE_CODE_OAUTH_TOKEN`, calls the lock's `verify()` (decision 1, step 4), reads the runner token for the locked file, and runs `recoverStartup` with D's own `recoverLeftovers`, `exportTaskDiff` and `removeTaskFilesystemsAsync`. The agent image is built after D's recovery has stopped every leftover agent, so no agent keeps writing to its storage during a long build, and before the first export's deadline starts (the build blocks the event loop, so a deadline armed before it would expire as soon as it returned). Any failure closes the `Store`, releases the lock and exits with its message. To export a recovered storage, F saves the storage's `metadataBaseline` and the commit it was seeded from (`attempts.metadata_baseline`, `attempts.storage_base`, schema v9) as soon as D's allocation returns; a row without them gets "Partial output could not be exported: its storage baseline was never saved". Diagnostics are kept per database, in `<diagnosticsDir or root>/<runnerOwner>/diagnostics`: retention reads references only from its own `Store`, so runners of databases sharing a directory must never see each other's files. Recovered diffs are saved through `saveDiagnostic`, with the same owner-only file and retention as the live path; retention keeps every diff this recovery saved, because none is referenced until the finalization transaction. A diff D cut at its byte limit ends with a `codeboost:` line that says so, on this path and the live one. The issue text a prompt carries (title, body and collaborators' comments) is read once and reused for later items for up to five minutes; the base tree listing is read once per base commit. A first Ctrl+C during startup waits for startup to finish; a second stops the process at once, which recovery treats like a crash at the next start. The deps accept execute attempts only (`RunnerDeps.kinds`): admission refuses any other kind before it writes anything. A plan item runs only through `ItemExecutor`, so `/api/runner` refuses to retry an execute attempt on its own; a task's plan runs again through `resume` (below).
323
323
324
324
## HTTP and UI contract
325
325
326
-
**Status reads.** `GET /api/runner` returns only the task and attempt rows plus `stateVersion`, `retryable`, `unresolved` and `stopRequested`. `stopRequested` comes from the in-memory job: null, or `{ attemptId, reason, saved }`, where `saved` is false while the first-reason write has failed. The UI shows "Stopping (not saved yet)" only from this field. It does not change `stateVersion`, so user actions still compare against the durable state version. `unresolved` is computed by the server from the in-memory marker: null, or `{ attemptId, reason: "result-not-saved" | "start-not-saved" | "preparation-not-removed" | "storage-not-removed" }`: the terminal write or the start could not be saved; the host-side preparation files could not be removed (before the terminal write when D never ran, after it once D settled); or the task storage could not be removed after a saved terminal write. The UI shows "Needs restart" with that cause only from this field, because the durable row alone may still look active. It does not rebuild Git history or the full review.
326
+
**Status reads.** `GET /api/runner` returns only the task and attempt rows plus `available`, `stateVersion`, `retryable`, `startable`, `resumable`, `unresolved` and `stopRequested`. `stopRequested` comes from the in-memory job: null, or `{ attemptId, reason, saved }`, where `saved` is false while the first-reason write has failed. The UI shows "Stopping (not saved yet)" only from this field. It does not change `stateVersion`, so user actions still compare against the durable state version. `unresolved` is computed by the server from the in-memory marker: null, or `{ attemptId, reason: "result-not-saved" | "start-not-saved" | "preparation-not-removed" | "storage-not-removed" }`: the terminal write or the start could not be saved; the host-side preparation files could not be removed (before the terminal write when D never ran, after it once D settled); or the task storage could not be removed after a saved terminal write. The UI shows "Needs restart" with that cause only from this field, because the durable row alone may still look active. It does not rebuild Git history or the full review.
327
+
328
+
**Start and resume (#91 part 2).**`POST /api/runner` with `action: "start"` or `"resume"` sends `expectedStateVersion` and an `actionId`, but no attempt ID. Both run the plan through `ItemExecutor`, item by item. Everything up to the first item's admission happens inside the user action's transaction, so a refusal rolls back the action's own writes.
329
+
-`start` runs a task that is `in review` or `queued`, has no execute attempt at its current plan revision, and has no pending requeue (that is `resume`'s). An `in review` task moves to `queued` in the same action.
330
+
-`resume` continues a task that is `running` or `queued` and has started running (it has an execute attempt at any plan revision, or recovery left it to requeue). It starts at the first item with no completed execute attempt at the current revision, whether the last item completed, failed or was stopped, and claims `requeue_pending` in the admitting transaction. This is also how a task stopped between items continues.
331
+
- Both refuse a closed task, a pending cancel, a runner that cannot run execute attempts, an active attempt, an earlier run still finishing, an active merge, a scope pause (#88), and a plan revised after an earlier revision's items made runner commits (#88: those commits must be reconciled with the new revision first; earlier attempts that committed nothing do not block). During shutdown both answer 503 before any of these, and record nothing. When none of these applies, a finding or scope pause owed from an earlier run is acted on first, and nothing is admitted (`outcome: "settled"`). Only then is the first item admitted: admission refuses a spent task budget, which also moves an idle `running` or `queued` task to `needs human` (a task still `in review` stays there: its move to `queued` rolls back with the refused action).
332
+
-`GET /api/runner` adds `startable` and `resumable`, computed by the same checks, so the view never offers an action that would be refused. The view also withholds them while the task budget has run out (the action may still act on owed work, or else lets admission refuse it with its move to `needs human`) and while the runner is shutting down or needs a restart. Retrying an execute attempt is refused: a plan item runs again only through `resume`.
327
333
328
334
**User actions.** Cancel, retry and "run again" requests send `attemptId`, `expectedStateVersion` and an `actionId` idempotency key (see "Feedback-event contract"). A replayed `actionId` returns the saved outcome. The server takes the plan identity from its trusted configuration, never from the request, and every `Store` call is scoped by that identity. A mismatch returns HTTP 409 with the current state. The UI then shows that state and keeps any draft.
329
335
@@ -357,7 +363,7 @@ Live planning invocation waits for D5. Until then, the server returns "Planning
357
363
358
364
**What becomes an event.** Only feedback the user wrote or chose. Issue text, issue comments and agent output never become events.
359
365
360
-
`actionId` identifies the one user action (or confirmed external outcome) that caused the event. **For user actions it is an idempotency key the UI generates** (a UUID) when the user acts. The server validates it before opening any transaction: it must be a lowercase UUID v4 (the same regular expression as attempt IDs, 36 characters), or the request is refused with HTTP 400 and nothing is stored. The UI generates it and resends unchanged if it retries after a lost response. Every writing user action goes through one `user_actions` table, keyed by `(planKey, actionId)`. That covers notes, choice changes, finding acceptance, rejection, cancel, retry, "run again", **starting a merge**, and every planning endpoint that writes: plan import, suggestion start, suggestion cancel and suggestion apply. Each planning request carries an `actionId`; its `user_actions` row is inserted in the same transaction as the `Store` call it wraps, and the saved response includes the request ID or plan revision it produced. For a merge, the `user_actions` row is inserted in the same transaction as `beginMergeAttempt`, and it saves the merge attempt ID with the response "in progress". When the merge coordinator records the outcome, the same transaction updates that saved response. A replayed merge click therefore returns the same attempt's current outcome and never starts a second attempt. The row holds the action kind, a hash of the request body and the bounded response. **The first definite outcome is recorded, including a refusal.** If the action applies, its row is inserted in the same transaction. If a guard refuses it (for example HTTP 409 for a stale state version), the refusal and its response are recorded in their own transaction. Only outcomes that applied nothing for a passing reason are not recorded, so the UI may resend them: HTTP 503 during shutdown, and a storage error. A replay is handled before any other guard:
366
+
`actionId` identifies the one user action (or confirmed external outcome) that caused the event. **For user actions it is an idempotency key the UI generates** (a UUID) when the user acts. The server validates it before opening any transaction: it must be a lowercase UUID v4 (the same regular expression as attempt IDs, 36 characters), or the request is refused with HTTP 400 and nothing is stored. The UI generates it and resends unchanged if it retries after a lost response. Every writing user action goes through one `user_actions` table, keyed by `(planKey, actionId)`. That covers notes, choice changes, finding acceptance, rejection, cancel, retry, "run again", start and resume, **starting a merge**, and every planning endpoint that writes: plan import, suggestion start, suggestion cancel and suggestion apply. Each planning request carries an `actionId`; its `user_actions` row is inserted in the same transaction as the `Store` call it wraps, and the saved response includes the request ID or plan revision it produced. For a merge, the `user_actions` row is inserted in the same transaction as `beginMergeAttempt`, and it saves the merge attempt ID with the response "in progress". When the merge coordinator records the outcome, the same transaction updates that saved response. A replayed merge click therefore returns the same attempt's current outcome and never starts a second attempt. The row holds the action kind, a hash of the request body and the bounded response. **The first definite outcome is recorded, including a refusal.** If the action applies, its row is inserted in the same transaction. If a guard refuses it (for example HTTP 409 for a stale state version), the refusal and its response are recorded in their own transaction. Only outcomes that applied nothing for a passing reason are not recorded, so the UI may resend them: HTTP 503 during shutdown, and a storage error. A replay is handled before any other guard:
361
367
362
368
- the same `actionId` with the same request hash returns the saved response and applies nothing, even though the state version has since moved on;
363
369
- the same `actionId` with a different request hash (including a different action kind) is refused with HTTP 409 "Action ID already used" and applies nothing.
// The execute prompt carries the issue as one JSON data block of at most MAX_PROMPT_BYTES (dataJSON). A running byte
255
-
// count stops reading early; the exact check below uses the prompt's own serializer, so an issue accepted here is
256
-
// one the prompt can carry.
253
+
// count stops reading early (a title and body already over it read no collaborator or comment page); the exact check
254
+
// below uses the prompt's own serializer, so an issue accepted here is one the prompt can carry.
257
255
consttooLong=()=>newError(`Issue #${number}'s title, body and collaborator comments are larger than the ${MAX_PROMPT_BYTES/1024} KiB an execute prompt carries; codeboost does not cut an issue to fit.`);
256
+
// Only the size refusal is reworded; any other (text with a NUL, for one) keeps its own reason.
0 commit comments