hermes - 💡(How to fix) Fix [Bug]: /model –provider flag ignored when sent via ACP (Scarf, Zed, etc.)” [4 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

When using Scarf (or any ACP client like Zed) to send /model inclusionai/ring-2.6-1t --provider openrouter to Hermes, the --provider openrouter flags are completely ignored. The entire string "inclusionai/ring-2.6-1t --provider openrouter" is treated as a literal model ID and passed to the current default provider (in mi case, OpenAI Codex), which rejects it with an error. 4. Observe the error response: The --provider and --global flag text is included as part of the model name string and sent verbatim to the current provider's API, causing a model-not-found error.

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

/model inclusionai/ring-2.6-1t --provider openrouter

---

"The 'inclusionai/ring-2.6-1t --provider openrouter' model is not supported when using Codex"

---

Report       https://paste.rs/EORNk
agent.log    https://paste.rs/YDz5R
gateway.log  https://paste.rs/xoZOM

---



---

# CLI (correct)
model_input, explicit_provider, persist_global = parse_model_flags(raw_args)
result = switch_model(raw_input=model_input, ..., explicit_provider=explicit_provider, ...)

# ACP adapter (buggy — missing flag parsing)
target_provider, new_model = self._resolve_model_selection(args, current_provider)

---

from hermes_cli.model_switch import parse_model_flags

model_input, explicit_provider, _persist_global = parse_model_flags(args)

current_provider = getattr(state.agent, "provider", None) or "openrouter"
if explicit_provider:
    target_provider = explicit_provider
else:
    target_provider = current_provider

new_model = model_input or state.model or ""

if new_model:
    target_provider_resolved, new_model = self._resolve_model_selection(
        new_model, target_provider
    )
else:
    target_provider_resolved = target_provider
RAW_BUFFERClick to expand / collapse

Bug Description

When using Scarf (or any ACP client like Zed) to send /model inclusionai/ring-2.6-1t --provider openrouter to Hermes, the --provider openrouter flags are completely ignored. The entire string "inclusionai/ring-2.6-1t --provider openrouter" is treated as a literal model ID and passed to the current default provider (in mi case, OpenAI Codex), which rejects it with an error.

The CLI path (/model typed in the Hermes terminal) correctly parses --provider/--global flags and routes the model to the specified provider. The ACP adapter path does not — it sends the raw, unparsed args string straight through to model resolution.

Steps to Reproduce

  1. Start Hermes Agent (hermes)

  2. Connect via an ACP client (e.g., Scarf, or /docs in Zed pointing to http://localhost:3349)

  3. Send the command:

    /model inclusionai/ring-2.6-1t --provider openrouter
  4. Observe the error response:

    "The 'inclusionai/ring-2.6-1t --provider openrouter' model is not supported when using Codex"

Expected behavior: Hermes should switch to inclusionai/ring-2.6-1t on the openrouter provider, just like the CLI /model command does.

Expected Behavior

The /model command via ACP should handle --provider and --global flags the same way the CLI does:

  • Parse and strip --provider <name> from the args
  • Parse and strip --global from the args
  • Use the clean model name for resolution
  • Route to the explicitly specified provider if --provider is given

Actual Behavior

The --provider and --global flag text is included as part of the model name string and sent verbatim to the current provider's API, causing a model-not-found error.

Affected Component

Other

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

Report       https://paste.rs/EORNk
agent.log    https://paste.rs/YDz5R
gateway.log  https://paste.rs/xoZOM

Operating System

macOS 15.7.7

Python Version

3.11.15

Hermes Version

v0.14.0 (2026.5.16)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

The _cmd_model method in acp_adapter/server.py (line 1510) passes the raw args string directly to _resolve_model_selection() without first parsing --provider/--global flags.

In contrast, the CLI path in cli.py (line 6931-6939) correctly calls parse_model_flags() from hermes_cli.model_switch before resolving:

# CLI (correct)
model_input, explicit_provider, persist_global = parse_model_flags(raw_args)
result = switch_model(raw_input=model_input, ..., explicit_provider=explicit_provider, ...)

# ACP adapter (buggy — missing flag parsing)
target_provider, new_model = self._resolve_model_selection(args, current_provider)

Proposed Fix (optional)

Proposed Fix

Modified _cmd_model in acp_adapter/server.py to call parse_model_flags() before resolving, matching the CLI behavior:

from hermes_cli.model_switch import parse_model_flags

model_input, explicit_provider, _persist_global = parse_model_flags(args)

current_provider = getattr(state.agent, "provider", None) or "openrouter"
if explicit_provider:
    target_provider = explicit_provider
else:
    target_provider = current_provider

new_model = model_input or state.model or ""

if new_model:
    target_provider_resolved, new_model = self._resolve_model_selection(
        new_model, target_provider
    )
else:
    target_provider_resolved = target_provider

Verification

Tested parse_model_flags() with all relevant input patterns:

Inputmodel_inputexplicit_providerpersist_global
"inclusionai/ring-2.6-1t --provider openrouter""inclusionai/ring-2.6-1t""openrouter"False
"sonnet --provider anthropic --global""sonnet""anthropic"True
"--provider openrouter""""openrouter"False
"anthropic:claude-sonnet-4-6""anthropic:claude-sonnet-4-6"""False
""""""False

Existing provider:model colon syntax continues to work correctly (preserves backward compatibility with the existing test at tests/acp/test_server.py:1404).

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: /model –provider flag ignored when sent via ACP (Scarf, Zed, etc.)” [4 pull requests]