fix(test): mock copilot token seed in auth_remove suppression test#31926
fix(test): mock copilot token seed in auth_remove suppression test#31926talwayh1 wants to merge 1 commit into
Conversation
The test writes a copilot gh_cli credential to auth.json and expects load_pool() to keep it. Since PR NousResearch#31416, _prune_stale_seeded_entries() treats gh_cli as a borrowed source and prunes it when no real token exists. The test environment has no gh auth token, so the entry gets pruned and resolve_target('1') fails with 'No credential NousResearch#1'. Fix: monkeypatch resolve_copilot_token + get_copilot_api_token so the gh_cli entry is re-seeded (and therefore retained) during load_pool().
|
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
Fixes
test_auth_remove_copilot_suppresses_all_variantsregression onmaincaused by #31416.Root Cause
PR #31416 changed
_prune_stale_seeded_entries()to treatgh_clias a borrowed credential source. Duringload_pool("copilot"), whenresolve_copilot_token()returns no token (no realghCLI in the test environment), thegh_clientry is pruned. The test then callsresolve_target("1")on an empty pool and gets "No credential #1. Provider: copilot."Fix
Mock
resolve_copilot_tokenandget_copilot_api_tokenso thegh_clientry is re-seeded duringload_pool(), surviving the borrowed-credential pruning.Verification