Commit graph

565 commits

Author SHA1 Message Date
Bryan Helmkamp
07a8e76b9d Fix missing create_app_state import in mTLS e2e tests
The mtls_e2e module is gated with #[cfg(target_os = "linux")], so the
wrong import (create_app_state_with_options instead of create_app_state)
was never caught on macOS. Fixes CI compilation failure on Linux.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 11:38:29 -04:00
Bryan Helmkamp
e31d762e98 Fix flaky SSE event stream integration test 2026-04-01 11:11:45 -04:00
Bryan Helmkamp
77773acacb test(devcontainer): disable flaky OCI fetch integration
Temporarily short-circuit fetch_feature_oci_integration unless FABRO_ENABLE_FETCH_FEATURE_OCI_INTEGRATION is set.

The test depends on live oras and ghcr.io access and is timing out under the current nextest ignored-test invocation, so keep it visible but disabled until the root cause is addressed.
2026-04-01 11:11:38 -04:00
Bryan Helmkamp
77d1495603 Move hook twin coverage to CLI workflow tests
Replace in-process workflow E2E hook tests with fabro-cli workflow
integration tests that run fabro as a subprocess and pass OpenAI twin
env only to the child process. Remove the unsafe env-var mutation helper
from fabro-workflow integration tests.
2026-04-01 11:03:44 -04:00
Bryan Helmkamp
c6cb9c6e7e Expand OpenAI twin coverage across integration tests
Add shared twin scenario helpers and use them to cover OpenAI-backed
CLI, agent parity, workflow, and exec integration paths. This brings the
worktree implementation back into the main checkout as a single commit.
2026-04-01 11:03:34 -04:00
Bryan Helmkamp
63b97710d3 Add missing Arc import in mTLS e2e tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:38:50 -04:00
Bryan Helmkamp
c22845e548 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
9f5cf7bb77 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
c3df5220c3 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
5b7eabee8f 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
c71722d797 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
0ffa3e23b0 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
507f5ddcde 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
c27f72005a Fix rewind snapshot filtering for short SHAs 2026-03-31 13:34:26 -04:00
Bryan Helmkamp
892f98022f Fix workspace clippy issues in fabro-test 2026-03-31 13:33:20 -04:00
Bryan Helmkamp
699691b468 Rename fabro-openai-oauth to fabro-oauth 2026-03-31 13:23:43 -04:00
Bryan Helmkamp
17eb572f87 Speed up sleep-heavy test suites 2026-03-31 13:12:21 -04:00
Bryan Helmkamp
e7e6ae00b6 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
fbc823b6f7 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
74ed288d49 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
b73b70ac17 Fix lint and test fallout 2026-03-31 09:47:50 -04:00
Bryan Helmkamp
57d72e5f34 Tighten non-interactive JSON mode 2026-03-31 09:47:50 -04:00
Bryan Helmkamp
1c6c160e08 Centralize E2E test env var handling 2026-03-31 09:30:38 -04:00
Bryan Helmkamp
8875bbf69d 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
e99ebfa3f2 Add global JSON output mode 2026-03-31 07:51:19 -04:00
Bryan Helmkamp
c148a693b9 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
108e0cd632 Split agent processing into thinking and executing 2026-03-30 19:56:38 -04:00
Bryan Helmkamp
dd65b05396 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
8536c7f1c4 Format workflow validation fixes 2026-03-30 19:00:06 -04:00
Bryan Helmkamp
78124c7a0b Stabilize merged workspace validation 2026-03-30 18:57:06 -04:00
Bryan Helmkamp
fbf1529bd3 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
73cc431d05 Add CLI integration test coverage 2026-03-30 18:23:24 -04:00
Bryan Helmkamp
798f1990f6 Fix envelope event verification regressions 2026-03-30 17:38:57 -04:00
Bryan Helmkamp
77bcf76581 Refactor run event envelopes and subagent linking 2026-03-30 17:09:07 -04:00
Bryan Helmkamp
440867ca48 Preserve metadata deserialize error details 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
cac8f386f9 Rename fabro-git-storage to fabro-checkpoint 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
c49cd5d71d Fix run progress replay durations 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
a40bf50b6d fmt 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
59469e50f8 Refactor run progress rendering 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
c4aa3439fc Reorganize CLI integration tests and document testing strategy 2026-03-30 16:17:39 -04:00
Bryan Helmkamp
33c5c4e019 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
529899d71f Refactor run CLI tests to use snapshots 2026-03-30 16:17:38 -04:00
Bryan Helmkamp
d50b3187e5 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
93aa239056 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
41f7b0cda6 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
55df05fe43 Prefix API routes with /api/v1 2026-03-30 16:17:06 -04:00
Bryan Helmkamp
d5976820d5 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
73cbcabf77 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
3936f185cf 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
a66b65bfc3 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