fabro/lib/apps/fabro-server/src
Bryan Helmkamp e6eb36f852
refactor: simplify model-keyed fallback internals
Consolidation pass over the fallback feature, no intended behavior
changes beyond noted validation and event-shape cleanups:

- Unify the two parallel notice types: FallbackPlanNotice is gone;
  ModelFallbackNotice now owns the runtime NoNearbyReasoningLevel case
  and the shared ChainEmpty wording. Notices emit through a new
  Emitter::notice_scoped with their own level, and each distinct notice
  is emitted once per run instead of on every LLM call.
- Move canonical_model_id onto Catalog so chain keys are written and
  read through one function; reject provider-qualified fallback keys,
  which could never match at dispatch and were silently dead config.
- Type FallbackTarget as ProviderId/ModelId, removing repeated
  ProviderId::new re-wrapping at every use site.
- Derive FallbackPlan's current route from a position index instead of
  storing current/requested_controls copies; advance() no longer has
  unreachable None branches.
- Bundle the agent invocation's live state (session, bridge, lease,
  forwarder, accounting) into LiveAgentInvocation; failover_agent_session
  drops from 21 parameters to 7 and the six copies of the
  abort/discard/classify teardown collapse into two methods.
- Share one route_request builder between one_shot and its failover
  loop; complete_one_shot_request takes the request by value instead of
  deep-cloning the message payload per call.
- Event::Failover carries FailoverProps directly; the props' original
  route and attempt fields are now required, and reasoning efforts are
  typed ReasoningEffort instead of strings.
- Reuse RunModelSettings/RunModelControls in fabro-api via
  with_replacement, add the missing controls property to the OpenAPI
  schema, regenerate the TS client, and add the type-identity/JSON
  parity test.
- Smaller cleanups: ReasoningEffort::closest_supported uses enum
  discriminants; ModelFallbackPolicy gains len(); resolve_model_fallbacks
  takes a provider slice; duplicate-target filtering lives only in the
  resolver.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-30 12:51:36 -04:00
..
auth refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
demo Merge origin/main into feat/parallel-branch-live-status 2026-07-28 17:50:36 -04:00
prompts Render the run title prompt with Jinja instead of string replacement 2026-07-27 17:23:16 -04:00
server Merge remote-tracking branch 'origin/main' into feat/for-each-item-injection 2026-07-28 20:03:25 -04:00
worker_control refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
automation_materializer.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
canonical_host.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
canonical_origin.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
csp.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
diagnostics.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
error.rs Clarify non-validation LLM error mapping 2026-07-24 09:13:26 -04:00
git_checkout.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
github_webhooks.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
install.rs Stop requesting workflow write permission 2026-07-29 13:19:55 -04:00
interp.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
jwt_auth.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
lib.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
manifest_validation.rs fix(tool): keep fabro_run_create validation catalog-free 2026-07-28 14:40:54 -04:00
migrations.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
principal_middleware.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
request_id.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
run_files.rs fix(sandbox): reactivate stopped run sandboxes 2026-07-28 12:50:20 -04:00
run_files_security.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
run_manifest.rs refactor: simplify model-keyed fallback internals 2026-07-30 12:51:36 -04:00
run_selector.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
run_title_generation.rs refactor: address run title review findings 2026-07-28 17:14:03 -04:00
run_tool_manifest.rs fix(tool): keep fabro_run_create validation catalog-free 2026-07-28 14:40:54 -04:00
security_headers.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
serve.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
server.rs Merge remote-tracking branch 'origin/main' into refactor/remove-env-interpolation 2026-07-28 17:44:03 -04:00
server_secrets.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
spawn_env.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
startup.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
static_files.rs feat(web): tell open tabs when a new build ships 2026-07-25 14:45:26 -04:00
test_support.rs fix(test): propagate storage setup errors 2026-07-28 17:23:31 -04:00
web_auth.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
worker_runtime.rs refactor: simplify cancellation lifecycle code from review 2026-07-23 21:15:35 -04:00
worker_token.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00