Skip to content

fix(acp): pass fallback_providers to AIAgent in editor integrations (… - #36720

Open
Ericcc-Ma wants to merge 1 commit into
NousResearch:mainfrom
Ericcc-Ma:fix/acp-fallback-providers-18452
Open

fix(acp): pass fallback_providers to AIAgent in editor integrations (…#36720
Ericcc-Ma wants to merge 1 commit into
NousResearch:mainfrom
Ericcc-Ma:fix/acp-fallback-providers-18452

Conversation

@Ericcc-Ma

Copy link
Copy Markdown

#18452)

The ACP adapter's _make_agent() was not passing fallback_model to AIAgent(), so model failover was completely broken in editor integrations (VS Code, JetBrains, Obsidian, Zed). The CLI and gateway entry points both pass fallback_model correctly; this brings ACP in line with them.

What does this PR do?

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/acp Agent Communication Protocol adapter duplicate This issue or pull request already exists labels Jun 1, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #18460 — same fix (pass fallback_model/fallback_providers to AIAgent in the ACP adapter's _make_agent()), same underlying issue #18452. #18460 was opened earlier and is still open; consolidating there.

…ousResearch#18452)

The ACP adapter's _make_agent() was not passing fallback_model to
AIAgent(), so model failover was completely broken in editor
integrations (VS Code, JetBrains, Obsidian, Zed). The CLI and
gateway entry points both pass fallback_model correctly; this
brings ACP in line with them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Ericcc-Ma
Ericcc-Ma force-pushed the fix/acp-fallback-providers-18452 branch from a4171c0 to 905f63d Compare June 1, 2026 11:27

@tonydwb tonydwb 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.

Code Review Summary

Verdict: Approved

✅ Looks Good

  • Clean fix: Passes fallback_providers/fallback_model from ACP editor config to AIAgent.__init__, enabling fallback routing in editor-integration (VS Code / Zed / JetBrains) sessions
  • Correct guard: model_cfg is confirmed to be either dict or str, so the isinstance(model_cfg, dict) check is safe and reliable
  • Minimal change: Single source file change (5 lines) — surgical and focused
  • No test regressions expected: The new field is optional (only set when present in config)

Reviewed by Hermes Agent

@mxnstrexgl mxnstrexgl 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.

🤖 Automated PR Review

Security Scan

  • ✓ No hardcoded secrets, injection sinks, unsafe deserialization, or dependency red flags found by this automated scan.

Code Quality

  • ✓ No blocking code-quality issues found by this automated scan.
  • ℹ️ No test file changes detected; verify existing coverage exercises this behavior.

Summary

Status: APPROVE — security findings: 0, quality suggestions: 0.

Automated review; raw diff content intentionally omitted.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for addressing the ACP failover gap. The premise is still valid on current main, but this patch reads the wrong configuration level.

Problems

  • The added expression queries model_cfg, while current main assigns model_cfg = config.get("model") in acp_adapter/session.py:602. Fallback entries are top-level configuration keys: hermes_cli/fallback_config.py:64-65 reads them from the full config. Therefore a normal fallback_providers: entry still produces fallback_model=None in ACP.
  • The PR changes only acp_adapter/session.py; no regression test demonstrates forwarding a top-level configured fallback chain.

Suggested changes

  • Use get_fallback_chain(config) from hermes_cli.fallback_config and pass its result as fallback_model, preserving CLI-compatible merging and deduplication of fallback_providers and legacy fallback_model.
  • Add an ACP kwargs-capture regression test for a top-level fallback chain.

Automated hermes-sweeper review.

Comment thread acp_adapter/session.py
"session_id": session_id,
"session_db": self._get_db(),
"model": model or default_model,
"fallback_model": (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

model_cfg is config.get("model"), but fallback configuration is top-level. This will remain None for normal fallback_providers: config; use the full config with get_fallback_chain(config) instead.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants