Commit graph

4047 commits

Author SHA1 Message Date
Bryan Helmkamp
78fea736e3
fix: harden stage execution identity on resume 2026-07-24 09:37:05 -04:00
Bryan Helmkamp
cd706646c6
feat: treat resumed in-flight nodes as new stage executions
A node cancelled (or lost to a crash) mid-flight and then resumed now
starts a new stage execution with the next StageId ordinal (work@2)
instead of reusing and clearing the cancelled execution's projection.
The old execution stays immutable with its own events, session, output,
timing, billing, and termination state.

Engine:
- Add a run-scoped StageExecutionTracker on RunServices with per-node
  high-water marks. Ordinals are reserved after the StageStart hook
  passes on the first attempt (retries reuse the reservation), ensured
  at the composite checkpoint pre-step for hook-skips, and reserved in
  on_terminal_reached for terminal nodes' synthetic events.
- Keep three concepts distinct: graph visit (max_visits/checkpoints,
  unchanged), stage execution ordinal (the @N in StageId), and handler
  attempt. The tracker is not checkpointed; the append-only stage event
  history is its durable source of truth.
- resume() seeds the allocator from the run projection and computes a
  node -> StageId provenance map of executions observed after the
  selected checkpoint, threaded through execute_persisted_run,
  RunSession, and InitOptions.

Events and projections:
- stage.started, parallel.branch.started, and checkpoint.completed
  carry optional graph_visit and resumed_from_stage_id; StageProjection
  stores both. Old events deserialize with None and legacy duplicate
  stage.started replays keep last-attempt behavior.
- The CheckpointCompleted reducer is envelope-first: diffs and
  skipped-stage synthesis attach to the exact execution StageId, an
  existing Retrying projection finalizes as Skipped without losing
  identity, and historical node_outcomes no longer create or collide
  with newer ordinals (node_visits remains a legacy fallback).

Handlers:
- Parallel fan-out reserves child ordinals through the shared tracker,
  derives worktree pass{N} from the parent's execution ordinal, and
  seeds branch contexts with explicit child stage scopes so branch
  lifecycle and nested handler events agree.
- Artifact capture and manager-loop child logs follow the ordinal.

API and UI:
- RunStage documents visit as the execution ordinal and adds optional
  graph_visit and resumed_from_stage_id; Rust and TypeScript clients
  regenerated.
- The web sidebar lists both executions chronologically; resumed stages
  show a "Resumed from" link in the stage detail header and hover
  popover, with the graph visit surfaced when it diverges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 09:00:37 -04:00
Bryan Helmkamp
9afd456c06
Merge pull request #610 from fabro-sh/feat/portable-model-aliases
Add portable model aliases
2026-07-24 07:39:05 -04:00
Bryan Helmkamp
a7e3bcec7c
Merge pull request #613 from fabro-sh/feat/poolside-provider-logo
Add Poolside provider logo
2026-07-24 07:38:56 -04:00
Bryan Helmkamp
377eb961ec
feat: add Poolside provider logo
Adapted from poolside's official favicon mark: monochrome
fill="currentColor" at 24x24 to match the other provider logos, with the
brand's gradient-fade tail preserved via the original alpha mask.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 07:26:22 -04:00
Bryan Helmkamp
05fa485637
feat: add portable GLM and DeepSeek aliases 2026-07-24 07:07:56 -04:00
Bryan Helmkamp
27cf30ff8b
feat: add GPT-5.6 name aliases 2026-07-24 06:33:22 -04:00
fabro-releases[bot]
df3c834581 Bump version to 0.304.0-nightly.0 2026-07-24 01:48:13 +00:00
Bryan Helmkamp
5aaddd344e
Merge pull request #606 from fabro-sh/fix/cancellation-interrupt-lifecycle
Harden cancellation and interrupt lifecycles
2026-07-23 21:33:24 -04:00
Bryan Helmkamp
22238575ac
fix: report delete-specific run errors 2026-07-23 21:27:58 -04:00
Bryan Helmkamp
9adf24348b
refactor: simplify cancellation lifecycle code from review
- Extract the quadruplicated watchdog check-and-clear logic in
  schedule_worker_cancel_escalation into ManagedRun methods
  (escalation_still_current, clear_escalation_for)
- Derive strum::IntoStaticStr for WorkerRef instead of a hand-written
  variant-to-string match in kind()
- Use the generated AgentControlState constant instead of the raw
  "waiting_for_steer" literal in run-detail.tsx
- Replace optimisticCancellationRunId state with a boolean; the
  component is keyed by run id, so the stored id could only ever be
  this run's own

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 21:15:35 -04:00
Bryan Helmkamp
84c5468722
Merge remote-tracking branch 'origin/main' into fix/cancellation-interrupt-lifecycle
# Conflicts:
#	lib/components/fabro-agent/src/subagent.rs
#	lib/components/fabro-agent/tests/it/parity_matrix.rs
2026-07-23 20:55:25 -04:00
Bryan Helmkamp
5cf1c7d183
Harden cancellation and interrupt lifecycles 2026-07-23 20:40:22 -04:00
Bryan Helmkamp
db473da2f3
Merge pull request #605 from fabro-sh/fix/remove-dead-agent-turn-limits
Remove dead agent execution limits
2026-07-23 20:15:39 -04:00
Bryan Helmkamp
7c771fc5d7
test(twin-openai): accept tool call histories 2026-07-23 20:11:21 -04:00
Bryan Helmkamp
67644c7c3c
Merge pull request #602 from fabro-sh/fix/openrouter-anthropic-prompt-caching
fix(llm): send cache_control breakpoints for Claude via OpenRouter
2026-07-23 20:06:10 -04:00
Bryan Helmkamp
43dcfa3b09
Merge pull request #604 from fabro-sh/fix/root-agent-todo-projection
Fix root-agent TODO projection ownership
2026-07-23 20:06:01 -04:00
Bryan Helmkamp
cdf1dce4f8
fix(agent): remove dead execution limits 2026-07-23 19:36:29 -04:00
Bryan Helmkamp
78718c101a
Merge remote-tracking branch 'origin/main' into fix/root-agent-todo-projection 2026-07-23 19:30:35 -04:00
Bryan Helmkamp
3c33e0fb69
Merge origin/main (three-layer crate layout) into fix/openrouter-anthropic-prompt-caching
The crate reorganization renamed lib/crates/ to lib/apps|components|foundation/.
Git followed all modified files across the rename; the only conflict was the
newly added codec/cache.rs, now placed at lib/components/fabro-llm/src/codec/cache.rs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 19:30:20 -04:00
Bryan Helmkamp
62c4ccaa93
Merge pull request #603 from fabro-sh/refactor/three-layer-crate-layout
Some checks are pending
Rust / Format (push) Waiting to run
Rust / Clippy (push) Waiting to run
Rust / Test (Linux) (push) Waiting to run
Rust / Test (macOS) (push) Waiting to run
TypeScript / Typecheck (push) Waiting to run
TypeScript / Test (push) Waiting to run
TypeScript / Build (push) Waiting to run
Rust / Generated Docs (push) Waiting to run
refactor: organize crates into apps, components, and foundation
2026-07-23 19:27:55 -04:00
Bryan Helmkamp
d8d1c14116
Clarify stage TODO ownership and plan guidance 2026-07-23 18:23:37 -04:00
Bryan Helmkamp
e6e6fd21dd
test(llm): add live OpenRouter Claude prompt-caching round trip
Reuses run_multi_turn_cache_test — the same live cache verification the
anthropic, openai, and gemini routes already have. OpenRouter was the
one caching route with no live caller, which is exactly where the
missing-breakpoints bug hid: unit and wire tests prove we now send
cache_control, but only a live call proves OpenRouter forwards it to
Anthropic and cache reads actually appear.

Runs with: set -a && source .env && set +a && \
  cargo nextest run -p fabro-llm --profile e2e --run-ignored only \
  -E 'test(openrouter_claude_multi_turn_cache)'

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 18:09:25 -04:00
Bryan Helmkamp
5c55b0c074
Fix stage TODO projection ownership 2026-07-23 18:05:22 -04:00
Bryan Helmkamp
e78f5ff957
Fix cancellation during subagent waits 2026-07-23 18:04:58 -04:00
Scott Werner
47bc772f7b refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
Bryan Helmkamp
e5f0290229
fix(llm): send cache_control breakpoints for Claude via OpenRouter
Anthropic prompt caching is opt-in per request: without explicit
ephemeral cache_control breakpoints in the body, no cache writes or
reads ever happen. The OpenAI-compatible codec never emitted them, so
every run on openrouter Claude models billed the full conversation at
the uncached input rate on every turn (0 cache tokens on the billing
page, confirmed by OpenRouter's activity portal).

- Add a `cache_control_breakpoints` model feature declaring that a
  route only caches when the request marks the cacheable prefix; set it
  on the builtin OpenRouter Claude rows. Catalog build rejects the flag
  without `prompt_cache`.
- Teach the Chat Completions wire shape a parts-form content variant so
  a message can carry the annotation; unmarked messages keep the
  plain-string form for compatibility with strict servers.
- Mark the last system message (covers tools + system upstream) and the
  second-to-last user turn, counting tool results as user turns —
  mirroring the anthropic codec's placement so agent loops get
  incremental cache hits.
- Extract the shared placement/opt-out policy into codec::cache and
  refactor the anthropic codec onto it; anthropic wire snapshots are
  unchanged.
- Honor `provider_options.<name>.auto_cache = false` as an opt-out and
  consume the control key instead of merging it into the body.
- Mirror the new feature through settings (fabro-config), the OpenAPI
  schema, and the generated TypeScript client.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 17:55:41 -04:00
Bryan Helmkamp
d96381c897
Merge pull request #599 from fabro-sh/fabro/run/01KY7WQ92JWT90307EBQY6P2HV
Add `output_schema` support on command (parallelogram) nodes
2026-07-23 17:36:37 -04:00
Bryan Helmkamp
7bdee5b494
Merge remote-tracking branch 'origin/main' into pr-599
# Conflicts:
#	docs/public/agents/outputs.mdx
#	docs/public/reference/dot-language.mdx
2026-07-23 17:24:33 -04:00
Bryan Helmkamp
b558af070f
Merge pull request #601 from fabro-sh/fabro/run/01KY7Y01REECZ24XXTMBZ3PPV9
Provider-scoped model catalog: `(provider, model slug)` as stable ident…
2026-07-23 17:14:51 -04:00
Bryan Helmkamp
b33a38e459
Merge pull request #600 from fabro-sh/fix/last-file-routing-fallback
fix(workflow): constrain last-file routing fallback
2026-07-23 17:13:50 -04:00
Fabro
fd48267423 fabro(01KY7Y01REECZ24XXTMBZ3PPV9): verify (succeeded)
Fabro-Run: 01KY7Y01REECZ24XXTMBZ3PPV9
Fabro-Completed: 10
Fabro-Checkpoint: cecbfc763b

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 20:57:21 +00:00
Fabro
000085cb52 Merge remote-tracking branch 'origin/main' into fabro/run/01KY7Y01REECZ24XXTMBZ3PPV9 2026-07-23 20:51:45 +00:00
Fabro
a58d65fd3c fabro(01KY7Y01REECZ24XXTMBZ3PPV9): fixup (succeeded)
Fabro-Run: 01KY7Y01REECZ24XXTMBZ3PPV9
Fabro-Completed: 9
Fabro-Checkpoint: 3cefb504a7

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 20:51:43 +00:00
Bryan Helmkamp
e736786bf2
fix(test): eliminate install and session-root races 2026-07-23 16:46:40 -04:00
Fabro
a89528caa6 fabro(01KY7Y01REECZ24XXTMBZ3PPV9): verify (failed)
Fabro-Run: 01KY7Y01REECZ24XXTMBZ3PPV9
Fabro-Completed: 8
Fabro-Checkpoint: 69abcb72b5

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 20:33:27 +00:00
Fabro
b3e085dc45 Merge remote-tracking branch 'origin/main' into fabro/run/01KY7Y01REECZ24XXTMBZ3PPV9 2026-07-23 20:29:21 +00:00
Fabro
9b85653a2d fabro(01KY7Y01REECZ24XXTMBZ3PPV9): simplify_sol (succeeded)
Fabro-Run: 01KY7Y01REECZ24XXTMBZ3PPV9
Fabro-Completed: 7
Fabro-Checkpoint: 334aea8fdc

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 20:29:19 +00:00
fabro-releases[bot]
8c37f5fae5 Bump version to 0.303.0-nightly.4 2026-07-23 20:10:14 +00:00
Bryan Helmkamp
6f8576f15c
fix(manifest): bundle output schema file references 2026-07-23 15:54:24 -04:00
Bryan Helmkamp
c9b5303128
fix(workflow): flush agent events before stage completion 2026-07-23 15:52:25 -04:00
Bryan Helmkamp
886371e474
refactor(workflow): clean up last-file routing fallback review nits
Document the contract of read_last_file_routing_json (terminal JSON
extraction only; routing validation happens downstream), extract a
shared sandbox_with_file test helper, and drop the misleading
"standalone" wording from the fallback docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 15:47:17 -04:00
Bryan Helmkamp
02437fb18a
fix(workflow): constrain last-file routing fallback 2026-07-23 15:28:19 -04:00
Bryan Helmkamp
7ff153d222
chore: bump verify timeout to 20m 2026-07-23 15:21:56 -04:00
Fabro
fe5ed3fcec fabro(01KY7WQ92JWT90307EBQY6P2HV): verify (succeeded)
Fabro-Run: 01KY7WQ92JWT90307EBQY6P2HV
Fabro-Completed: 10

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 19:15:12 +00:00
Fabro
56119990be fabro(01KY7Y01REECZ24XXTMBZ3PPV9): simplify_fable (succeeded)
Fabro-Run: 01KY7Y01REECZ24XXTMBZ3PPV9
Fabro-Completed: 6
Fabro-Checkpoint: 497f92f4d9

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 19:10:39 +00:00
Fabro
51853779bb fabro(01KY7WQ92JWT90307EBQY6P2HV): fixup (succeeded)
Fabro-Run: 01KY7WQ92JWT90307EBQY6P2HV
Fabro-Completed: 9

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 19:09:17 +00:00
Fabro
bd7c51235f Merge remote-tracking branch 'origin/main' into fabro/run/01KY7WQ92JWT90307EBQY6P2HV 2026-07-23 19:02:19 +00:00
Fabro
5c7ac5da2e fabro(01KY7WQ92JWT90307EBQY6P2HV): verify (failed)
Fabro-Run: 01KY7WQ92JWT90307EBQY6P2HV
Fabro-Completed: 8

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-23 19:02:01 +00:00
Bryan Helmkamp
e75c3dcd37
fix(test): replay SSE events before asserting stage types 2026-07-23 14:58:01 -04:00