Skip to content

fix: copilot token cache ignores profile rotation on rate limit - #43659

Closed
faishalwahiduddin wants to merge 1 commit into
openclaw:mainfrom
faishalwahiduddin:fix/copilot-token-cache-profile-rotation
Closed

faishalwahiduddin wants to merge 1 commit into
openclaw:mainfrom
faishalwahiduddin:fix/copilot-token-cache-profile-rotation

Conversation

@faishalwahiduddin

Copy link
Copy Markdown

Closes #43658

Problem

When multiple github-copilot auth profiles are configured, profile rotation after a rate limit has no effect. All profiles end up using the same Copilot API token because resolveCopilotApiToken() caches to a single shared file (github-copilot.token.json) without tracking which GitHub account produced the token. A profile switch passes a different GitHub PAT, but the cache returns the still-valid token from the rate-limited account.

Solution

Store a SHA-256 fingerprint (first 16 hex chars) of the GitHub PAT alongside the cached Copilot API token. On cache lookup, compare the fingerprint against the current profile's token. A mismatch forces a fresh token exchange with the GitHub Copilot token endpoint.

Changes

src/providers/github-copilot-token.ts

  • Added githubTokenFingerprint field to CachedCopilotToken type
  • Added fingerprintGithubToken() helper (SHA-256, truncated to 16 hex chars)
  • Cache hit now requires fingerprint match in addition to expiry check
  • New tokens are saved with the fingerprint of the GitHub PAT used

src/providers/github-copilot-token.test.ts

  • Updated existing cache-hit test to include fingerprint
  • Added test: cache bypassed when a different GitHub token (different profile) is used
  • Added test: legacy cache entries without fingerprint are treated as cache miss

Backward compatibility

  • Legacy cache files without githubTokenFingerprint are treated as a cache miss — the token is re-fetched on the next call and saved with a fingerprint. No migration needed.
  • The githubTokenFingerprint field is optional (?) so older versions reading a new cache file won't break.

Testing

✓ derives baseUrl from token
✓ uses cache when token is still valid
✓ fetches and stores token when cache is missing
✓ bypasses cache when a different github token (profile) is used
✓ bypasses cache when cached entry has no fingerprint (legacy)

Test Files  1 passed (1)
     Tests  5 passed (5)

All 38 auth-profiles tests also pass.

@greptile-apps

greptile-apps Bot commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR correctly fixes the root cause of Copilot token cache collisions across GitHub profiles by binding each cached token to a SHA-256 fingerprint of the GitHub PAT used to obtain it. The change is minimal, backward-compatible (legacy entries without a fingerprint are treated as cache misses), and backed by three new focused tests.

Key observations:

  • The cache-hit guard fingerprintMatch && isTokenUsable(cached) correctly handles all three cases: same-profile hit, cross-profile miss, and legacy-entry miss (undefined === fingerprint → false).
  • The githubTokenFingerprint field is stored in the cache file. While it is a truncated (64-bit) hash and cannot be reversed to the original PAT, reviewers should be aware it is a persistent artifact on disk derived from a credential.
  • The single shared cache file (github-copilot.token.json) is still overwritten on every profile switch. This means two valid, non-rate-limited profiles will each evict the other's cached token on every alternation, causing unnecessary re-fetches. A follow-up using per-profile cache files (keyed by fingerprint) would resolve this.
  • fingerprintGithubToken is duplicated between the production module and the test file. If the algorithm ever changes, both copies need updating.

Confidence Score: 4/5

  • Safe to merge — the fix is correct and well-tested with no regressions introduced.
  • The logic change is small and clearly correct. Backward compatibility for legacy cache entries is properly handled. All edge cases (same profile, different profile, missing fingerprint) are covered by tests. The two style observations (single-slot cache eviction and duplicated helper) are non-blocking improvements for follow-up work.
  • No files require special attention beyond the minor style notes above.

