Repository navigation
refactor(github-copilot): narrow runtime facade - #120544
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 8, 2026, 5:42 AM ET / 09:42 UTC. ClawSweeper reviewWhat this changesThis PR reduces the GitHub Copilot plugin’s lazy runtime facade to the four runtime helpers its entry points actually load, and removes stale login-command test mocks. Merge readinessKeep open. This maintainer-authored cleanup correctly makes the private lazy facade match its two production consumers; no correctness or security finding was identified. Priority: P3 Review scores
Verification
How this fits togetherThe GitHub Copilot plugin loads a small runtime facade only when authentication, starter-model selection, dynamic discovery, or usage reporting needs it. Login, stream wrapping, and model fallback behavior are owned by direct plugin modules outside that lazy boundary. flowchart LR
A[Plugin entry] --> B[Lazy runtime facade]
A --> C[Direct auth and stream owners]
D[Dynamic model discovery] --> B
B --> E[Runtime authentication]
B --> F[Starter model and usage]
C --> G[Provider registration]
E --> G
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -21, Tests -5. Total -26 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the runtime facade private and limited to the four actual lazy-load dependencies, with login, stream, auth-store, and model fallback behavior continuing through their direct owners. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal facade-boundary cleanup, not a reported user failure. Is this the best way to solve the issue? Yes. The facade now contains precisely the dynamically consumed runtime contract; retaining the other re-exports would preserve misleading coupling, while moving them into a public API would broaden the contract unnecessarily. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c5d00cb47ddb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for exact head
|
* refactor(github-copilot): narrow runtime facade * style(github-copilot): format runtime exports
What Problem This Solves
Resolves an internal maintenance problem where the GitHub Copilot plugin's lazy runtime facade exposed eight symbols that no production consumer loads through that boundary. The broad barrel also made unrelated auth, login, model, and stream ownership look coupled, while tests mocked and asserted a login command that the plugin entrypoint never imported from the runtime facade.
Why This Change Was Made
The runtime facade now directly exports only the four symbols loaded by
index.tsanddynamic-models.ts: the default API base URL, runtime auth resolver, starter-model resolver, and usage fetcher. The eight unused re-exports and their static imports are removed, along with five stale login-command mock/assertion lines. The deprecated login facade remains owned byapi.ts; removing that separate compatibility surface was explicitly rejected as out of scope.This is an AI-assisted change from authorized repair sweep task #8.
User Impact
No user-visible behavior changes. The plugin keeps the same auth, discovery, usage, and stream behavior with a smaller, more accurate lazy runtime boundary.
Production LOC: +4/-25, net -21. Test LOC: +0/-5, net -5.
Evidence
api.js, notregister.runtime.js.register.runtime.ts; three PRs touchingindex.test.tsmodify unrelated thinking/replay cases.node scripts/run-vitest.mjs extensions/github-copilot/index.test.ts extensions/github-copilot/provider-discovery.contract.test.ts extensions/github-copilot/stream.test.ts— 3 files, 60 tests passed on the corrected checkout.git diff --check— passed.pnpm format:checkandpnpm build— AWS Crabbox runrun_b2dda8e91f77, exit 0.b4dd9596a3f386bec06ac163098990923cc4f892.Exact-head CI and ClawSweeper state will be verified before landing.