Skip to content

fix: unblock Codex fallback and stabilize skill update hashes - #46915

Open
nicogentico wants to merge 2 commits into
NousResearch:mainfrom
nicogentico:fix/codex-fallback-and-skill-hash
Open

fix: unblock Codex fallback and stabilize skill update hashes#46915
nicogentico wants to merge 2 commits into
NousResearch:mainfrom
nicogentico:fix/codex-fallback-and-skill-hash

Conversation

@nicogentico

Copy link
Copy Markdown

Summary

  • Let OpenAI Codex usage_limit_reached errors decline credential-pool recovery so configured fallback providers can activate immediately.
  • Pass error context into the eager fallback pool-recovery decision path.
  • Align skills hub in-memory bundle hashing with on-disk content_hash path ordering, fixing false update_available reports for skills that contain both references/styles.md and files under references/styles/.

Why

Two update-time issues surfaced in a real Hermes install:

  1. Codex subscription quota exhaustion (usage_limit_reached) is not recoverable by rotating credentials inside the same pool. Treating it like a pool-recoverable rate limit can delay or block fallback to OpenRouter.
  2. bundle_content_hash() and content_hash() intended to be symmetric, but sorted paths differently when a file and directory share a prefix. This made an installed skill with identical contents still appear outdated.

Test Plan

  • python -m pytest tests/agent/test_credential_pool_routing.py -q -o 'addopts='
  • python -m pytest tests/tools/test_skills_hub.py::TestCheckForSkillUpdates tests/agent/test_credential_pool_routing.py -q -o 'addopts='
  • Manual verification: hermes skills check now reports 0 update(s) available after force-installing baoyu-article-illustrator.

@nicogentico
nicogentico force-pushed the fix/codex-fallback-and-skill-hash branch from 64ef529 to 41634b3 Compare June 15, 2026 23:04
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/skills Skills system (list, view, manage) provider/openai OpenAI / Codex Responses API area/auth Authentication, OAuth, credential pools labels Jun 15, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused regression coverage. The skill-hash half addresses a current asymmetry: disk hashing sorts Path values in tools/skills_guard.py:695, while bundle hashing still sorts raw strings in tools/skills_hub.py:3692.

Problems

  • The Codex bypass is unsafe as a provider-wide rule. hermes_cli/auth_commands.py:316-324 creates one self-contained pool entry per Codex account. Skipping recovery on every usage_limit_reached would bypass a second independent account. Current main intentionally rotates immediately for this signal in agent/agent_runtime_helpers.py:833-855 (commit 80fa92a491c67ae98c43ea723487db640d99857f).
  • The fallback plumbing has moved: current main gates fallback through agent/conversation_loop.py:3203-3208, and that helper no longer accepts error context.

Suggested changes

  • Split and port the hash-order fix with its regression test.
  • Rework the Codex part to retain multi-account rotation, or establish a verified account-identity condition before bypassing the pool; cover the current conversation-loop fallback path.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/install-update Installer, updater, packaging, wheels, doctor labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools area/install-update Installer, updater, packaging, wheels, doctor comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants