Skip to content

refactor(github-copilot): reuse prepared embedding credentials - #130703

Merged
steipete merged 1 commit into
mainfrom
codex/copilot-prepared-auth-cleanup-r10
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/copilot-prepared-auth-cleanup-r10

Conversation

@steipete

@steipete steipete commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Copilot embedding setup already resolves authentication before discovering models, but its private provider factory still carries an unreachable authentication fallback and returns an unused client. That duplicate path obscures which layer owns credential preparation.

Why This Change Was Made

Make the private factory consume the prepared base URL, headers, model, and fetch implementation, and return the embedding provider directly. Headers and fetch are still captured after discovery, with the same static → remote → bearer-header precedence.

The existing 10-second discovery deadline, authentication selection, per-query request fanout, document batching, vector validation, error handling, redaction, cancellation, and guarded-transport cleanup are unchanged. No configuration, public SDK, or persistence changes.

User Impact

No intended user-visible behavior change. This removes an obsolete internal path while preserving Copilot memory-search behavior.

Production: +30/−65 lines, net −35. Tests: +76/−23 lines, net +53.

Evidence

Reviewed commit and CI head: 1656cf67a30df7ba146e83341145a82bf159d7ac.

  • Before and after the cleanup: 29 tests passed across extensions/github-copilot/embeddings.test.ts and extensions/github-copilot/embeddings.transport.test.ts, using node scripts/run-vitest.mjs with one worker. These include real-socket discovery deadlines, credential redaction, and stored-profile/custom-endpoint request characterization. The characterization verifies bearer-header precedence, exact query/document request bodies, vector reordering, and normalization.
  • Before and after: the real provider adapter authenticated with an existing credential, performed one account lookup and one model discovery, then embedded a query and a two-text document batch. All four HTTP requests returned 200; all three vectors had 1,536 finite dimensions and unit norm. The existing read-only auth-store mode was used; no new credentials or auth migrations were created.
  • Formatting and git diff --check passed. Independent source/proof review and Codex autoreview through P2 found no actionable issues.
  • Local type-aware lint is not green: the identical command fails on untouched baseline 3255882803c78de5103d2d37f7698add84f34c5d and this patch at the unchanged SsrFPolicy annotation. These isolated worktrees lack the generated SDK declaration selected by the plugin package-boundary configuration. No rule or annotation was weakened. Exact-head hosted CI passed lint, production types, test types, and all tests with the generated declarations available.
  • The first hosted build failed its unrelated UI startup gzip budget: 343,445 bytes against a 343,442-byte limit. One rerun of the failed jobs, with the same source and budget, passed at 343,404 bytes. The 41-byte output variation is observed; its precise cause is not established. CI attempt 2 and its aggregate gate passed on the exact reviewed head. No further retry or budget change was made.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 27, 2026 04:54
@steipete
steipete merged commit d77e2a5 into main Aug 27, 2026
222 of 225 checks passed
@steipete
steipete deleted the codex/copilot-prepared-auth-cleanup-r10 branch August 27, 2026 05:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant