Cancel actions on process interrupts

This commit is contained in:
2026-08-13 00:24:16 +00:00
parent 1d3ea64541
commit 4d5a1d9709
5 changed files with 78 additions and 1 deletions

View File

@@ -68,6 +68,10 @@ failure before publication leaves an existing destination unchanged. A
notification failure occurs after publication, so the newly written output
remains available.
`SIGINT` and `SIGTERM` cancel an active action. Weatherreporter lets that
cancellation reach the action before exiting; when the action has a result, it
emits the usual failed summary and exits nonzero.
Action commands (`generate`, `run`, and `compare`) write a JSON summary to
stdout unless `--quiet` is set. `run` also writes compact per-report and batch
status lines to stderr. A pre-run error, such as an invalid flag, missing

View File

@@ -4,6 +4,10 @@
The root `--version` flag reports the build version supplied by `internal/buildinfo`. Tagged release builds replace its development default at link time.
The executable derives its action context from `SIGINT` and `SIGTERM` and
passes it to `Runner.Run`. Signal cancellation therefore uses the same action,
summary, and error paths as other context cancellation.
For each `generate` or `run` action, `Runner` constructs one project-owned Promptkit executor after configuration loads. It captures an absolute working directory, resolves only a relative explicit output override against it, and passes the working directory, loaded configuration, resolved override, and any `--llm-debug-dir` request to the app. The raw configured fallback remains in the configuration for app-owned destination selection. `run` uses the same explicit-resolution rule for `--out-dir`.
The CLI dispatches only generation and batch actions. It has no persisted-run or inspection dispatch. Summaries include report identity, status, output path, effective profile/backend/model, source warnings, validation, requested debug path, and notification result when available. They intentionally exclude prompt input, raw generated text, render context, endpoints, credentials, and full Distributor payloads. A failed action with a partial result still emits its safe summary before its error is returned.

View File

@@ -36,6 +36,10 @@ absolute output path and active profile, backend, model, warnings, validation,
debug, and notification information; see the [CLI reference](cli.md) for its
exact fields.
`SIGINT` and `SIGTERM` request orderly cancellation of an active action. The
command lets cancellation and related cleanup finish before it exits; use the
usual failed result or error to determine whether an output was published.
## Batch Outputs And Distributor Notification
Run a scheduled batch with an explicit output directory when appropriate: