Commit graph

4560 commits

Author SHA1 Message Date
Bryan Helmkamp
641539dd4b
refactor(llm): tighten Modal reasoning token tests
Replace the two envelope-level tests with focused `ApiUsage` tests that
match the file's existing `token_counts_*` convention.

The streaming and non-streaming tests were the same test paid for twice:
`ApiResponse::usage` and `StreamChunk::usage` are both `Option<ApiUsage>`,
so the envelope cannot change the result. Envelope-level usage decoding is
already covered by `stream_chunk_usage_parsing`.

Also pin the precedence rule this change introduces — nested detail wins
over the flat spelling, and an empty `completion_tokens_details` still
falls back — and document it on `token_counts`. Revert the unrelated
`cost` doc edit that dropped the OpenRouter reference.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:44:13 -04:00
Bryan Helmkamp
f4cd7c5238
refactor: make the output contract a method on OutputSchemaKind
Both contract helpers dispatched on OutputSchemaKind, so they belong on
the type. Moves expectation() and agent_prompt() into an impl block and
drops the free functions.

Splits the combined agent test: assertions no longer run inside the
backend's run(), where a failure surfaces as a panic from execute().
Adds coverage for the Routing branch of the contract, which was
previously untested.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:42:29 -04:00
Bryan Helmkamp
33e5dc8d3f
Merge pull request #695 from fabro-sh/fix/modal-provider-catalog
Prioritize Modal and rename Kimi provider to Moonshot
2026-08-01 09:38:22 -04:00
Bryan Helmkamp
75a912f130
Merge pull request #702 from fabro-sh/fix/large-stage-event-payloads
Omit current.preamble from stage.completed events
2026-08-01 09:34:59 -04:00
Bryan Helmkamp
82ae10d0f8
Merge remote-tracking branch 'origin/main' into fix/modal-reasoning-token-usage
# Conflicts:
#	lib/components/fabro-llm/src/codec/openai_compatible/wire.rs
2026-08-01 09:34:11 -04:00
Bryan Helmkamp
cc590f6f97
Merge remote-tracking branch 'origin/main' into fix/modal-provider-catalog
Resolve the model catalog table conflict in docs/public/core-concepts/models.mdx
by keeping both changes: this branch's `kimi` -> `moonshot` provider rename for
the Kimi rows, and main's new DeepSeek V4 rows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:32:19 -04:00
Bryan Helmkamp
a4fbf3e900
Merge pull request #710 from fabro-sh/fix/unify-provider-error-code-classification
fix(llm): classify provider error codes through one shared table
2026-08-01 09:30:53 -04:00
Bryan Helmkamp
0de3817836
Merge branch 'main' into fix/human-input-timeout-accounting 2026-08-01 09:30:37 -04:00
Bryan Helmkamp
61780d529e
Merge pull request #699 from fabro-sh/steer-bar-default-closed
Collapse the steering bar by default and expand it on bar click
2026-08-01 09:29:50 -04:00
Bryan Helmkamp
20d3aa5cdd
Merge pull request #705 from fabro-sh/feat/download-all-artifacts
Download latest artifacts as a ZIP
2026-08-01 09:28:16 -04:00
Bryan Helmkamp
97aeb5631d
refactor(llm): tighten provider error classification 2026-08-01 09:26:47 -04:00
Bryan Helmkamp
24cd22d793
Merge pull request #703 from fabro-sh/fix/mcp-restart-after-upgrade-697
Fix stale MCP servers after upgrades
2026-08-01 09:26:26 -04:00
Bryan Helmkamp
a78750fa97
Update attach snapshot and soften context_values wording
The preamble removal changed the `stage.completed` payload, so the
`attach --json` inline snapshot no longer matched. Drop the stale
`current.preamble` line.

