Repository navigation
fix(github-copilot): treat whitespace-only enterprise scope as invalid - #160171
Conversation
Forward-port the normalization correction from 3d0390e. Preserve absent and empty public metadata while refusing whitespace-only scope for copy, adoption, and ownership. WIP: reproduced two failing regression cases before the fix; 59 focused tests pass afterward. check:changed remains incomplete at the work-order time budget; branch autoreview and publication remain pending. Co-authored-by: Patrick Erichsen <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 28, 2026, 1:47 AM ET / 05:47 UTC. ClawSweeper reviewWhat this changesThe branch rejects whitespace-only Copilot tenant metadata in credential-sharing scope checks and adds formatter, copy, adoption, and ownership regression cases. Merge readiness⛔ Blocked before merge - 2 items remain Current main still misclassifies whitespace-only Copilot tenant metadata as public for credential sharing. The merged tenant-custody work does not cover this edge case, so this PR remains useful. Priority: P2 Review scores
Verification
How this fits togetherThe GitHub Copilot plugin interprets tenant metadata stored with OAuth credentials. Agent authentication uses that scope to decide whether credentials may be copied, adopted, or treated as shared. flowchart LR
A[Stored Copilot credential] --> B[Provider scope normalization]
B --> C{Supported tenant scope?}
C -- Yes --> D[Credential identity checks]
D --> E[Copy, adopt, or share]
C -- No --> F[Keep credential separate]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +53. Total +57 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep tenant interpretation with the Copilot plugin so malformed stored metadata cannot borrow a public credential, while absent and empty metadata retain public behavior. Do we have a high-confidence way to reproduce the issue? Yes, from current-main source: whitespace-only metadata normalizes to public even though credential formatting rejects it. The PR reports failing baseline regressions; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Changing the provider-owned normalizer is the narrowest repair for the shared copy, adoption, and ownership gates. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1ca6a5d0a801. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Test cost (ClawSweeper P1/P2 item): |
Whitespace-only Copilot enterpriseUrl metadata cannot be formatted, so routing-scope normalization now treats it as invalid instead of public; ownership, copy and adoption no longer match it to a public-scope credential. Forward-port of release/2026.9.7 3d0390e (normalization correction on openclaw#139131). Co-authored-by: Patrick Erichsen <[email protected]>
What Problem This Solves
GitHub Copilot credentials with a whitespace-only
enterpriseUrlcannot be formatted (the OAuth formatter rejects them), but routing-scope normalization trimmed the value and returned the public scope. OAuth ownership, copy and adoption checks therefore treated an unformattable whitespace-only credential as the same tenant as a public one.This correction was made on the abandoned
release/2026.9.7branch (3d0390e, on top of #139131) and never reached main; this forward-ports it before that branch is deleted.Summary
normalizeGithubCopilotOAuthScopekeeps absent/empty metadata as public scope but returns no scope for whitespace-only metadata, matching the formatter.extensions/github-copilot/oauth.test.tsandsrc/agents/auth-profiles/oauth.copilot-ownership.test.ts.Evidence
expected true to be false); 59 tests passed across four files after the fix.pnpm check:changed: guards and core test typechecks passed locally before the host-load time budget stopped it during extension typechecking; remaining lanes are on this PR's CI.