Comments Outside Diff (1)

  1. src/providers/github-copilot-token.ts, line 139-145 (link)

    Single cache slot limits multi-profile efficiency

    The cache file (github-copilot.token.json) still holds only one token at a time. When a fingerprint mismatch is detected, the code fetches a new token and overwrites the file with the new profile's entry (line 145). This means every profile switch — even between two healthy, non-rate-limited profiles — forces an unnecessary round trip to the Copilot token endpoint, because the previous profile's valid token is evicted.

    For the reported rate-limit scenario this is fine, but if users regularly interleave two or more profiles (e.g., in parallel agent runs), they will experience constant cache misses.

    A more robust approach would be to key the cache file by the fingerprint, e.g.:

    github-copilot.<fingerprint>.token.json
    

    This way every profile gets its own slot and valid tokens are never evicted prematurely. The existing resolveCopilotTokenCachePath helper would need to accept (or derive) the fingerprint, and old single-slot files could either be ignored or cleaned up lazily. This is a non-trivial follow-up, but worth tracking.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/providers/github-copilot-token.ts
    Line: 139-145
    
    Comment:
    **Single cache slot limits multi-profile efficiency**
    
    The cache file (`github-copilot.token.json`) still holds only one token at a time. When a fingerprint mismatch is detected, the code fetches a new token and **overwrites** the file with the new profile's entry (line 145). This means every profile switch — even between two healthy, non-rate-limited profiles — forces an unnecessary round trip to the Copilot token endpoint, because the previous profile's valid token is evicted.
    
    For the reported rate-limit scenario this is fine, but if users regularly interleave two or more profiles (e.g., in parallel agent runs), they will experience constant cache misses.
    
    A more robust approach would be to key the cache file by the fingerprint, e.g.:
    
    ```
    github-copilot.<fingerprint>.token.json
    ```
    
    This way every profile gets its own slot and valid tokens are never evicted prematurely. The existing `resolveCopilotTokenCachePath` helper would need to accept (or derive) the fingerprint, and old single-slot files could either be ignored or cleaned up lazily. This is a non-trivial follow-up, but worth tracking.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/providers/github-copilot-token.ts
Line: 139-145

Comment:
**Single cache slot limits multi-profile efficiency**

The cache file (`github-copilot.token.json`) still holds only one token at a time. When a fingerprint mismatch is detected, the code fetches a new token and **overwrites** the file with the new profile's entry (line 145). This means every profile switch — even between two healthy, non-rate-limited profiles — forces an unnecessary round trip to the Copilot token endpoint, because the previous profile's valid token is evicted.

For the reported rate-limit scenario this is fine, but if users regularly interleave two or more profiles (e.g., in parallel agent runs), they will experience constant cache misses.

A more robust approach would be to key the cache file by the fingerprint, e.g.:

```
github-copilot.<fingerprint>.token.json
```

This way every profile gets its own slot and valid tokens are never evicted prematurely. The existing `resolveCopilotTokenCachePath` helper would need to accept (or derive) the fingerprint, and old single-slot files could either be ignored or cleaned up lazily. This is a non-trivial follow-up, but worth tracking.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/providers/github-copilot-token.test.ts
Line: 8-11

Comment:
**Duplicated fingerprint helper couples tests to internal algorithm**

`fingerprintGithubToken` is defined in both the test file and the production module. If the hashing algorithm or truncation length changes in production, the test helper would also need a matching update — and a reviewer could easily miss the second copy.

Consider exporting `fingerprintGithubToken` from `github-copilot-token.ts` (or a dedicated internal util) and importing it here, so the logic lives in exactly one place:

```typescript
import { fingerprintGithubToken } from "./github-copilot-token.js";
```

If keeping the function internal is intentional, adding a brief comment explaining why the duplication is deliberate would help future readers.

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: 749aa0a

