Skip to content

fix: Python 3.9 compatibility, CLI MEDIA tags, model switch for custom providers - #13789

Open
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix/python39-compatibility-cli-media-tags
Open

fix: Python 3.9 compatibility, CLI MEDIA tags, model switch for custom providers#13789
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix/python39-compatibility-cli-media-tags

Conversation

@vominh1919

Copy link
Copy Markdown
Contributor

Fixes

Changes

Issue #13766 - CLI MEDIA tags

  • agent/prompt_builder.py: Extend CLI platform hint to prevent MEDIA: tag emission
    • Added: "IMPORTANT: There is NO attachment channel on the CLI. Do NOT emit MEDIA:/path tags"

Issue #13765 - Python 3.9 compatibility

  • 64 files: Add from __future__ import annotations for Python 3.9 PEP-604 syntax support
  • Eliminates ImportError on /model command when system Python is 3.9

Issue #13764 - Model switch custom providers

  • cli.py: Load custom_providers unconditionally (not just for picker)
  • hermes_cli/model_switch.py:
    • Add _find_model_in_custom_providers() helper function
    • Insert step c2 in PATH B to search custom_providers before aggregator conversion
    • Extend is_custom guard to cover custom:* slugs
  • hermes_cli/models.py: normalize_provider() handles custom:* slugs

Testing

  • Python 3.9: ✓ modules import without error
  • Python 3.11: ✓ All unit tests passing
  • /model command: now works with bare model names on custom providers

…m providers

Fixes:
- NousResearch#13766: CLI agents no longer emit MEDIA:/path tags (CLI has no attachment channel)
- NousResearch#13765: Add 'from __future__ import annotations' to 64 files for Python 3.9 PEP-604 compatibility
- NousResearch#13764: Model switch now searches custom_providers catalog before API probe

Changes:
- agent/prompt_builder.py: Extend CLI platform hint to prevent MEDIA: tag emission
- cli.py: Load custom_providers unconditionally (not just for picker)
- hermes_cli/model_switch.py: Add _find_model_in_custom_providers() helper, insert step c2 in PATH B
- hermes_cli/models.py: normalize_provider() handles custom:* slugs
- 64 files: Add 'from __future__ import annotations' for Python 3.9 compatibility
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Apr 22, 2026
@alt-glitch alt-glitch added the comp/dashboard Web dashboard / control panel UI (dashboard/, landing) label Jun 27, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for collecting fixes for three real user-facing areas.

Problems

  • The CLI MEDIA behavior is already implemented on current main by 84449d9afee5bede1058a49a28fb0d4b80fbbc5f; see agent/prompt_builder.py:723-731 and regression coverage at tests/agent/test_prompt_builder.py:1071-1087.
  • The custom-provider helper in this diff reads id and only models, while the configured-provider schema derives custom:<name> from name (hermes_cli/providers.py:616-668). It can therefore miss normal singular model: entries or route with an empty provider slug. The following pass also does not prevent the immediately following conversion path from running.
  • Current main now routes exact configured model matches before provider auto-detection (hermes_cli/model_switch.py:1078-1147), and pyproject.toml:20 supports Python >=3.11,<3.14, not Python 3.9.

Suggested changes

  • Treat the MEDIA and custom-routing portions as superseded by current main; do not apply this patch verbatim.
  • If preserving any custom-provider work, use the existing configured-model routing semantics and keep unrelated prompt-builder cache/skill changes out of the salvage.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit labels Jul 12, 2026

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

This was generated by AI during triage.

Summary

Four open PRs share essentially the same large, unrelated 69-file parent diff, while their stated fixes target different causes. #13789 combines superseded CLI MEDIA handling, unsupported Python 3.9 compatibility work, and flawed custom-provider routing; #15554 adds a valid QQ dispatch wrapper change at an obsolete path, #15556 adds a valid but incomplete browser-vision None guard, and #15557 amends an RL module removed from current main.

Related pull requests

  • #13789 related — (+1680/-343) — close without merge: the CLI MEDIA fix and configured-model routing are already implemented on current main, Python 3.9 is outside the declared >=3.11 support range, and the custom-provider helper reads the wrong schema fields and does not actually skip the following conversion path. Despite the keep_open review on #13789, its own contributor analysis identifies these portions as superseded or unsafe to apply verbatim and assigns no salvageable scope.
  • #15554 related — (+1681/-344) — salvage as a new focused change: replacing bare asyncio.create_task with the adapter wrapper addresses the reported synchronous-dispatch failure, but this diff edits the pre-rename gateway/platforms/qqbot.py and carries the unrelated 69-file parent. Consistent with the keep_open review on #15554, transplant the one-line fix to gateway/platforms/qqbot/adapter.py and add synchronous message-event regression coverage before merge.
  • #15556 related — (+1683/-344) — salvage as a focused class-wide fix: guarding response.choices[0].message prevents the stated None dereference in Camofox, but the same unsafe access remains in tools/browser_tool.py and the PR includes the unrelated shared parent without a message=None regression test. Consistent with the keep_open review on #15556, retain the targeted idea while covering both browser-vision backends and adding the missing test.
  • #15557 related — (+1683/-343) — close without merge: the three RunState declarations only modify tools/rl_training_tool.py, which has been removed from current main together with the RL integration, so there is no live symbol or assignment to fix. Despite the keep_open review on #15557, the current-main diff evidence leaves no salvageable target; any future RL restoration must be proposed against the then-current architecture.

Duplicates

#13789, #15554, #15556, and #15557 substantially duplicate the same unrelated 69-file parent change set; their small stated fixes are otherwise distinct from one another.

Suggested consolidation

Merge none of these PRs as submitted. Close #13789 and #15557; replace #15554 with a minimal adapter.py wrapper fix plus dispatch regression test, and replace #15556 with a minimal two-backend None-message guard plus regression tests, then close the original broad PRs once those scoped replacements exist.

Cross-PR triage: Reviewed 4 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 743 kB of PR diffs, 3 kB of issue/PR text, 5 kB of discussion (4 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

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

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P2 Medium — degraded but workaround exists sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) 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.

4 participants