Skip to content

Add model_fallback to the plugin index - #592

Merged
3clyp50 merged 2 commits into
agent0ai:mainfrom
Olszalsik:add-model-fallback
Nov 23, 2026
Merged

3clyp50 merged 2 commits into
agent0ai:mainfrom
Olszalsik:add-model-fallback

Conversation

@Olszalsik

Copy link
Copy Markdown
Contributor

Adds Model Fallback System (model_fallback).

Multi-cycle model failover for Agent Zero. When a provider rate-limits, times out or
5xxs, the plugin rotates through fallback model candidates using shared cooldowns,
permanent-failure detection, latency-learned warm/cold timeouts, background recovery
probes and an extended-retry mode for hour-long quota resets. It covers the chat,
utility and main-loop turn paths, and modifies no core agent-zero file.

How this differs from the related entries

  • api_rotation_by_kame rotates API keys within a single provider. This plugin
    rotates across model candidates, classifies permanent vs transient failures, and
    learns per-label timeouts from real call outcomes.
  • apu_governor is a global tool-execution throttle that paces calls to avoid
    429s. This plugin is failure-driven: it only rotates when a provider actually
    errors or rate-limits.
  • a0_vision_fallback routes image analysis to a vision model; unrelated scope.

Verification

  • scripts/validate_plugin_submission.py passes locally against this exact
    BASE_SHA/HEAD_SHA range.
  • Plugin repository: https://github.com/Olszalsik/a0-model-fallback
    (public, default branch main, root plugin.yaml with name: model_fallback).
  • Plugin test suite: 336 passing.
  • No secrets in the working tree or in any of the repository's 30 commits;
    config.json (per-install runtime config) is git-ignored and was never committed.

@POWERFULMOVES POWERFULMOVES left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: index-only addition, validate CI green. Upstream pattern matches established provider-fallback plugins; fills a real gap (model failover on rate-limit/5xx). Safe index entry.

@3clyp50

3clyp50 commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Could you limit import recovery to optional extensions? If a security check can't load, the agent shouldn't carry on without it.

Alessandro

Olszalsik pushed a commit to Olszalsik/a0-model-fallback that referenced this pull request Nov 21, 2026
The guard skipped every extension file that failed to import. Correct for a
cosmetic extension, wrong for a policy/veto/quota guard: skipping the check
and running anyway defeats the check.

Recovery is now opt-in per extension -- own-plugin files, a plugin whose
plugin.yaml sets optional_extensions: true, a file carrying the marker
`# a0:optional-extension` on its own line, or a path/plugin listed in
extension_import_guard_optional_paths / _optional_plugins. Anything else
logs [import_guard] CRITICAL and re-raises, so the extension point aborts
exactly as unguarded upstream would.

Non-recovered failures surface as guards.extension_import.critical on the
stats endpoint and are cleared when the file later imports cleanly.

extension_import_guard_enforce_optional_only: false restores the old
skip-everything behaviour as a deliberate availability-over-safety
downgrade.

Addresses review on agent0ai/a0-plugins#592.

Tests: 13 new in tests/test_import_guard_optional_v350.py, including the
test_unmarked_failure_propagates control that fails if the guard drifts
back to swallowing critical imports. v3.3.0 fixtures updated to declare
optionality (the semantics changed on purpose).
@3clyp50
3clyp50 merged commit ec398b1 into agent0ai:main Nov 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants