hermes - ✅(Solved) Fix [Bug]: Discord /model flow has multiple Copilot regressions [2 pull requests, 1 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#15030Fetched 2026-04-25 06:24:55
View on GitHub
Comments
0
Participants
1
Timeline
13
Reactions
0
Author
Participants
Timeline (top)
labeled ×5cross-referenced ×4referenced ×3closed ×1

Today's Hermes fixes uncovered that the Discord /model flow for GitHub Copilot had several related regressions, not just one isolated bug.

In the same workflow, I hit all of these symptoms:

  • /model interactions could fail while switching a Copilot model in Discord
  • the picker could show stale or incomplete Copilot model names
  • after selecting a model, the UI could briefly flash the old Back / Cancel controls before the switch finished
  • after switching, runtime code could later fail to resolve the persisted provider slug github-copilot

This issue consolidates the Copilot /model problems that were previously split across narrower reports. Supersedes #12086 and #15017.

Root Cause

Today's Hermes fixes uncovered that the Discord /model flow for GitHub Copilot had several related regressions, not just one isolated bug.

In the same workflow, I hit all of these symptoms:

  • /model interactions could fail while switching a Copilot model in Discord
  • the picker could show stale or incomplete Copilot model names
  • after selecting a model, the UI could briefly flash the old Back / Cancel controls before the switch finished
  • after switching, runtime code could later fail to resolve the persisted provider slug github-copilot

This issue consolidates the Copilot /model problems that were previously split across narrower reports. Supersedes #12086 and #15017.

Fix Action

Fixed

PR fix notes

PR #15031: fix(model): repair Discord Copilot /model flow

Description (problem / solution / changelog)

Summary

  • refresh Discord Copilot /model picker entries from the live Copilot catalog when available, with a corrected curated fallback when the live catalog is unavailable
  • restore valid Copilot Claude/Gemini fallback entries, keep stale claude-opus-4.6 out of the picker, and add missing alias normalization for claude-sonnet-4
  • clear the Discord picker controls immediately while a model switch is in flight so the UI does not flash stale Back / Cancel controls
  • normalize persisted github-copilot provider slugs inside the auxiliary runtime so post-switch provider resolution stays aligned with the main /model flow

Fixes #15030. Supersedes #15019.

Test plan

  • /home/csh/.hermes/hermes-agent/venv/bin/pytest -q /home/csh/.hermes/hermes-agent/tests/agent/test_auxiliary_client.py /home/csh/.hermes/hermes-agent/tests/agent/test_auxiliary_named_custom_providers.py /home/csh/.hermes/hermes-agent/tests/gateway/test_discord_model_picker.py /home/csh/.hermes/hermes-agent/tests/hermes_cli/test_copilot_in_model_list.py /home/csh/.hermes/hermes-agent/tests/hermes_cli/test_model_validation.py

🤖 Generated with Claude Code

Changed files

  • agent/auxiliary_client.py (modified, +10/-3)
  • gateway/platforms/discord.py (modified, +11/-3)
  • hermes_cli/model_switch.py (modified, +9/-6)
  • hermes_cli/models.py (modified, +7/-1)
  • tests/agent/test_auxiliary_client.py (modified, +12/-0)
  • tests/agent/test_auxiliary_named_custom_providers.py (modified, +20/-0)
  • tests/gateway/test_discord_model_picker.py (added, +179/-0)
  • tests/hermes_cli/test_copilot_in_model_list.py (added, +41/-0)
  • tests/hermes_cli/test_model_validation.py (modified, +18/-1)

PR #15063: fix(copilot): Discord /model flow — picker lifecycle, catalog, slugs, test-mock pollution

Description (problem / solution / changelog)

Salvages @Nicecsh's PR #15031 with contributor authorship preserved via rebase-merge. Four bundled Copilot /model regressions on Discord, all addressed:

Fixes (from #15030)

  1. Discord interaction lifecycle — picker waited on the slow switch callback before replacing its view, so Discord could show "interaction failed" or stale controls. Now edit_message() fires with the switching-state view immediately, then edit_original_response() applies the final result. (gateway/platforms/discord.py)

  2. Stale/incomplete Copilot picker listlist_authenticated_providers() used the generic curated + models.dev merge path, which kept stale claude-opus-4.6 and dropped valid entries. Now uses provider_model_ids("copilot"/"copilot-acp") which does live catalog → curated fallback. (hermes_cli/model_switch.py)

  3. Curated Copilot list corrections — removes claude-opus-4.6 (not on Copilot), adds claude-sonnet-4, gemini-3.1-pro-preview, gemini-3-pro-preview, gemini-3-flash-preview, and the claude-sonnet-4-0 alias normalization. (hermes_cli/models.py)

  4. Runtime slug mismatch — auxiliary client's _PROVIDER_ALIASES now maps github, github-copilot, github-models, github-copilot-acp, copilot-acp-agent to their Hermes runtime ids. _normalize_aux_provider() restructured so main can chain through aliases. (agent/auxiliary_client.py)

Added follow-up: xdist mock-pollution fix

The contributor's new tests/gateway/test_discord_model_picker.py installed its own discord mock at module-import time via a local _ensure_discord_mock(). On pytest-xdist workers that collected it before other gateway tests, the custom mock overwrote sys.modules["discord"] with a fake missing Intents.default(), File, app_commands.Choice, and other attributes → 3 unrelated tests failed on the same worker.

Fix:

  • Extended the canonical _ensure_discord_mock() in tests/gateway/conftest.py with View, Select, Button, SelectOption, a kwarg-accepting Embed, and Color.greyple.
  • Stripped the duplicated 127-line mock-setup block from test_discord_model_picker.py.
  • One source of discord-mock truth across all gateway tests.

Validation

Result
tests/gateway/test_discord_model_picker.py1/1 ✓
tests/agent/test_auxiliary_client.py + named_custom_providers25/25 ✓
tests/hermes_cli/test_copilot_in_model_list.py2/2 ✓
tests/hermes_cli/test_model_validation.py20/20 ✓
Broad sweep: gateway/ + hermes_cli/ -k "discord or model or copilot or provider" (-n 4)1291/1291 ✓ (was 1288+3 before mock fix)

Attribution

CommitAuthor
fix(aux): normalize GitHub Copilot provider slugs@Nicecsh
fix(model): repair Discord Copilot /model flow@Nicecsh
test(gateway): unify discord mock via shared conftestus (xdist pollution follow-up)
chore(release): map Nicecsh in AUTHOR_MAPus

@Nicecsh ([email protected]) added to scripts/release.py AUTHOR_MAP.

Merge method

Rebase merge — preserves @Nicecsh's per-commit authorship. Closes #15030 and supersedes #15031.

Changed files

  • agent/auxiliary_client.py (modified, +10/-3)
  • gateway/platforms/discord.py (modified, +11/-3)
  • hermes_cli/model_switch.py (modified, +9/-6)
  • hermes_cli/models.py (modified, +7/-1)
  • scripts/release.py (modified, +2/-0)
  • tests/agent/test_auxiliary_client.py (modified, +12/-0)
  • tests/agent/test_auxiliary_named_custom_providers.py (modified, +20/-0)
  • tests/gateway/conftest.py (modified, +56/-4)
  • tests/gateway/test_discord_model_picker.py (added, +82/-0)
  • tests/hermes_cli/test_copilot_in_model_list.py (added, +41/-0)
  • tests/hermes_cli/test_model_validation.py (modified, +18/-1)

Code Example

resolve_provider_client: unknown provider 'github-copilot'
RAW_BUFFERClick to expand / collapse

Summary

Today's Hermes fixes uncovered that the Discord /model flow for GitHub Copilot had several related regressions, not just one isolated bug.

In the same workflow, I hit all of these symptoms:

  • /model interactions could fail while switching a Copilot model in Discord
  • the picker could show stale or incomplete Copilot model names
  • after selecting a model, the UI could briefly flash the old Back / Cancel controls before the switch finished
  • after switching, runtime code could later fail to resolve the persisted provider slug github-copilot

This issue consolidates the Copilot /model problems that were previously split across narrower reports. Supersedes #12086 and #15017.

Reproduction

  1. Configure Hermes to use GitHub Copilot.
  2. Open a Discord chat connected to the Hermes gateway.
  3. Run /model.
  4. Open the Copilot provider row and select a concrete model.
  5. Observe one or more of the following depending on environment and account state:
    • Discord reports that the interaction failed
    • valid Copilot model names are missing or stale
    • the picker briefly flashes Back / Cancel after a model is chosen
    • later runtime resolution/logging shows:
resolve_provider_client: unknown provider 'github-copilot'

Actual behavior

1. Discord interaction lifecycle regression

The model picker waited on the slow switch callback instead of immediately replacing the interaction view, so Discord could show an interaction failure or stale controls.

2. Copilot picker list can be stale or incomplete

The Discord /model picker did not reliably reflect the current Copilot catalog. In practice this meant:

  • stale entries like claude-opus-4.6 could still appear from fallback data
  • valid Copilot entries such as:
    • claude-sonnet-4.6
    • claude-sonnet-4
    • claude-sonnet-4.5
    • claude-haiku-4.5
    • gemini-3.1-pro-preview could be missing

3. Picker UX glitch after selection

After selecting a concrete model, the old control view could remain visible briefly before the final success message replaced it.

4. Runtime provider slug mismatch after switching

The switch/persistence flow can legitimately store the models.dev canonical Copilot slug github-copilot, but agent.auxiliary_client.resolve_provider_client() did not normalize that slug back to Hermes' runtime provider id copilot.

Expected behavior

  • Discord /model should acknowledge the interaction immediately and replace the picker with a switching state.
  • Copilot model names in the picker should refresh from the live Copilot catalog when reachable.
  • If the live Copilot catalog is unavailable, Hermes should fall back to a corrected curated Copilot list rather than a stale one.
  • Once a model is chosen, the picker should not flash obsolete controls.
  • Runtime provider resolution should accept github-copilot / related Copilot aliases anywhere that copilot is expected.

Notes

This consolidated report supersedes the narrower Copilot reports and fix proposals that were split apart earlier.

extent analysis

TL;DR

The most likely fix involves updating the Discord /model flow to immediately replace the interaction view and normalize the provider slug to match the runtime provider id.

Guidance

  • Review the Discord interaction lifecycle to ensure it acknowledges the interaction immediately and replaces the picker with a switching state.
  • Verify that the Copilot catalog is being refreshed correctly and that the fallback data is updated to reflect the current catalog.
  • Check the provider slug normalization in the agent.auxiliary_client.resolve_provider_client() function to ensure it accepts github-copilot and related aliases.
  • Test the /model flow with different Copilot models to ensure the picker does not flash obsolete controls and the runtime provider resolution works as expected.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The issue seems to be related to the Discord /model flow and the Copilot catalog refresh. The fix may involve updating the interaction lifecycle, catalog refresh, and provider slug normalization.

Recommendation

Apply a workaround to update the Discord /model flow to immediately replace the interaction view and normalize the provider slug, as this is the most likely cause of the issue.

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…

FAQ

Expected behavior

  • Discord /model should acknowledge the interaction immediately and replace the picker with a switching state.
  • Copilot model names in the picker should refresh from the live Copilot catalog when reachable.
  • If the live Copilot catalog is unavailable, Hermes should fall back to a corrected curated Copilot list rather than a stale one.
  • Once a model is chosen, the picker should not flash obsolete controls.
  • Runtime provider resolution should accept github-copilot / related Copilot aliases anywhere that copilot is expected.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING