Skip to content

Feature: fallback engines for resilient agentic workflow execution #48348

Open

Description

@theletterf

Summary

Today each workflow is compiled against exactly one engine (engine: claude, engine: copilot, etc.). If that engine is unavailable — quota exhausted, service outage, auth failure — the entire job fails with no recovery path. A fallback-engines list would let users declare an ordered preference and have gh-aw automatically retry with the next engine when the primary one cannot run.

Proposed syntax

engine: claude
fallback-engines:
  - copilot
  - codex

Resolution order: claude → copilot → codex. The first engine that succeeds wins; failures are logged but do not surface as job failures until all options are exhausted.

Behaviour spec

Scenario Behaviour
Primary engine succeeds No fallback triggered
Primary fails with transient error (rate limit, 5xx) Try next engine in list
Primary fails with config/auth error Try next engine in list
All engines exhausted Job fails with aggregated error messages
fallback-engines omitted No change from today

Why this matters

  • Multi-tenant runners commonly have uneven quota across providers; a fallback avoids hard stops.
  • Copilot BYOK setups may have primary keys scoped to one provider; a cheaper fallback engine can handle overflow.
  • Scheduled / unattended workflows (no human to re-trigger) benefit most — they need resilience baked in.

Implementation notes

The ResolvedEngineTarget chain already lives in pkg/workflow/engine_definition.go. A fallback-engines field on the workflow spec could be parsed alongside engine and compiled into a retry loop at the runner level rather than re-generating the full workflow YAML per fallback. The log-parsing fallback path in pkg/cli/logs_parsing_engines.go and the existing engine resolution fallback (runtime-ID prefix match) show patterns that could be adapted.

Alternatives considered

  • User-side retry workflow: callers can wrap the workflow in a retry loop, but this duplicates boilerplate across every workflow and doesn't capture transient errors that surface inside the compiled YAML.
  • Single engine with model fallback: each engine already supports env-var model fallback, but that doesn't help when the whole provider is down.

Activity

  1. theletterf commented on Jul 27, 2026

    @theletterf
    Author

    @pelikhan Could be a good QoL feature!

  2. pelikhan commented on Jul 27, 2026

    @pelikhan
    Collaborator

    yes thinking.

  3. theletterf commented on Jul 28, 2026

    @theletterf
    Author

    Thanks! :)

  4. locked and limited conversation to collaborators on Jul 28, 2026
  5. unlocked this conversation on Jul 28, 2026
  6. theletterf commented on Aug 11, 2026

    @theletterf
    Author

    Any news on this one?

  7. locked and limited conversation to collaborators on Aug 11, 2026
  8. unlocked this conversation on Aug 11, 2026
  9. pelikhan commented on Oct 7, 2026

    @pelikhan
    Collaborator

    we are looking into fallback-models, the next logical step is fallback engine. it's a much bigger change...

  10. pelikhan commented on Oct 7, 2026

    @pelikhan
    Collaborator

    Status (2026-10-07; Maintainer direction): On October 7, a maintainer said fallback models are under investigation and fallback engines would be a much bigger next step. The next step is to scope engine-fallback behavior and failure handling after that model work is clearer.

  11. pelikhan commented on Oct 16, 2026

    @pelikhan
    Collaborator

    Community issue refresher — 2026-10-16: Partially addressed through model fallback; engine fallback remains relevant.

    Since the October 7 maintainer reply, #66593 merged ordered engine.fallback-models using native AWF request-level recovery. The current validation requires the firewall, compatible AWF/API-proxy versions, concrete model IDs, and currently one inference provider. Regression coverage covers this model contract.

    That is useful resilience, but it is not the proposed claude → copilot → codex runtime failover. Switching a model within an existing provider/request does not recover from an unavailable engine executable, engine-specific authentication/setup failure, or a whole-provider outage.

    The remaining request is ordered engine execution with safe retry boundaries, per-engine credentials/tools/log handling, and aggregated terminal failure reporting. It should be scoped separately from model fallback rather than considered implemented by it. This refresher is based on compiler code, tests, and merge history; no provider outage or engine failover was exercised.

  12. pelikhan commented on Oct 22, 2026

    @pelikhan
    Collaborator

    Still relevant: ordered cross-engine execution recovery is not implemented by the merged model-fallback work. Reviewed remote main at ffdd9c9.

    #66593 merged engine.fallback-models, but current documentation describes AWF retrying an individual request without restarting the agent, on the same provider. It explicitly excludes authentication failures and HTTP 429 from model switching. Compiler validation still rejects cross-provider chains. Neither this nor the engine catalog’s ID-prefix resolution fallback executes claude → copilot → codex after a failed engine.

    Next action: specify and implement a runner-level ordered engine-attempt contract: primary success skips fallbacks; eligible transient/quota/auth/config failures advance to the next configured engine; exhaustion reports all attempt failures; omission preserves existing behavior. Define per-engine setup/credentials/tool compatibility and a safe restart boundary so partially completed attempts cannot duplicate safe outputs or other side effects. Acceptance coverage must exercise those scenarios across different engines, not merely different models or harness retries. The request remains open; no outage/failover run was performed for this assessment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions