Skip to content

fix(tests): mock copilot token resolution in auth_remove_copilot test#31953

Closed
talwayh1 wants to merge 2 commits into
NousResearch:hermes/hermes-1874d19d-i18nfrom
talwayh1:ci-fix/i18n-copilot-borrowed-prune
Closed

fix(tests): mock copilot token resolution in auth_remove_copilot test#31953
talwayh1 wants to merge 2 commits into
NousResearch:hermes/hermes-1874d19d-i18nfrom
talwayh1:ci-fix/i18n-copilot-borrowed-prune

Conversation

@talwayh1

Copy link
Copy Markdown

What

Fix test_auth_remove_copilot_suppresses_all_variants failing in CI on the i18n branch.

Root Cause

The test writes a gh_cli entry and calls auth_remove_command() which invokes load_pool(). Since PR #31416, _prune_stale_seeded_entries() removes all borrowed credential sources (including gh_cli) when token resolution returns empty in CI/test environments. This causes pool.resolve_target("1") to fail with "No credential #1".

Fix

Add monkeypatch for resolve_copilot_token and get_copilot_api_token so the gh_cli entry survives borrowed-credential pruning inside load_pool() (Pitfall #13).

Verification

python3 -m pytest tests/hermes_cli/test_auth_commands.py::test_auth_remove_copilot_suppresses_all_variants -xvs
# PASSED

CI Run: https://github.com/NousResearch/hermes-agent/actions/runs/26390307059

teknium1 and others added 2 commits May 25, 2026 01:04
Translates the full English docs corpus (335 files) into Simplified
Chinese under website/i18n/zh-Hans/. Combined with PR NousResearch#31895 (cross-
locale link fix), the 简体中文 locale toggle now serves a complete
Chinese site with working cross-page navigation.

Pipeline:
- Claude Sonnet 4.6 via OpenRouter, 8-way concurrent
- Preserves frontmatter keys, code blocks, MDX/JSX, link URLs, brand
  names, and technical jargon (prompt/token/hook/MCP/ACP/etc.)
- Translates only frontmatter title/description and prose
- Two largest files (configuration.md 93KB, research-paper-writing.md
  107KB) retried with 64K max_tokens after initial fence-drift
- 3 manual post-fixes for MDX edge cases the model didn't escape:
  < in optional-skills-catalog table, double-quotes in an alt= tag,
  and a bare URL adjacent to a full-width period

Cost: ~$30 total (Sonnet 4.6 input $3/M + output $15/M).

Verified `npm run build` succeeds for both en and zh-Hans locales,
no double-prefixed /docs/zh-Hans/docs/ URLs in rendered output,
all in-page navigation resolves correctly.

Translations are machine-generated and may need human review on
specific pages — but they're an enormous improvement over the
previous state (3 zh-Hans pages out of 335).
The test writes a gh_cli entry and calls load_pool(), but
_prune_stale_seeded_entries() (from PR NousResearch#31416) removes all borrowed
credential sources when token resolution returns empty in CI.

Add monkeypatch for resolve_copilot_token and get_copilot_api_token
so the gh_cli entry survives borrowed-credential pruning.
@teknium1 teknium1 force-pushed the hermes/hermes-1874d19d-i18n branch from b8e1b40 to 3829aab Compare May 25, 2026 08:30
@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools labels May 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #31946 which was already merged (2026-05-25). Also competes with open #31926 (same fix). This PR is on an i18n branch and bundles 80+ unrelated zh-Hans translation files.

@teknium1

Copy link
Copy Markdown
Contributor

Closing this PR — we don't accept commits authored under fabricated maintainer/CI identities. Specifically:

  • Commits in this PR are authored as Hermes CI Self-Heal, Hermes CI Bot, or Hermes CI (hermes-ci-self-heal@nousresearch.com / hermes-ci-bot@nousresearch.com / hermes-ci@nousresearch.com). Those identities do not exist on our team. There is no Hermes CI self-healing bot. Presenting AI-generated commits under fabricated maintainer-looking identities misrepresents authorship.

  • Several PRs in your recent burst also include commits authored under other contributors' names/emails (Wesley Simplicio, briandevans) bundled with the bot-authored commit. We can't merge anything where authorship is ambiguous, mixed, or appropriated.

  • The titles of several PRs (e.g. "fix(test): make X xdist-safe") describe a small test fix while the diff contains hundreds of lines of unrelated work pulled from other branches. We require PR scope to match the title and description.

If you've identified a real test breakage or flake on main and want to fix it, you're welcome to do so — but commit under your own GitHub identity, scope the diff to that one fix, and describe it accurately. PRs that meet those bars get a fair review.

For reference, the test_auth_remove_copilot_suppresses_all_variants regression specifically (PRs #31926 and #31953 in this set) was already fixed on main by 920b350 ("test(auth): align copilot-remove test with borrowed-credential policy") before this PR was opened.

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 comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants