fix(tests): mock copilot token resolution in auth_remove_copilot test#31953
fix(tests): mock copilot token resolution in auth_remove_copilot test#31953talwayh1 wants to merge 2 commits into
Conversation
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.
b8e1b40 to
3829aab
Compare
|
Closing this PR — we don't accept commits authored under fabricated maintainer/CI identities. Specifically:
If you've identified a real test breakage or flake on For reference, the |
What
Fix
test_auth_remove_copilot_suppresses_all_variantsfailing in CI on the i18n branch.Root Cause
The test writes a
gh_clientry and callsauth_remove_command()which invokesload_pool(). Since PR #31416,_prune_stale_seeded_entries()removes all borrowed credential sources (includinggh_cli) when token resolution returns empty in CI/test environments. This causespool.resolve_target("1")to fail with "No credential #1".Fix
Add
monkeypatchforresolve_copilot_tokenandget_copilot_api_tokenso thegh_clientry survives borrowed-credential pruning insideload_pool()(Pitfall #13).Verification
python3 -m pytest tests/hermes_cli/test_auth_commands.py::test_auth_remove_copilot_suppresses_all_variants -xvs # PASSEDCI Run: https://github.com/NousResearch/hermes-agent/actions/runs/26390307059