Commit graph

559 commits

Author SHA1 Message Date
Bryan Helmkamp
fea64a105b
Integrate twin-github for fabro-github tests
Add the stripped twin-github test server to the workspace, wire it through
fabro-test, and cover fabro-github's real HTTP auth and pull-request flows
with twin-backed integration tests. This also refactors the GitHub helper
entry points to take explicit base URLs so tests and callers share the same
request path.
2026-04-01 09:48:33 -04:00
Bryan Helmkamp
a496c243f4
Remove auto dry-run when LLM providers are missing
Previously, workflows silently fell back to dry-run mode when no LLM
providers were configured or client init failed. This caused command-only
workflows to skip execution entirely. Now missing LLM providers produce
a hard error when the graph has LLM nodes, and are ignored when it doesn't.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:34:20 -04:00
Bryan Helmkamp
f0ebf341db
Optimize slow Docker and real CLI tests
- Move real_cli_claude/codex/gemini tests from fabro-workflow to fabro-cli,
  which has a 20s nextest timeout (vs 6s default), and add poll_interval(10ms)
- Reduce DockerSandbox stop_container grace period from 5s to 1s
- Reduce timeout_handling test sleep from 60s to 2s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 22:19:51 -04:00
Bryan Helmkamp
6383e7037b
Add twin test mode for OpenAI E2E tests
Integrate twin-openai (fake OpenAI server) into the workspace and wire
it into the e2e_test macro so OpenAI tests can run without real API
credentials. The twin server starts in-process via OnceLock on first use
and provides per-test isolation through bearer-token namespacing.

Changes:
- Add Twin as default TestMode, replacing Off (gating now via #[ignore])
- Extend #[e2e_test] macro with `twin` requirement for twin-only,
  live-only, and dual-mode (twin + live) test gating
- Add e2e_openai!() macro returning (base_url, api_key)
- Convert openai_complete and openai_gpt_5_3_codex_complete to dual-mode
- Add new openai_server_error twin-only test with scripted 500 error
- Standardize axum 0.8 as workspace dependency across all crates
- Relax twin-openai ResponsesRequest to accept unknown fields via flatten

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:36:48 -04:00
Bryan Helmkamp
b5e5b91d51
Default TestContext::command() working directory to temp_dir
Tests were flaky because command() inherited the real repo as the
working directory. When the repo was clean, detached runs attempted
git worktree creation against it, sometimes failing and injecting
extra warning lines into snapshots.

Now command() defaults to the non-git temp_dir, eliminating this
class of flakiness. Tests needing a specific directory override with
.current_dir(). Also canonicalizes fixture paths and adds a
[FIXTURES] snapshot filter via test_context!() macro.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:36:48 -04:00
Bryan Helmkamp
e95f1a0386
Replace compact_progress_event with raw event snapshots
The compact_progress_event test helper cherry-picked fields and flattened
the properties wrapper, making snapshots misleadingly show a format that
doesn't match the actual fabro attach --json / progress.jsonl output.
Now snapshots show the real RunEventEnvelope structure with volatile
fields (id, ts, run_id, duration_ms) redacted via insta filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:31:13 -04:00
Bryan Helmkamp
e3ed586691
Prune stale git worktrees before branch creation in WorktreeSandbox
Stale worktree references from deleted temp directories kept branches
locked, causing "cannot force update the branch" errors on subsequent
runs with the same branch name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 13:44:01 -04:00
Bryan Helmkamp
c64639918e
Fix rewind snapshot filtering for short SHAs 2026-03-31 13:34:26 -04:00
Bryan Helmkamp
b9bdc81028
Fix workspace clippy issues in fabro-test 2026-03-31 13:33:20 -04:00
Bryan Helmkamp
0337e5ee96
Rename fabro-openai-oauth to fabro-oauth 2026-03-31 13:23:43 -04:00
Bryan Helmkamp
11c3ee8594
Speed up sleep-heavy test suites 2026-03-31 13:12:21 -04:00
Bryan Helmkamp
04ba232961
Fix flaky server tests by using explicit dry_run settings
These tests were racing against pipeline initialization (git worktree
creation, status checks) that runs before discovering no API keys and
falling back to dry-run mode. Using dry_run_settings() skips the
unnecessary git work upfront.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:16:52 -04:00
Bryan Helmkamp
501399cc8f
Fix logs --follow timeout by lowering SlateDB reader manifest poll interval
The default DbReaderOptions::manifest_poll_interval is 10s, which meant
the DbReader couldn't see conclusion/status updates from a detached run
until 10s after they were written. The nextest timeout (6s) fired first,
causing logs_follow_detached_run_streams_until_completion to always fail.
100ms is appropriate for local disk and in-memory object stores.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 10:45:34 -04:00
Bryan Helmkamp
08f340fc8f
Migrate provider_auth test to #[e2e_test] macro
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:48:20 -04:00
Bryan Helmkamp
a050269a52
Fix lint and test fallout 2026-03-31 09:47:50 -04:00
Bryan Helmkamp
a6829c57a0
Tighten non-interactive JSON mode 2026-03-31 09:47:50 -04:00
Bryan Helmkamp
fb6f0eae1e
Centralize E2E test env var handling 2026-03-31 09:30:38 -04:00
Bryan Helmkamp
7f2d840007
Fix clippy warnings and date-sensitive snapshot tests from --json rollout
Resolve clippy errors (absolute paths in main.rs/preflight.rs, collapsible
if in cli.rs, missing print_stdout allow) and stabilize snapshot tests that
hardcoded a date in dir_name by replacing with a date-prefix filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:07:06 -04:00
Bryan Helmkamp
3b26601f8e
Add global JSON output mode 2026-03-31 07:51:19 -04:00
Bryan Helmkamp
fab337fe23
Remove OpenAI-specific params from OAuth authorize URL
Strip non-standard query parameters (id_token_add_organizations,
codex_cli_simplified_flow, originator) from the OAuth authorize URL
to keep it compliant with standard OAuth 2.0 PKCE flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:37:24 -04:00
Bryan Helmkamp
6a3bafccd0
Split agent processing into thinking and executing 2026-03-30 19:56:38 -04:00
Bryan Helmkamp
3a74c51840
Allow GitHub and Slack base URLs to be overridden via env vars
Adds GITHUB_BASE_URL and SLACK_BASE_URL environment variable support
so integration tests can redirect traffic to fake servers instead of
hitting live third-party services.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 19:08:12 -04:00
Bryan Helmkamp
0b576079fb
Format workflow validation fixes 2026-03-30 19:00:06 -04:00
Bryan Helmkamp
d064b6c510
Stabilize merged workspace validation 2026-03-30 18:57:06 -04:00
Bryan Helmkamp
0313a1f4ee
Merge remote-tracking branch 'origin/main'
# Conflicts:
#	lib/crates/fabro-cli/tests/it/cmd/attach.rs
#	lib/crates/fabro-cli/tests/it/cmd/create.rs
#	lib/crates/fabro-cli/tests/it/cmd/resume.rs
#	lib/crates/fabro-cli/tests/it/cmd/start.rs
2026-03-30 18:26:57 -04:00
Bryan Helmkamp
c8a398d527
Add CLI integration test coverage 2026-03-30 18:23:24 -04:00
Bryan Helmkamp
1c85dbb367
Fix envelope event verification regressions 2026-03-30 17:38:57 -04:00
Bryan Helmkamp
f43fac10ce
Refactor run event envelopes and subagent linking 2026-03-30 17:09:07 -04:00
Bryan Helmkamp
bd82539516
Preserve metadata deserialize error details 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
e9d924fa63
Rename fabro-git-storage to fabro-checkpoint 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
62786ccf4b
Fix run progress replay durations 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
e93c13b9db
fmt 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
727c8ba1d3
Refactor run progress rendering 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
63a258829b
Reorganize CLI integration tests and document testing strategy 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
967b419339
Rename sandbox subcommand tests to follow namespace convention
Move ssh.rs, cp.rs, preview.rs to sandbox_ssh.rs, sandbox_cp.rs,
sandbox_preview.rs to match the naming convention used by other
namespaced tests (e.g. pr_close.rs, system_prune.rs). Use
context.command() + args instead of one-off helpers. Remove redundant
config_show.rs (duplicate of config.rs).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:17:39 -04:00
Bryan Helmkamp
0346edd112
Refactor run CLI tests to use snapshots 2026-03-30 16:17:38 -04:00
Bryan Helmkamp
6046203e42
Remove deprecated fabro init command
Users should use `fabro repo init` instead. The deprecation shim has
been in place long enough; remove it and update all docs references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:17:38 -04:00
Bryan Helmkamp
cee4a07750
Add fabro completion subcommand for shell completions
Uses clap_complete to generate tab-completion scripts for zsh, fish,
elvish, and PowerShell. Bash generation is caught gracefully since
clap_complete panics with #[command(flatten)] subcommands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:17:38 -04:00
Bryan Helmkamp
63176c99fb
Rename fabro serve to fabro server start
Restructure the flat `serve` command into a nested `server start`
subcommand, following the existing namespace pattern (system prune,
repo init, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:17:38 -04:00
Bryan Helmkamp
6757efc7f7
Prefix API routes with /api/v1 2026-03-30 16:17:06 -04:00
Bryan Helmkamp
d95dbacdeb
Rename fabro-workflows crate to fabro-workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:27:40 -04:00
Bryan Helmkamp
c96abfe4c4
Remove Sprites sandbox provider
Drop the Sprites (Fly.io microVM) sandbox provider entirely. Three
providers remain: Local, Docker, and Daytona.

- Delete lib/crates/fabro-sandbox/src/sprites/ module
- Remove sprites feature flag and dep comments from Cargo.toml
- Remove sprites module declaration from lib.rs
- Update resolve_path cfg guard to daytona-only
- Delete docs/integrations/sprites.mdx and remove nav entry
- Remove Sprites rows from provider tables in docs
- Clean up SDK reference and changelog mentions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:23:06 -04:00
Bryan Helmkamp
84195a183f
Remove SSH and Exe sandbox providers
Only three sandbox providers remain: Local, Docker, and Daytona.

- Move detect_clone_params and GitCloneParams from ssh_common into daytona module
- Delete ssh/, exe/, and ssh_common.rs implementation files
- Remove Exe/Ssh variants from SandboxProvider, SandboxSpec, CliSandboxProvider
- Remove data_host from Sandbox trait and SandboxRecord
- Remove ExeSettings, SshSettings, ExeConfig, SshConfig types
- Remove ssh/exe/exedev feature flags from all Cargo.toml files
- Remove openssh workspace dependency
- Remove ExeSettings/SshSettings from OpenAPI spec
- Update docs to remove SSH/Exe references, delete exe-dev.mdx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:17:20 -04:00
Bryan Helmkamp
615636c4e7
Move cp, ssh, preview under fabro sandbox namespace
These commands all operate on a run's sandbox environment. Grouping them
under `fabro sandbox` makes the mental model clear and avoids confusion
with `fabro asset cp`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:00:37 -04:00
Bryan Helmkamp
69510cd016
Fix warnings and stabilize dry-run snapshots 2026-03-30 11:51:25 -04:00
Bryan Helmkamp
a102557d32
Rename config show command to settings 2026-03-30 11:41:18 -04:00
Bryan Helmkamp
bec44709f5
Sort cmd/mod.rs module declarations alphabetically
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:41:18 -04:00
Bryan Helmkamp
8da8298ea5
Extract workflow E2E tests into workflow/ directory
Move the 6 parametrized workflow scenarios from scenario/workflows.rs
into a new workflow/ directory with one file per test. Move fixture
.fabro files from test/scenario/ to workflow/fixtures/ co-located with
the tests.

Rename the scenario_tests! macro to sandbox_tests! in the new module
for clarity. Slim scenario/ down to just lifecycle and exec tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:41:18 -04:00
Bryan Helmkamp
ef46c174b8
Add fabro-cli help snapshots for subcommands 2026-03-30 11:41:18 -04:00
Bryan Helmkamp
90fc680609
Split scenario.rs into scenario/ directory
Break the monolithic scenario.rs into three focused files:
- scenario/workflows.rs — 6 parametrized E2E workflow scenarios
- scenario/lifecycle.rs — run lifecycle (ps, inspect, logs, assets, rm)
- scenario/exec.rs — exec creates file scenario
- scenario/mod.rs — shared helpers, macro, and timeout_for

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:41:15 -04:00