Skip to content

fix(models): add live model fetch for tencent-tokenhub provider - #59704

Open
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-59694
Open

liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-59694

Conversation

@liuhao1024

Copy link
Copy Markdown

What does this PR do?

Adds a live model fetch block for the tencent-tokenhub provider in provider_model_ids(). Previously, the provider only returned the static fallback list containing hy3-preview, even though the TokenHub API (https://tokenhub.tencentmaas.com/v1/models) returns 58 available models.

The fix follows the same pattern used by other API-key providers (stepfun, gmi): resolve credentials via resolve_api_key_provider_credentials(), then call the standard fetch_api_models() helper to query the /v1/models endpoint.

Related Issue

Fixes #59694

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/models.py: Added a tencent-tokenhub live-fetch block in provider_model_ids() (13 lines) that queries the TokenHub /v1/models endpoint when credentials are available.

How to Test

  1. Configure TOKENHUB_API_KEY in .env (or via hermes auth add tencent-tokenhub)
  2. Run hermes model and select the tencent-tokenhub provider
  3. Observed result: All 58 models from the TokenHub API appear in the picker (hy3, kimi-k2.7-code-highspeed, glm-5.2, minimax-m3, deepseek-v4-pro-202606, qwen3.5-plus, etc.)

Without the fix, only hy3-preview appears in the picker.

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: macOS 15.2

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

The tencent-tokenhub provider's model picker only displayed
hy3-preview, but the TokenHub API returns 58 available models.
Added a live-fetch block in provider_model_ids() following the
same pattern as stepfun and gmi providers.

Fixes NousResearch#59694
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels Jul 6, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Fix PR for #59694 (tencent-tokenhub shows only 1 of 58 models). Related to #57500 (adds a new tencent-tokenplan provider + the hy3 model) — distinct scope; that PR does not add this live-fetch block. Not a duplicate.

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused fix. The premise remains valid on current main: provider_model_ids() only reaches generic live discovery when get_provider_profile() returns a profile (hermes_cli/models.py:2551-2563), while tencent-tokenhub has no bundled model-provider profile and therefore falls through to its one-item static catalog (hermes_cli/models.py:394-396, 2602-2605).

Problems

  • The PR diff changes only hermes_cli/models.py; it does not add coverage for the new live-fetch branch or fallback. Existing TokenHub catalog tests begin at tests/hermes_cli/test_tencent_tokenhub_provider.py:147, while the analogous live/fallback pattern is covered for GMI at tests/hermes_cli/test_gmi_provider.py:87-128.

Suggested changes

  • Add mocked TokenHub live-success and probe-failure fallback tests alongside its existing provider tests, following the GMI pattern.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users 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.

Tencent TokenHub provider only shows 1 model (hy3-preview) despite API returning 58 models

3 participants