hermes - ✅(Solved) Fix [Bug] /model command strips /v1 from OpenCode Go endpoint when switching from MiniMax provider [1 pull requests, 1 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#14879Fetched 2026-04-24 10:44:35
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4closed ×1commented ×1cross-referenced ×1

Error Message

When MiniMax is set as the default provider and model, using the /model command to switch to an OpenCode Go model (e.g. glm-5.1) causes an HTTP 404 error. The /v1 segment is incorrectly stripped from the endpoint URL. 3. Observe the error:

Fix Action

Fixed

PR fix notes

PR #14919: fix(model): only strip /v1 from OpenCode URLs on fresh provider resolution

Description (problem / solution / changelog)

Summary

Fixes #14879

The /model command unconditionally strips /v1 from OpenCode base URLs when api_mode == "anthropic_messages", but this breaks models that need /v1 in the URL when the user switches models on the same provider (where the URL was already correct from a prior resolution).

Root Cause

In switch_model(), the /v1 stripping regex runs whenever:

  1. api_mode == "anthropic_messages"
  2. Provider is opencode-zen or opencode-go

But it didn't check whether the URL was freshly resolved or was carried over from the current session. When a user on opencode-go switches from one model to another (same provider), the base_url is already in the correct form and stripping /v1 corrupts it.

Changes

hermes_cli/model_switch.pyswitch_model():

  • Added (provider_changed or explicit_provider) to the /v1 strip condition
  • /v1 is now only stripped when the URL was freshly resolved via resolve_runtime_provider() (i.e., the provider changed or was explicitly specified)
  • When switching models on the same provider, the base_url is left as-is
  • Updated the comment block to document this behavior

Testing

  • Provider switch (e.g., openrouteropencode-go): provider_changed=True/v1 stripped as before
  • Same-provider model switch (e.g., model A → model B on opencode-go): provider_changed=False, explicit_provider=""/v1 preserved (bug fixed)
  • Explicit provider (e.g., /model sonnet --provider opencode-go): explicit_provider="opencode-go"/v1 stripped correctly
  • Non-OpenCode providers: condition short-circuits at target_provider check → no change

Checklist

  • Follows Conventional Commits format
  • Single logical change
  • No breaking changes
  • Existing tests unaffected

Changed files

  • hermes_cli/model_switch.py (modified, +6/-0)

Code Example

API call failed (attempt 1/3): NotFoundError [HTTP 404]
Provider: opencode-go
Model: glm-5
Endpoint: https://opencode.ai/zen/go
RAW_BUFFERClick to expand / collapse

Bug Description

When MiniMax is set as the default provider and model, using the /model command to switch to an OpenCode Go model (e.g. glm-5.1) causes an HTTP 404 error. The /v1 segment is incorrectly stripped from the endpoint URL.

Steps to Reproduce

  1. Set MiniMax as the default provider and model
  2. Run /model opencode-go glm-5.1
  3. Observe the error:
API call failed (attempt 1/3): NotFoundError [HTTP 404]
Provider: opencode-go
Model: glm-5
Endpoint: https://opencode.ai/zen/go

Expected endpoint: https://opencode.ai/zen/go/v1 Actual endpoint: https://opencode.ai/zen/go (missing /v1)

Environment

  • Hermes version: (please check hermes --version)
  • Gateway: hermes-gateway
  • OS: Linux

Possible Cause

This bug may have been introduced by PR #4918 (https://github.com/NousResearch/hermes-agent/pull/4918), which fixed a double /v1 URL issue for MiniMax models on OpenCode Go. The fix strips the trailing /v1 from the base URL when api_mode is anthropic_messages. However, this fix may not account for provider switching mid-session via /model.

Tags

  • bug
  • /model command
  • opencode-go provider
  • MiniMax

extent analysis

TL;DR

The issue can likely be fixed by modifying the URL construction logic to preserve the /v1 segment when switching providers via the /model command.

Guidance

  • Verify that the issue is indeed caused by the fix introduced in PR #4918 by checking the Hermes version and reviewing the changes made in that pull request.
  • Investigate the URL construction logic in the Hermes codebase to identify where the /v1 segment is being stripped.
  • Consider adding a conditional check to preserve the /v1 segment when switching providers via the /model command.
  • Test the fix by running the /model command with the OpenCode Go model and verifying that the correct endpoint URL is used.

Example

No code snippet is provided as the issue does not contain sufficient information about the codebase.

Notes

The fix may require modifications to the Hermes codebase, and it is essential to thoroughly test the changes to ensure that they do not introduce new issues.

Recommendation

Apply a workaround by modifying the URL construction logic to preserve the /v1 segment when switching providers via the /model command, as this is likely to be a more straightforward and targeted solution.

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