Reword the `context_values` doc row. `stage_context_values` only strips
runtime-only keys; it does not normalize artifact pointers to blob refs
the way `artifact::durable_context_snapshot` does, so calling it a
durable snapshot overstated it. Point readers at `checkpoint.completed`
for the durable projection.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:26:13 -04:00
Release Repro
4cb983ce1d
Guard steering bar click target 2026-08-01 09:24:34 -04:00
Bryan Helmkamp
641b450626
Merge pull request #698 from fabro-sh/fix/daytona-permission-compat
fix(daytona): accept newer permission scopes
2026-08-01 09:23:38 -04:00
Bryan Helmkamp
f97156d299
Merge pull request #709 from fabro-sh/fix/actionable-structured-output-errors
Make structured output repair errors actionable
2026-08-01 09:22:28 -04:00
Bryan Helmkamp
bcf9b26b22 Remove prompt offloading from stage payload fix 2026-08-01 09:21:24 -04:00
Bryan Helmkamp
1884a4b072 Reduce large stage event payloads 2026-08-01 09:21:24 -04:00
Bryan Helmkamp
1d1894ccfe
Merge pull request #700 from fabro-sh/fix/canceled-parallel-duration-event-errors
Fix canceled parallel durations and event persistence logging
2026-08-01 09:21:20 -04:00
Bryan Helmkamp
8b767c658b
fix: make the artifact tie-break match the artifacts page
Two artifacts can share a filename, a retry, and an absent stage, in
which case the winner was whichever the object store listed first. Break
the tie on the serialized stage ID, which is the third key the artifacts
page sorts on. Compare the `node@visit` string rather than StageId's own
ordering: the page compares the string, so "unknown@2" beats
"unknown@10" there and now here too.

The spec said captures from the `start` and `exit` nodes are excluded,
but the exclusion is by handler type, so a node named `start` that does
real work keeps its artifacts. Say that instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:20:40 -04:00
Bryan Helmkamp
baca460177
Merge pull request #711 from fabro-sh/remove-dead-docker-image-arg
Remove obsolete per-run Docker image argument
2026-08-01 09:19:35 -04:00
Bryan Helmkamp
2adb44707d
Address Copilot review comments
Raise the replacement test's deadline to 20s. The server takes up to 1s to
notice the replacement and then bounds its own shutdown at 5s, so the old
5s deadline sat below the worst case and could fail a healthy server on a
loaded runner. A passing run still exits in about a second.

Reword the SHUTDOWN_TIMEOUT comment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:18:57 -04:00
Bryan Helmkamp
c738130e53
fix: sort unexpected properties before comparing repair attempts
Addresses Copilot review feedback on the repeated-failure check.

serde_json runs with preserve_order, and jsonschema builds the
additionalProperties `unexpected` list by walking the instance in
document order. So the same leftover keys emitted in a different order
produced a different Vec and compared as a different problem, which
suppressed the "unchanged from your previous repair" nudge.

Sorting at capture also makes the MAX_UNEXPECTED_PROPERTIES truncation
pick the same subset every time instead of an order-dependent one, and
stabilizes the rendered message.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 09:18:38 -04:00
Bryan Helmkamp
b834e0bda3
perf: batch archive writes and tolerate a vanished artifact
Deflate flushes its output in 8 KiB blocks, and each write became its own
allocation, channel send, and HTTP body frame. A 64 KiB BufWriter in
front of the sink cuts all three by eight.

An artifact deleted between the listing and its read no longer aborts the
whole archive. That race is a run being pruned mid-download; leaving the
file out beats handing back a truncated ZIP missing everything after it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:12:27 -04:00
Bryan Helmkamp
14cf4f3e94
Simplify MCP executable monitoring
Exit the process from `main` for every command instead of returning. The
`mcp start` command parks Tokio's stdin reader on a read only the MCP host
can end, so dropping the runtime waits forever. Exiting in `main` also keeps
the CLI telemetry event, which the previous exit inside the MCP command
skipped.

That removes the reason for the `McpServerExit` enum, whose only job was to
carry an implementation detail out to the CLI so it could exit.

Watch the executable through its device and inode on Unix. That is a
complete file identity, so the length and modification time no longer add
anything. Drop the PATH scan: `current_exe` reports the symlink itself on
macOS, so it detects a Homebrew relink without it. This also drops the
`fabro-static` dependency and a clippy suppression.

Bound the shutdown wait after an upgrade is detected. The transport closes
by writing to a stdout the host may already have stopped reading, which
could hang the exit the change is supposed to trigger.

Log a warning when upgrade detection cannot start, rather than disabling it
silently.

Share one spawn helper between the two raw stdio tests, and link the test
executable instead of copying 200 MB of binary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:10:28 -04:00
Bryan Helmkamp
daaca3f479
refactor: simplify artifact ZIP download
Path safety now lives in one place. The NUL-byte and drive-letter rules
move from a server-only helper into the store's own filename validation,
so uploads reject those paths at write time instead of only the ZIP read
path catching them. The download still re-checks, because artifacts
stored before the rule existed can still carry an unsafe path, but it
now skips a bad path rather than failing the whole archive.

Promote is_boundary_stage to RunProjection and drop the three identical
private copies. The ZIP download used a node-name match instead, which
would have dropped artifacts from a working node that happened to be
named "start".

Compress the archive. Entries were Stored while the response was also
excluded from transfer compression, so text artifacts moved at full
size. async_zip gains the deflate feature; async-compression and flate2
were already in the lock file.

Log archive failures unconditionally. The send-succeeded guard meant a
client that had already disconnected left no record at all, which is the
case where the log is the only evidence.

Also: collapse the duplicate 500 arms, drop the dead stage-ID tiebreaker
and the cached order in the selection map, name the accessible label
after the visible one, share the run URL prefix between the two download
href builders, and document the mid-stream truncation behavior in the
OpenAPI description.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:09:54 -04:00
Bryan Helmkamp
dc46d183b0
fix(llm): classify provider error codes through one shared table
Three places translated a provider error code into a ProviderErrorKind:
error_from_status_code for HTTP error bodies, and a private table in each
of the openai_responses and anthropic_messages stream decoders. The tables
disagreed, so the same failure classified differently depending on which
path saw it.

Most visibly, OpenAI returns HTTP 429 with error.type "insufficient_quota"
when an account is out of credit. The streaming decoder mapped that to
QuotaExceeded, but the non-streaming path fell through to the plain
429 => RateLimit arm, so a spent quota was retried with backoff and never
triggered failover.

Move the code table into error.rs as kind_from_error_code, returning None
when the code says nothing so each caller keeps its own default. All three
call sites now share it.

In error_from_status_code, unambiguous statuses (401, 403, 404, 408, 413,
5xx) still win outright. A 429 defers to the code only when it reports a
spent quota. Ambiguous statuses (400, 422, ...) prefer the structured code
over the existing message-substring guessing, which now runs only when
there is no code.

Two classifications improve as a side effect of merging the tables:
not_found_error now maps to NotFound rather than Server for openai, and
request_too_large maps to ContextLength rather than InvalidRequest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 09:04:36 -04:00
Bryan Helmkamp
0e0dfe4f9d
refactor: simplify structured output error rendering
Follow-up review of the repair-error work. Behavior is the same or better;
the machinery is smaller.

Fixes a false "unchanged from your previous repair" nudge. same_problem_as
fell through to `_ => true`, so any two non-Required issues at the same
instance path, schema path and keyword compared equal. A model that removed
one unexpected property and added another was told it had changed nothing.
SchemaValidationIssue already derives PartialEq, so the 17-line comparison
is now `previous.contains(issue)`.

Drops the hand-written Type and Enum rendering. jsonschema already renders
both, and its messages name the offending value, which the hand-written
ones did not. Also switches masked() back to to_string(): masking replaced
the bad value with a placeholder, working against the goal of an actionable
message, and buys no privacy since the full response is already in the
prompt.

Resolves the schema fragment when the issue is captured rather than
threading Option<&OutputSchemaKind> through rendering. That reverts the
command.rs change and drops the test-only messages() shim. The fragment is
now attached only to Other, where it adds information; for required, type,
enum and additionalProperties it just repeated the prose.

Also: caps the model-controlled unexpected-property list so a wide object
cannot turn the repair prompt into megabytes; drops evaluation_path, which
was dead except under $ref, where it printed a pointer that does not
resolve; drops the keyword field, already named by the schema path; and
records the previous error only after the agent session accepted the
repair, since failover rebuilds the session from the original prompt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 09:04:28 -04:00
Scott Werner
e4541f8eb3 Regenerate TypeScript API client 2026-08-01 09:03:10 -04:00
Scott Werner
42dcb410f2 Remove obsolete manifest Docker image argument 2026-08-01 09:03:10 -04:00
Release Repro
8db771bbd0
Simplify parallel duration and event failure logging
The parallel stage summary rendered a Duration tile directly below
StageMetaBar, which already shows the same stage's duration with a live
ticking clock and a started-at tooltip. The two disagreed while running:
the meta bar counted up, the tile showed the static word "running". The
cancelled-stage bug lived only in the duplicate.

Drop the tile. The meta bar owns duration for every stage renderer, and
it was already correct for cancelled, pending and skipped stages. That
removes the three-way duration branch, the "--" sentinel decode, and the
ACTIVE_STAGE_STATES and formatDurationMs imports.

With the tile gone, ParallelOverview.durationMs is dead, as were
successCount, failureCount and isComplete — the renderer counts the
branch rows it draws. ParallelOverview reduces to branch identity.

For run event write failures, log the first at error with run_id and
event name, the rest at debug, and summarize new losses at flush. A
broken sink fails for every event, so a bare error would emit one
"investigate me" line per event for the life of the run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 08:57:47 -04:00
Bryan Helmkamp
f0f1baa813
Merge pull request #701 from fabro-sh/fix/quota-error-classification
fix(llm): classify exceeded quota errors
2026-08-01 08:42:57 -04:00
Bryan Helmkamp
bf913ec58e
Merge pull request #685 from fabro-sh/fabro/run/01KYQMV1VW6139EGNHEM1RGF2G
Reject invalid run events before write; clarify append commit status
2026-08-01 08:21:59 -04:00
fabro-releases[bot]
d0ebc856b7 Bump version to 0.312.0-nightly.0 2026-08-01 09:55:00 +00:00
Bryan Helmkamp
5111f0e556
Merge pull request #707 from swerner/fix/bedrock-tool-sanitization
Some checks are pending
Rust / Format (push) Waiting to run
Rust / Clippy (push) Waiting to run
Rust / Generated Docs (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
Sanitize Bedrock tool identifiers during encoding
2026-07-31 18:09:33 -04:00
Scott Werner
594bf6e632 refactor(llm): simplify Bedrock tool sanitization internals
- Return String from the sanitize helpers instead of Cow: every call
  site feeds the result into json!, which allocates anyway, so the
  borrowed fast path only cost extra branches and Cow-variant tests.
- Route all toolUse/toolResult construction through private
  tool_use_block/tool_result_block constructors that own the sanitize
  calls, so the toolUse/toolResult pairing invariant is enforced by
  construction rather than by call-site discipline.
- Drop a test assertion the type system already guarantees (encoding
  takes &Request, so it cannot mutate the input) and assert wiring
  tests against the sanitize helpers instead of re-pinning the exact
  replacement literals in a second file.

No wire-format changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 17:43:22 -04:00
Bryan Helmkamp
9ef8742d5d
Merge pull request #687 from fabro-sh/fabro/run/01KYQN78K19NY7PNSCDYP6CG9G
Extract a source-neutral run-compiler boundary in fabro-server
2026-07-31 17:11:33 -04:00
Bryan Helmkamp
cb45e176ac
Merge pull request #704 from fabro-sh/feat/deepseek-v4-flash
feat(llm): support DeepSeek V4 Flash
2026-07-31 16:52:50 -04:00
Bryan Helmkamp
f75c7a1ba3
fix: make structured output repair errors actionable 2026-07-31 16:33:20 -04:00
Scott Werner
913cb190b7 Sanitize Bedrock tool identifiers during encoding 2026-07-31 15:06:05 -04:00
Fabro
8282581ac7 fabro(01KYQN78K19NY7PNSCDYP6CG9G): verify (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 10

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:14:25 -04:00
Fabro
4b56aa4f1a fabro(01KYQN78K19NY7PNSCDYP6CG9G): fixup (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 9

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:32 -04:00
Fabro
61764bf15b fabro(01KYQN78K19NY7PNSCDYP6CG9G): verify (failed)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 8

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:32 -04:00
Fabro
bca63e75c6 fabro(01KYQN78K19NY7PNSCDYP6CG9G): simplify_sol (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 7

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:32 -04:00
Fabro
76f61f163b fabro(01KYQN78K19NY7PNSCDYP6CG9G): simplify_fable (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 6
Fabro-Checkpoint: 1254f4ca92f7b1f822cdfa7ca549ef8595a50fed

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:32 -04:00
Fabro
ac6e3ced6a fabro(01KYQN78K19NY7PNSCDYP6CG9G): implement (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 5
Fabro-Checkpoint: 879008d9d5

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:32 -04:00
Fabro
0815f9fa8f fabro(01KYQN78K19NY7PNSCDYP6CG9G): preflight_lint (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 4
Fabro-Checkpoint: 3149893056

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:11 -04:00
Fabro
ffc26328ee fabro(01KYQN78K19NY7PNSCDYP6CG9G): preflight_compile (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 3
Fabro-Checkpoint: 9b9950dd2d

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:11 -04:00
Fabro
bf347b3e0d fabro(01KYQN78K19NY7PNSCDYP6CG9G): toolchain (succeeded)
Fabro-Run: 01KYQN78K19NY7PNSCDYP6CG9G
Fabro-Completed: 2
Fabro-Checkpoint: f5ac83dc54

⚒️ Generated with [Fabro](https://fabro.sh)
2026-07-31 14:09:11 -04:00
Bryan Helmkamp
980aabc543
feat: download latest artifacts as zip 2026-07-31 13:23:35 -04:00