Runs park on usage limits; failure classes, harness error policy, run budgets
- A stage refused for a Claude usage limit no longer fails its run: the runner tries the chats' Claude account auto-switch (per-home setting) and reruns the visit, else parks the run in the new waiting_quota status (persisted, with reset/resume time in run summaries, details and events) and resumes the same visit at reset + 1 min, also after a restart. resume_run / `pipelines resume` resumes now; cancel works on parked runs. The rerun visit gets a "# Previous attempt" interruption note. Subscription limits no longer say "top up the provider account". - run/retry into an account known to be limited are deferred (quota_policy defer/refuse/now; CLI refuses under --json/--yes unless --defer or --now). - failure_class on runs (quota, loop_exhausted, timeout, permission_denied, harness_error, blocked, environment, canceled, interrupted, budget, check_failed, other) in RunSummary/RunDetail/events, CLI inspect/runs/wait/ stats and the app failure line. - Claude permission denials (permission_denials / refused tool results) fail a blocked visit with permission_denied naming the tool use. - Harness failures are classified transient vs deterministic; deterministic ones (and a repeated empty readback) skip error self-loops; transient self-loops back off 15 s, 1 min, 4 min. - Whole-run USD budget: run --budget, server default (run-budget / get/set_run_settings); 80% warning notification, stop with class budget. - App: waiting_quota status/filter with resume time, Resume now and Cancel, failure class wording. Docs and skill references updated. Merges main (check stage, delivery gate, Claude stage restart survival, schedule changes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+77
-3
@@ -194,8 +194,11 @@ Every submission, including agent-issued `submit`/`rpc`, still uses server valid
|
||||
## Drafts in the TUI
|
||||
|
||||
The server runs one active run per resolved workspace, including overlapping
|
||||
parent/descendant directories (and symlink aliases). Separate sibling worktrees
|
||||
remain independent. A new request key in a
|
||||
parent/descendant directories of one repository (and symlink aliases). Separate
|
||||
sibling worktrees, and separate repositories nested in one another, remain
|
||||
independent. Two folders outside any repository overlap only when they are the
|
||||
same folder or one lies within the other run's declared write paths. A new
|
||||
request key in a
|
||||
different workspace is admitted immediately and executes concurrently; a second
|
||||
run in a workspace an active run is already changing is refused, naming the
|
||||
conflicting run and advising you to wait or use a different workspace (for
|
||||
@@ -328,6 +331,8 @@ Submitting activates included schedules, so review them before publishing.
|
||||
| Rename a run | `title ID "TITLE" --json` |
|
||||
| Decide a waiting human stage | `decide ID [STAGE] --option KEY [--feedback TEXT] --json` |
|
||||
| Cancel | `cancel ID --json` |
|
||||
| Resume a run parked for a usage limit | `resume ID --yes --json` |
|
||||
| Default whole-run budget | `run-budget [USD\|off] --json` |
|
||||
| Connection and phone settings | `connection --json`, `ping --json` |
|
||||
| Server/ntfy status popup | `status --json` |
|
||||
| Usage statistics/charts | `stats --json` |
|
||||
@@ -347,7 +352,7 @@ printf '%s' '{"type":"get_pipeline","pipeline_id":1,"version":1}' | pipelines rp
|
||||
Existing protocol commands: `ping`, `list_pipelines` (optional `include_archived`),
|
||||
`get_pipeline`, `archive_pipeline`, `unarchive_pipeline`,
|
||||
`list_templates`, `validate`, `submit`, `run_pipeline`, `list_runs`, `get_run`,
|
||||
`cancel_run`, `retry_run`, `decide_run`, `set_run_title`, `get_run_evidence`,
|
||||
`cancel_run`, `retry_run`, `decide_run`, `resume_run`, `set_run_title`, `get_run_evidence`, `get_run_settings`, `set_run_settings`,
|
||||
`get_status`, `search`. `search` takes a `search` request object (`query`, with an
|
||||
optional `kind` and `limit`) and returns a `search_results` response whose ranked
|
||||
`results` each carry a stable `target` the client can open plus the typed payload
|
||||
@@ -1163,6 +1168,75 @@ bound is stored as a valid, credential-redacted preview envelope that preserves
|
||||
available stage limits and failure/format diagnostics and names the retained
|
||||
session instead of slicing to malformed JSON.
|
||||
|
||||
### Whole-run budgets
|
||||
|
||||
A run can also carry a whole-run USD cap: `pipelines run ... --budget 5` (and
|
||||
`retry ... --budget 5`; a retry otherwise keeps its source run's own budget), else
|
||||
the server default set with `pipelines run-budget 5` (`run-budget off` removes it;
|
||||
`run-budget` alone shows it). Every model stage's reported cost counts towards it.
|
||||
At 80% the operator gets one `budget_warning` notification; at 100% the running
|
||||
visit stops, the error edge is not followed and the run fails with failure class
|
||||
`budget`. The run records `budget: {limit_usd, source: run|server, spent_usd,
|
||||
warned}`; `inspect` prints it. Stage `budget_usd`/`budget_tokens` still cap each
|
||||
stage on their own. Protocol: `run_pipeline`/`retry_run` take `budget_usd`;
|
||||
`get_run_settings` and `set_run_settings` (`run_settings: {default_budget_usd}`)
|
||||
reply `run_settings`.
|
||||
|
||||
### Usage limits: `waiting_quota`
|
||||
|
||||
A Claude stage refused for a subscription usage limit (the 5-hour or weekly
|
||||
window) does not fail its run:
|
||||
|
||||
1. The server records the account's limit and tries the same Claude account
|
||||
auto-switch chats use (only when the stage's Claude home sets its own
|
||||
`CLAUDE_CONFIG_DIR` and its auto-switch setting is on, see Claude account
|
||||
switching). On a switch the same stage visit runs again at once on the new
|
||||
account.
|
||||
2. Otherwise the run is parked with status `waiting_quota`. The run (and its
|
||||
`run_event` frames) carry `quota_wait: {resets_at, resume_at, sequence, stage,
|
||||
account}`; the server resumes the interrupted visit at `resume_at` (the reset
|
||||
plus one minute), also after a server restart. A parked run holds no executor
|
||||
and no workspace reservation; if another run holds its workspace at resume
|
||||
time it tries again a minute later.
|
||||
3. The visit that runs again does not count against the stage's `max_visits` and
|
||||
its `input.md` carries a `# Previous attempt` note saying it was interrupted by
|
||||
the limit and that partial edits may be in the worktree.
|
||||
|
||||
`pipelines resume <run-id>` (protocol `resume_run`) resumes a parked run now;
|
||||
`pipelines cancel <run-id>` cancels it (failure class `canceled`). `pipelines wait`
|
||||
keeps waiting through `waiting_quota`; `run --wait`/`retry --wait` return with the
|
||||
parked run and a line saying when it resumes. An exhausted paid balance (an API
|
||||
key's credit, OpenCode's quota error) has no reset of its own and still fails the
|
||||
run with failure class `quota`; only that case says to top up the account.
|
||||
|
||||
While an account is known to be limited, a new `run` or `retry` whose pipeline has
|
||||
Claude stages is not launched into it. The request's `quota_policy` decides:
|
||||
`defer` (the default, and the CLI's choice at an interactive prompt) creates the run
|
||||
parked in `waiting_quota` with `sequence: 0`, starting at the reset; `refuse` (the
|
||||
CLI's choice under `--json`/`--yes`) rejects it naming the reset time; `now`
|
||||
starts it anyway. The CLI flags are `--defer` and `--now`.
|
||||
|
||||
### Failure classes and error loops
|
||||
|
||||
A run that did not succeed carries `failure_class`, written by the runner and
|
||||
shown by `inspect`, `runs`, `wait`, `run --wait`, the app's failure line and
|
||||
`stats` (`failure_classes` counts): `quota`, `loop_exhausted`, `timeout`,
|
||||
`permission_denied`, `harness_error`, `blocked` (a stage routed to `#failure` on
|
||||
its own outcome), `environment`, `canceled`, `interrupted`, `budget`,
|
||||
`check_failed` (verification target or delivery gate) and `other`. Runs recorded
|
||||
before the class existed read as `blocked`, `other`, `canceled` or `interrupted`
|
||||
from their status.
|
||||
|
||||
A Claude stage that answers `blocked` (or `error`) after the permission rules
|
||||
refused one of its tool uses (`permission_denials` in Claude Code's result, or a
|
||||
refused `tool_result`) fails with `permission_denied` naming the tool and path or
|
||||
command, instead of being reported as the model's own block. Harness failures are
|
||||
classified before an `error -> <same stage>` loop is followed: deterministic ones
|
||||
(authentication, invalid arguments or model, a configuration the harness refuses,
|
||||
a permission denial, the same empty readback twice) go to `#failure`; transient
|
||||
ones (network, 5xx, overloaded, timeouts) wait 15 s, 1 min, then 4 min before the
|
||||
next visit.
|
||||
|
||||
### Result-first views
|
||||
|
||||
Home shows retained result previews and completed visits alongside each run and
|
||||
|
||||
+7
-2
@@ -309,8 +309,13 @@ directory that chooses its own account keeps it).
|
||||
- **Failures.** Diagnostics are fixed text. A billing, quota or rate-limit
|
||||
refusal stops the run without retries; a missing sign-in says so. The CLI's
|
||||
redacted stream is kept as the session export and evidence.
|
||||
- **Recovery.** A server restart during a Claude Code stage stops that process
|
||||
and fails the visit; it is not reattached.
|
||||
- **Recovery.** The CLI runs in its own session, writing its stream-json to a
|
||||
file in the stage's evidence directory, so a restart of the installed server
|
||||
does not stop it. The next server re-adopts the visit: it keeps reading the
|
||||
CLI's output, waits for it to finish and continues the run. A CLI that
|
||||
finished while the server was down is read back from that file; one that
|
||||
ended without a result marks the run interrupted, saying so (its prompt is
|
||||
never sent again). An interrupted outcome repair follow-up is asked again.
|
||||
- **Overrides.** `--model` and `--stage-model` must give an
|
||||
`anthropic/<model>` for these stages; the launch is refused otherwise.
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ Options: `--server-url ws(s)://host:port/connect`, `--notes TEXT`, `--prefix`.
|
||||
|
||||
```sh
|
||||
./install --linux --output ./dist
|
||||
./install --linux --install # also install it for this user (launcher, icon)
|
||||
./install --macos --flutter /path/to/flutter --output ./dist
|
||||
# Offer this desktop build through an installed server's update feed:
|
||||
./install --linux --publish --notes "Release notes"
|
||||
@@ -195,6 +196,25 @@ from the `pipelines` server CLI. The target Linux desktop needs GTK 3 and its
|
||||
runtime libraries (Debian/Ubuntu: `libgtk-3-0`, `libstdc++6`, `liblzma5`). This is a
|
||||
portable bundle, not a package-manager installation or a server installation.
|
||||
|
||||
`./install --linux --install` also installs it for the current user:
|
||||
the bundle goes to `<prefix>/lib/app-linux` (default
|
||||
`~/.local/share/pipelines/lib/app-linux`; the previous one is kept as
|
||||
`app-linux.previous`), with `~/.local/share/applications/com.pipelines.app.desktop`,
|
||||
its icon in `~/.local/share/icons/hicolor` and a `~/.local/bin/pipelines-app`
|
||||
link. `scripts/install-linux-app.sh <archive>` installs a downloaded archive the
|
||||
same way. The desktop entry is named after the GTK application id, which is
|
||||
also the Wayland app id (Hyprland's window class), so launchers, docks and
|
||||
window rules match the window. The app runs as a native Wayland client (GTK
|
||||
picks Wayland when `WAYLAND_DISPLAY` is set and `GDK_BACKEND` is not forced to
|
||||
`x11`); it draws a GTK header bar only on GNOME.
|
||||
|
||||
Release builds are size-optimised: Dart debug symbols are split out
|
||||
(`--split-debug-info`, kept in the build cache under `.debug-info/` for
|
||||
`flutter symbolize`) and the icon fonts are tree-shaken (the build image fixes
|
||||
Flutter 3.44's Linux backend, which otherwise ships the full MaterialIcons
|
||||
font). The Linux app has no web view or file share sheet, so HTML artifacts
|
||||
show an explanation instead of a preview and Share is not offered (Download is).
|
||||
|
||||
macOS 12 or newer is required. macOS builds run natively with Xcode and the pinned Flutter version from
|
||||
`app/.flutter-version`; they do not require Docker. The build targets the build
|
||||
machine's architecture and records the actual executable architecture in the
|
||||
|
||||
+8
-3
@@ -42,9 +42,14 @@ Edit that schedule explicitly when you want it to use a newer version.
|
||||
never guesses from workflow Markdown or a current pipeline's schedule state.
|
||||
|
||||
Each dispatch is claimed once. Missed occurrences after downtime are skipped,
|
||||
not replayed. Workspace conflicts are refused and journaled, not silently run
|
||||
concurrently or retried as agent work. Use separate workspaces for truly
|
||||
independent concurrent execution. **Refresh** in Schedules reloads its latest
|
||||
not replayed. A scheduled run whose workspace another run holds is delayed,
|
||||
never run concurrently: it is recorded as `delayed` in the schedule's history
|
||||
and tried again every 5 minutes for up to 2 hours (set
|
||||
`PIPELINES_SCHEDULE_BUSY_RETRY_EVERY` / `PIPELINES_SCHEDULE_BUSY_RETRY_FOR` on
|
||||
the server, as Go durations; `0` for FOR skips at once), then recorded as
|
||||
`started` or `skipped` with the reason. The operator gets a low-priority
|
||||
notification when a scheduled run is delayed or skipped. Use separate
|
||||
workspaces for truly independent concurrent execution. **Refresh** in Schedules reloads its latest
|
||||
configuration and next due times.
|
||||
|
||||
## JSON API / CLI automation
|
||||
|
||||
+27
-12
@@ -30,15 +30,26 @@ includes the same evidence under each step's `file_changes` field.
|
||||
conversion, `assume-unchanged`) is listed with `no_patch_reason: "baseline"`.
|
||||
- Added/deleted files and permission changes are recorded. Renames appear as
|
||||
deletion/addition. Binary changes retain metadata, not binary contents.
|
||||
- Symlinks, special files, common credential/environment/key/database paths,
|
||||
`secrets/`, Git internals and `node_modules/` are excluded. This is a path-based
|
||||
- Common credential/environment/key/database paths and `secrets/` are protected:
|
||||
never opened or listed. They are fingerprinted by metadata (size, mtime, mode)
|
||||
only, so an untouched `.env` no longer makes a capture partial; a change to one
|
||||
makes the visit `partial` (counted in `skipped`). This is a path-based
|
||||
precaution, **not secret-content scanning**; ordinary source patches may contain
|
||||
sensitive text and become part of retained history.
|
||||
- Limits: 10,000 inventoried entries, 1 MiB per file and 32 MiB per snapshot of
|
||||
retained text, 256 MiB per hashed file, five seconds per snapshot, 5,000
|
||||
combined lines per textual comparison, 64 KiB per patch and 128 KiB serialized
|
||||
file evidence per visit. Oversized, unreadable, omitted or truncated evidence
|
||||
is explicitly flagged partial.
|
||||
- Tool output is not stage work: untracked files below cache and dependency
|
||||
directories (`node_modules/`, `.git/`, `__pycache__/`, `.venv/`, `.mypy_cache/`,
|
||||
`.pytest_cache/`, `.ruff_cache/`, `.next/`, `.dart_tool/`, `.gradle/`, ...),
|
||||
untracked `*.pyc`, and untracked files below `build/`, `dist/`, `out/`,
|
||||
`target/` or `coverage/` where Git tracks nothing are left out of the
|
||||
inventory entirely. Outside Git the cache directories are not walked.
|
||||
- Symlinks are compared by their target (never followed) and listed with
|
||||
`no_patch_reason: "symlink"`; a path through a symlinked directory is skipped.
|
||||
- Limits: 20,000 inventoried entries, 1 MiB per file and 32 MiB per snapshot of
|
||||
retained text, five seconds per snapshot, 20,000 combined lines per textual
|
||||
comparison, 128 KiB per patch and 512 KiB serialized file evidence per visit.
|
||||
Files over 256 MiB are compared by size, mtime and mode
|
||||
(`no_patch_reason: "large"`). Unreadable, omitted or truncated evidence is
|
||||
explicitly flagged partial.
|
||||
- Over-budget content degrades to a listing, not silence: a text file over 1 MiB,
|
||||
or beyond the 32 MiB snapshot budget, is still compared by SHA-256 and a change
|
||||
is listed with `no_patch: true` (and `truncated`) but no patch. In a Git working
|
||||
@@ -46,12 +57,16 @@ includes the same evidence under each step's `file_changes` field.
|
||||
or past the time/file limit) is listed the same way when its
|
||||
`git status --porcelain` entry changed during the visit; a path dirty with the
|
||||
same status before and after cannot be proven changed and stays in `skipped`.
|
||||
Git is only read (`--no-optional-locks`); protected paths are never listed.
|
||||
Git is only read (`--no-optional-locks`); protected and excluded paths are
|
||||
never listed.
|
||||
- Each content change without a (complete) patch carries `no_patch_reason`:
|
||||
`binary`, `file_size` (text over 1 MiB), `budget` (32 MiB snapshot text
|
||||
budget), `lines` (over 5,000 combined lines), `evidence_size` (per-visit
|
||||
retained evidence limit), `git_status` (seen only in Git status) or `baseline`.
|
||||
Binary changes stay `complete`; the others make the visit `partial`.
|
||||
`binary`, `symlink`, `large`, `generated` (lockfiles such as `go.sum` or
|
||||
`package-lock.json`, `*.min.js`, source maps, files below a cache directory),
|
||||
`file_size` (text over 1 MiB), `budget` (32 MiB snapshot text budget), `lines`
|
||||
(over 20,000 combined lines), `evidence_size` (per-visit retained evidence
|
||||
limit), `git_status` (seen only in Git status) or `baseline`. `binary`,
|
||||
`symlink`, `large` and `generated` changes are listed completely and stay
|
||||
`complete`; the others make the visit `partial`.
|
||||
- `pipelines inspect RUN_ID --json` carries a top-level `warnings` list (also
|
||||
printed to stderr) naming every visit whose capture was partial or unavailable.
|
||||
- Failed/canceled stages still retain changes when execution returns. Unconfirmed
|
||||
|
||||
Reference in New Issue
Block a user