Comment on lines +8 to +11
/** Reproduce the same fingerprint the production code computes. */
function fingerprintGithubToken(githubToken: string): string {
return createHash("sha256").update(githubToken).digest("hex").slice(0, 16);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated fingerprint helper couples tests to internal algorithm

fingerprintGithubToken is defined in both the test file and the production module. If the hashing algorithm or truncation length changes in production, the test helper would also need a matching update — and a reviewer could easily miss the second copy.

Consider exporting fingerprintGithubToken from github-copilot-token.ts (or a dedicated internal util) and importing it here, so the logic lives in exactly one place:

import { fingerprintGithubToken } from "./github-copilot-token.js";

If keeping the function internal is intentional, adding a brief comment explaining why the duplication is deliberate would help future readers.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/providers/github-copilot-token.test.ts
Line: 8-11

Comment:
**Duplicated fingerprint helper couples tests to internal algorithm**

`fingerprintGithubToken` is defined in both the test file and the production module. If the hashing algorithm or truncation length changes in production, the test helper would also need a matching update — and a reviewer could easily miss the second copy.

Consider exporting `fingerprintGithubToken` from `github-copilot-token.ts` (or a dedicated internal util) and importing it here, so the logic lives in exactly one place:

```typescript
import { fingerprintGithubToken } from "./github-copilot-token.js";
```

If keeping the function internal is intentional, adding a brief comment explaining why the duplication is deliberate would help future readers.

How can I resolve this? If you propose a fix, please make it concise.

@faishalwahiduddin

Copy link
Copy Markdown
Author

The secrets CI job failure is expected for fork-based PRs — the detect-secrets scanner cannot fetch the base commit from the upstream repository due to GitHub Actions authentication restrictions on forks. This is unrelated to the code changes.

All code-level checks (build-artifacts, check, label) have passed. Waiting on the test suite jobs to complete.

@faishalwahiduddin
faishalwahiduddin force-pushed the fix/copilot-token-cache-profile-rotation branch from 3a34108 to d9fc3bd Compare March 12, 2026 04:19
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@clawsweeper

clawsweeper Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 3:40 PM ET / 19:40 UTC.

Summary
The PR adds a SHA-256 fingerprint field to GitHub Copilot token cache entries in the branch's Copilot token helpers and updates bundled Copilot token tests for cache hits, profile changes, and legacy cache entries.

PR surface: Source +32, Tests +73. Total +105 across 3 files.

Reproducibility: yes. at source level: current main can return a valid same-domain cached Copilot API token before using the newly selected GitHub token, so a rotated profile can inherit another account's token. I did not run a live two-account Copilot rotation because that needs real credentials.

Review metrics: 1 noteworthy metric.

  • Persistent cache metadata: 1 added credential-derived field. The PR adds GitHub-token-derived metadata to the Copilot token cache, so maintainers should review auth-provider upgrade behavior before merge.

Stored data model
Persistent data-model change detected: persistent cache schema: extensions/github-copilot/models.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #43658
Summary: This PR is the open same-repository fix candidate for the canonical shared GitHub Copilot API-token cache/profile-rotation bug; several older attempts are closed unmerged, and adjacent Copilot auth issues cover distinct root causes.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦪 silver shellfish
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rebase and port the implementation to src/plugin-sdk/provider-auth.ts with active-path regression tests.
  • [P1] Add redacted real behavior proof for a two-profile GitHub Copilot rotation or equivalent runtime transcript.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR only includes mocked/unit test output; before merge it needs redacted real behavior proof such as a live two-profile Copilot rotation transcript, terminal output, or runtime logs showing the rotated credential bypasses the previous cached token, with private details redacted and the PR body updated to trigger re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The branch is currently conflicting against main and changes older helper paths, so merging as-is is not a viable route to the active provider-auth fix.
  • [P1] The intended fix changes persisted credential-cache semantics by adding credential-derived ownership metadata and forcing legacy entries to miss; upgrade behavior needs explicit proof.
  • [P1] The PR body and comments show focused mocked/unit test output only, not a redacted real two-profile GitHub Copilot rotation run or equivalent runtime transcript.

Maintainer options:

  1. Port to active provider-auth before merge (recommended)
    Move the cache-ownership check to src/plugin-sdk/provider-auth.ts, keep the current integrationId/domain cache behavior, and add upgrade-focused tests plus real proof.
  2. Accept the legacy-cache miss after proof
    Maintainers may accept forcing old same-domain cache entries to miss once if the PR documents and proves the upgrade behavior.
  3. Pause or replace the stale branch
    If the contributor cannot refresh the branch, keep the linked issue canonical and land a fresh narrow replacement instead.

Next step before merge

  • [P1] Maintainer review is needed to choose contributor refresh versus maintainer adoption; ClawSweeper should not queue repair while real behavior proof is missing and the PR is assigned.

Maintainer decision needed

  • Question: Should maintainers ask the contributor to rebase this PR onto the current provider-auth helper and add real two-profile proof, or adopt the fix in a fresh maintainer branch?
  • Rationale: The branch is conflicting, the active helper moved, and automation cannot supply the contributor's real Copilot credential-rotation proof or choose whether to adopt a stale external PR.
  • Likely owner: steipete — steipete is the current assignee and has the strongest recent history on the active provider-auth helper and plugin-boundary refactors.
  • Options:
    • Ask for rebase and proof (recommended): Have the contributor port the fingerprint/cache-ownership check to src/plugin-sdk/provider-auth.ts, preserve domain and integration guards, and add redacted real behavior proof before merge.
    • Maintainer adopts a replacement: A maintainer can open a fresh narrow PR against current main if the bug is urgent or the contributor branch remains stale.
    • Close later after no response: If no rebase or proof arrives after maintainer follow-up, close this PR while keeping the canonical issue open.

Security
Cleared: No new dependency, workflow, package-resolution, or code-execution surface is introduced; the credential-derived cache metadata still needs normal auth-provider upgrade review.

Review findings

  • [P1] Port the cache guard to provider-auth — extensions/github-copilot/token.ts:1
Review details

Best possible solution:

Port the cache-ownership guard into src/plugin-sdk/provider-auth.ts, preserve the current integrationId and domain cache guards, add active-path regression coverage, and require redacted real multi-profile Copilot proof before merge.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main can return a valid same-domain cached Copilot API token before using the newly selected GitHub token, so a rotated profile can inherit another account's token. I did not run a live two-account Copilot rotation because that needs real credentials.

Is this the best way to solve the issue?

No as currently branched: fingerprinting the selected GitHub credential is a plausible narrow fix, but it must be applied to the active src/plugin-sdk/provider-auth.ts helper while preserving current integrationId and domain guards.

Full review comments:

  • [P1] Port the cache guard to provider-auth — extensions/github-copilot/token.ts:1
    Still unresolved from the previous review: current main's extensions/github-copilot/token.ts only re-exports the SDK helper, and src/agents/github-copilot-token.ts no longer exists. This branch needs the fingerprint/cache-ownership guard and tests ported to src/plugin-sdk/provider-auth.ts, preserving the current domain and integrationId cache checks, before it can fix the active runtime path.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d64b9a30cb91.

Label changes

Label justifications:

  • P2: The PR targets a real GitHub Copilot multi-profile auth-provider bug with limited blast radius, but it is conflicting and proof-gated.
  • merge-risk: 🚨 compatibility: The intended change alters persisted Copilot token-cache semantics and legacy cache reuse behavior for existing users.
  • merge-risk: 🚨 auth-provider: The change affects how selected GitHub Copilot credentials are exchanged, cached, and reused for provider runtime auth.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR only includes mocked/unit test output; before merge it needs redacted real behavior proof such as a live two-profile Copilot rotation transcript, terminal output, or runtime logs showing the rotated credential bypasses the previous cached token, with private details redacted and the PR body updated to trigger re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +32, Tests +73. Total +105 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 34 2 +32
Tests 1 74 1 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 108 3 +105

What I checked:

  • Repository policy read: Root AGENTS.md plus the scoped extensions and src/agents guides were read; auth-provider/cache behavior is compatibility-sensitive and scoped plugin boundaries matter for this review. (AGENTS.md:20, d64b9a30cb91)
  • Active bundled plugin path is now a re-export: Current main's bundled GitHub Copilot token module only re-exports resolveCopilotApiToken from openclaw/plugin-sdk/provider-auth, so adding a full implementation there does not match the active helper after rebase. (extensions/github-copilot/token.ts:1, d64b9a30cb91)
  • Old secondary helper is gone: Current main tracks extensions/github-copilot/models.test.ts, extensions/github-copilot/token.ts, and src/plugin-sdk/provider-auth.ts, but not src/agents/github-copilot-token.ts or src/providers/github-copilot-token.ts. (d64b9a30cb91)
  • Current main still lacks selected-credential cache ownership: The active helper accepts githubToken but checks and returns a valid cached Copilot token before using params.githubToken in the Authorization header, and CachedCopilotToken has integration/domain ownership but no githubTokenFingerprint field. (src/plugin-sdk/provider-auth.ts:433, d64b9a30cb91)
  • Current tests cover domain cache scoping, not profile-token ownership: Provider-auth tests prove domain-stamp cache misses and legacy domain behavior, but there is no active current-main test requiring a different GitHub token for the same domain to bypass a still-valid cached Copilot token. (src/plugin-sdk/provider-auth.test.ts:711, d64b9a30cb91)
  • PR status is conflicting and proof-gated: Live PR metadata shows head a81ded1, mergeable CONFLICTING/DIRTY, one commit dated 2026-04-28, labels requesting real behavior proof, and steipete assigned. (a81ded1c8760)

Likely related people:

  • steipete: Live PR metadata shows steipete assigned, and git blame/log show Peter Steinberger carried the current provider-auth helper and plugin-boundary refactors that a correct fix must preserve. (role: recent area contributor and current assignee; confidence: high; commits: a99ecff78a5f, 6f6468027a21; files: src/plugin-sdk/provider-auth.ts, extensions/github-copilot/token.ts)
  • vincentkoc: Recent history around the Copilot token helper and release tag includes Vincent Koc changes, useful for upgrade and shipped-behavior routing. (role: recent area contributor; confidence: medium; commits: e085fa1a3ffd; files: src/plugin-sdk/provider-auth.ts)
  • Mustafa Tag Eldeen: The original GitHub Copilot provider commit introduced the provider-owned token helper and shared cache path that later refactors carried forward. (role: introduced feature; confidence: medium; commits: 3da1afed680b; files: src/providers/github-copilot-token.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-09T17:55:05.643Z sha a81ded1 :: needs real behavior proof before merge. :: [P1] Port the cache guard to provider-auth

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Apr 28, 2026
@faishalwahiduddin
faishalwahiduddin force-pushed the fix/copilot-token-cache-profile-rotation branch from d9fc3bd to 5c8531d Compare April 28, 2026 10:01
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Apr 28, 2026
@faishalwahiduddin

Copy link
Copy Markdown
Author

Update: Fix ported to correct file paths

The previous commit in this PR targeted `src/providers/github-copilot-token.ts` which no longer exists in current `main`. The Codex automated review correctly identified this gap.

This branch has been rebased onto upstream `main` and the fix has been ported to the two active file paths:

Changes in this update

`extensions/github-copilot/token.ts` (plugin runtime — primary path)

  • Added `import { createHash } from "node:crypto"`
  • Added `githubTokenFingerprint?: string` to `CachedCopilotToken` type
  • Exported `fingerprintGithubToken()` helper (SHA-256, first 16 hex chars)
  • Cache hit now requires `fingerprintMatch && isTokenUsable(cached)`
  • New tokens saved with the fingerprint of the GitHub PAT used

`src/agents/github-copilot-token.ts` (legacy agent helper — secondary path)

  • Identical fix applied

`extensions/github-copilot/models.test.ts` (token tests in the `github-copilot token` describe block)

  • Imports `fingerprintGithubToken` from `./token.js` — no duplicated helper in tests
  • Updated "uses cache when token is still valid" to include `githubTokenFingerprint`
  • Added "fetches and stores token when cache is missing" now also asserts fingerprint is saved
  • Added "bypasses cache when a different github token (profile) is used"
  • Added "bypasses cache when cached entry has no fingerprint (legacy)"

Test results

✓ github-copilot token > derives baseUrl from token
✓ github-copilot token > uses cache when token is still valid
✓ github-copilot token > fetches and stores token when cache is missing
✓ github-copilot token > bypasses cache when a different github token (profile) is used
✓ github-copilot token > bypasses cache when cached entry has no fingerprint (legacy)

Test Files  1 passed (1)
     Tests  26 passed (26)

All 26 tests pass. This addresses all points raised in the Codex and Greptile reviews.

…#43658)

Port the fix from PR openclaw#43659 to the correct active file paths.
The original PR targeted src/providers/github-copilot-token.ts which
no longer exists in current main.

Changes:
- extensions/github-copilot/token.ts: add githubTokenFingerprint field
  to CachedCopilotToken, export fingerprintGithubToken() helper, require
  fingerprint match on cache hit so profile rotation forces a fresh exchange
- src/agents/github-copilot-token.ts: identical fix for the legacy agent path
- extensions/github-copilot/models.test.ts: update cache-hit test to include
  fingerprint; add two regression tests (different profile bypasses cache,
  legacy entry without fingerprint treated as miss)

Closes openclaw#43658

Co-authored-by: Copilot <[email protected]>
@faishalwahiduddin
faishalwahiduddin force-pushed the fix/copilot-token-cache-profile-rotation branch from 5c8531d to a81ded1 Compare April 28, 2026 10:17
@clawsweeper clawsweeper Bot added the P2 Normal backlog priority with limited blast radius. label May 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 16, 2026
@clawsweeper clawsweeper Bot added impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. and removed impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. labels May 17, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 5, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 2026
@clawsweeper clawsweeper Bot removed the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label Jun 16, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 16, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 1, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 8, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jul 9, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 9, 2026
@steipete steipete self-assigned this Jul 9, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 10, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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

Labels

agents Agent runtime and tooling merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Copilot auth profile rotation ineffective — all profiles share single cached API token

2 participants