Repository navigation
Add compilation cancel for stuck Compilations - #54
Merged
Merged
Conversation
A Project allows one active Compilation. When one never finishes, for example because its Render One-Off died, every later plan push and plan compile fails with 409 compilation_active. The Service has a cancel route, and its compilation_active detail tells the caller to cancel, but the CLI could not call it. Recovery needed someone calling the API with the user's token, or a worker shell. compilation cancel finds the Project and origin in local state, as compilation status does, sends one POST with no precondition, and prints the cancelled Compilation. The Service answers a repeated cancel with the same result and never changes a succeeded or failed Compilation, so an unconfirmed outcome is reported as compilation_cancel_unavailable, which is safe to repeat, rather than as request_outcome_unknown. A validated refusal keeps the Service problem under compilation_cancel_rejected, the way a rejected Compilation start does. The new command takes the version to 0.8.2.
raghubetina
force-pushed
the
compilation-cancel
branch
from
October 5, 2026 00:14
4c68064 to
80fb2ea
Compare
raghubetina
added a commit
to firstdraft/skills
that referenced
this pull request
Oct 5, 2026
A Project allows one active Compilation. When one never finishes, every later plan push and plan compile fails with 409 compilation_active, and CLI 0.8.1 had no way out short of an operator. CLI 0.8.2 (firstdraft/cli#54, merged as 92f2771) adds compilation cancel. Pin the bundled CLI to that merge, require CLI 0.8.2, and give the recovery reference the order: read the Compilation with compilation status <id> --wait, cancel it with compilation cancel <id> if it is still queued or running, then rerun the failed command. The ID appears only in the problem's response.detail, so SKILL.md allows that one detail as an ID source when it is a lowercase UUIDv7. Cancelling a --github Compilation also cancels the Project's Publication singleton, so the agent asks first. The reference lists the cancel errors and the Service's 409 and 404 refusals, and the contract check expects cancel in both help texts. SKILL.md shrinks by 5 bytes. Depends on the CLI 0.8.2 release, which needs owner approval and must publish before the plugin. Drop this commit if 0.8.2 does not ship with plugin 0.8.4; the release commit's digest already covers the tree without it.
raghubetina
added a commit
to firstdraft/skills
that referenced
this pull request
Oct 5, 2026
A Project allows one active Compilation. When one never finishes, every later plan push and plan compile fails with 409 compilation_active, and CLI 0.8.1 had no way out short of an operator. CLI 0.8.2 (firstdraft/cli#54, merged as 92f2771) adds compilation cancel. Pin the bundled CLI to that merge, require CLI 0.8.2, and give the recovery reference the order: read the Compilation with compilation status <id> --wait, cancel it with compilation cancel <id> if it is still queued or running, then rerun the failed command. The ID appears only in the problem's response.detail, so SKILL.md allows that one detail as an ID source when it is a lowercase UUIDv7. Cancelling a --github Compilation also cancels the Project's Publication singleton, so the agent asks first. The reference lists the cancel errors and the Service's 409 and 404 refusals, and the contract check expects cancel in both help texts. SKILL.md shrinks by 5 bytes. Depends on the CLI 0.8.2 release, which needs owner approval and must publish before the plugin. Drop this commit if 0.8.2 does not ship with plugin 0.8.4; the release commit's digest already covers the tree without it.
raghubetina
added a commit
to firstdraft/skills
that referenced
this pull request
Oct 5, 2026
A Project allows one active Compilation. When one never finishes, every later plan push and plan compile fails with 409 compilation_active, and CLI 0.8.1 had no way out short of an operator. CLI 0.8.2 (firstdraft/cli#54, merged as 92f2771) adds compilation cancel. Pin the bundled CLI to that merge, require CLI 0.8.2, and give the recovery reference the order: read the Compilation with compilation status <id> --wait, cancel it with compilation cancel <id> if it is still queued or running, then rerun the failed command. The ID appears only in the problem's response.detail, so SKILL.md allows that one detail as an ID source when it is a lowercase UUIDv7. Cancelling a --github Compilation also cancels the Project's Publication singleton, so the agent asks first. The reference lists the cancel errors and the Service's 409 and 404 refusals, and the contract check expects cancel in both help texts. Tighter retained status wording keeps SKILL.md 1 byte smaller. Depends on the CLI 0.8.2 release, which needs owner approval and must publish before the plugin. Drop this commit if 0.8.2 does not ship with plugin 0.8.4; the release commit's digest already covers the tree without it.
raghubetina
added a commit
to firstdraft/skills
that referenced
this pull request
Oct 5, 2026
A Project allows one active Compilation. When one never finishes, every later plan push and plan compile fails with 409 compilation_active, and CLI 0.8.1 had no way out short of an operator. CLI 0.8.2 (firstdraft/cli#54, merged as 92f2771) adds compilation cancel. Pin the bundled CLI to that merge, require CLI 0.8.2, and give the recovery reference the order: read the Compilation with compilation status <id> --wait, cancel it with compilation cancel <id> if it is still queued or running, then rerun the failed command. The ID appears only in the problem's response.detail, so SKILL.md allows that one detail as an ID source when it is a lowercase UUIDv7. Cancelling a --github Compilation also cancels the Project's Publication singleton, so the agent asks first. The reference lists the cancel errors and the Service's 409 and 404 refusals, and the contract check expects cancel in both help texts. Tighter retained status wording keeps SKILL.md 1 byte smaller. Depends on the CLI 0.8.2 release, which needs owner approval and must publish before the plugin. Drop this commit if 0.8.2 does not ship with plugin 0.8.4; the release commit's digest already covers the tree without it.
raghubetina
added a commit
to firstdraft/skills
that referenced
this pull request
Oct 5, 2026
A Project allows one active Compilation. When one never finishes, every later plan push and plan compile fails with 409 compilation_active, and CLI 0.8.1 had no way out short of an operator. CLI 0.8.2 (firstdraft/cli#54, merged as 92f2771) adds compilation cancel. Pin the bundled CLI to that merge, require CLI 0.8.2, and give the recovery reference the order: read the Compilation with compilation status <id> --wait, cancel it with compilation cancel <id> if it is still queued or running, then rerun the failed command. The ID appears only in the problem's response.detail, so SKILL.md allows that one detail as an ID source when it is a lowercase UUIDv7. Cancelling a --github Compilation also cancels the Project's Publication singleton, so the agent asks first. The reference lists the cancel errors and the Service's 409 and 404 refusals, and the contract check expects cancel in both help texts. Tighter retained status wording keeps SKILL.md 1 byte smaller. Depends on the CLI 0.8.2 release, which needs owner approval and must publish before the plugin. Drop this commit if 0.8.2 does not ship with plugin 0.8.4; the release commit's digest already covers the tree without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A Project allows one active Compilation. When one never finishes (its Render One-Off died, a database hiccup), every later
plan pushandplan compilefails with409 compilation_active, and CLI 0.8.1 has no way to cancel it. Recovery needed a facilitator calling the Service with the attendee's token, or a worker shell.firstdraft compilation cancel <compilation-id>calls the Service's existingPOST /v1/projects/{project_id}/compilations/{compilation_id}/cancelfor the Project pinned in.firstdraft/state.json, with that origin's environment or saved token, and prints the cancelled Compilation in the same JSON shape ascompilation status.0.7.xcontract. Production's cancel controller and service are identical to servicemain.compilation_cancel_rejectedand carries the Service problem (409 compilation_not_cancellable,404 compilation_not_found, or404 project_not_found). A401isauthentication_required. A transport failure,408,5xx, or unvalidated response iscompilation_cancel_unavailable, which is safe to repeat: the Service answers a repeated cancel with the same result and never changes a succeeded or failed Compilation. An invalid200isinvalid_compilation_status.docs/commands.md#add-a-commandstep 7. No newsrc/file, so the packed file list is unchanged. A merge releases nothing; the tag and publication wait for owner approval.requires.cli, the startup version probe, the root-help regex inscript/cli-contract/local-commands.mjs, and recovery guidance that pointscompilation_activeatcompilation cancel.Docs: updated docs/commands.md, docs/errors.md, README.md, and CHANGELOG.md
Review: codex-review 0.7.3, max effort, session
3381a7fd-97d5-4fae-8e66-d2b98d97d98b, needs attention; its one finding is accepted and fixed in this commitValidation
At
80fb2ea, afternpm ci --ignore-scripts:npm audit: found 0 vulnerabilitiesnpm run check: passed; 274 tests, 274 pass, 0 fail, thenpack:checkandpack:smokepassed