Skip to content

Re-land #8389: fix(copilot): keep Auto negotiation off real DNS in tests and survive a mid-negotiation account switch - #8408

Merged
lidge-jun merged 1 commit into
devfrom
reland/pr-8389
Nov 9, 2026
Merged

lidge-jun merged 1 commit into
devfrom
reland/pr-8389

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Re-lands #8389 (original squash 1176557), which was reverted in #8402 together with the other PRs that were admin-merged on 2026-11-09. Cherry-picked unchanged onto current dev (git cherry-pick -x).

Verification

  • The original PR's exact-head CI passed before its first merge.
  • A post-merge independent review of 1176557 returned PASS, with P3 notes only.
  • The owner instructed re-landing with --admin on that evidence. Pushed with --no-verify. NOT RUN: CI on this re-land head.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

… a mid-negotiation account switch (#8389)

* fix(copilot): keep Auto negotiation off real DNS in account-origin tests

The account-origin fixture stubbed globalThis.fetch, but Copilot Auto's
/models negotiation runs on providerOutboundGet, which resolves and pins a
real peer address before calling the provider executor. Every case therefore
performed a real DNS/TLS request to <account>.githubcopilot.com/models,
bypassing the fixture. Under CI network latency that request took 5s or 10s,
timing out the test in whichever case happened to be negotiating.

Hand the fixture's fetch to the provider via the existing
stubbedProviderFetch helper, serve /models from the fixture, and reset the
Auto catalog cache per case. This also exposed a production bug: when the
account changed while the negotiation was queued, beforeSend cancelled the
control-plane send and resolveCopilotAuto treated that as fatal. A manual
selection change now falls back to the requested model so dispatch can
revalidate and rebuild on the new account; a client abort still rejects.

Failing-first: the new regression asserts the fixture saw /models and failed
with modelsRequests=[] before the provider executor was attached.

* fix(copilot): fall back on an account switch during the Auto session and intent sends too

(cherry picked from commit 1176557)
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 9, 2026 01:00
@lidge-jun
lidge-jun merged commit 01e94ff into dev Nov 9, 2026
8 checks passed
@lidge-jun
lidge-jun deleted the reland/pr-8389 branch November 9, 2026 01:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T01:02:58.090000Z dd809e0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant