Skip to content

Fix custom provider models named auto at the Copilot SDK boundary - #23059

Merged
sergiou87 merged 2 commits into
developmentfrom
fix-byok-auto-session-model
Nov 5, 2026
Merged

sergiou87 merged 2 commits into
developmentfrom
fix-byok-auto-session-model

Conversation

@sergiou87

@sergiou87 sergiou87 commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Related to #23026. This takes the SDK-boundary approach instead of changing the model request in AppStore.

Description

Custom providers can expose a model literally named auto, which collides with the Copilot runtime's automatic model selection.

Handle this only in CopilotStore.createSession: use byok-auto as the SDK session model while forwarding the provider's actual model name through provider.wireModel. Stored selections and Desktop model requests retain their real model IDs. Explicit wire-model overrides, other custom models, and built-in Copilot auto routing remain unchanged.

Eight regression cases exercise commit message generation and conflict resolution, including preservation of the original request. Four auto-model cases failed before the fix and passed afterward. These tests capture the SDK session configuration; live provider inference was not exercised.

  • yarn test app/test/unit/stores/copilot-store-credentials-test.ts app/test/unit/stores/copilot-store-test.ts — passed, 66 tests.
  • yarn test — initially failed four unrelated bare-repository fixture tests because the session inherits safe.bareRepository=explicit.
  • GIT_CONFIG_PARAMETERS="${GIT_CONFIG_PARAMETERS:+$GIT_CONFIG_PARAMETERS }'safe.bareRepository=all'" yarn test — passed, 2,253 tests; two skipped. The override applies only to this test command; no Git configuration was changed.
  • yarn lint:fix — passed.
  • yarn lint — passed.
  • yarn tsc --noEmit — passed.
  • Tested manually

Screenshots

N/A — no UI changes.

Release notes

Notes: [Fixed] Support custom Copilot providers with a model named auto

Alias custom provider models named 'auto' at the SDK boundary to avoid reserved Copilot routing, while preserving the actual wire model. Add coverage for commit message generation and conflict resolution, including explicit wire models and unchanged Copilot routing.

Co-Authored-By: Pol Rivero <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 07:30
@sergiou87
sergiou87 marked this pull request as ready for review October 22, 2026 07:31
@sergiou87
sergiou87 requested a review from a team as a code owner October 22, 2026 07:31
@sergiou87
sergiou87 requested a review from tidy-dev October 22, 2026 07:31

Copilot AI left a comment

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.

🟢 Approval recommended

The narrow boundary change preserves existing routing behavior and has focused regression coverage with no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes custom provider models named auto at the Copilot SDK boundary, keeping stored selections and Desktop model requests unchanged.

Changes:

  • Uses byok-auto as the SDK session model while forwarding the provider’s model through wireModel.
  • Preserves explicit wire-model overrides, other custom models, and built-in Copilot auto routing.
  • Adds eight regression cases covering commit message generation, conflict resolution, and request immutability.
File Description
app/​test/​unit/​stores/​copilot-store-credentials-test.ts Adds model-routing regression coverage for both features.
app/​src/​lib/​stores/​copilot-store.ts Applies the custom-provider alias when creating SDK sessions.

Review effort: Balanced

tidy-dev
tidy-dev previously approved these changes Nov 4, 2026
@sergiou87
sergiou87 merged commit 846af4a into development Nov 5, 2026
9 checks passed
@sergiou87
sergiou87 deleted the fix-byok-auto-session-model branch November 5, 2026 10:32
bahooo22 added a commit to bahooo22/github_desktop that referenced this pull request Nov 14, 2026
RU: Мерж апстрима a95e13a — переход на npm, версия 3.6.11-beta1

Апстрим влил 84 коммита, главный из которых — PR desktop#22983, миграция с yarn на npm:
удалён вендоренный yarn и все yarn.lock, добавлены package-lock.json, .npmrc и
обёртки script/npm.ts. Заодно пришли Copilot assisted commit (PR desktop#23132, desktop#23125,
desktop#23059) и dependabot ansi-regex. Наш готовый мерж PR desktop#23044 (1527ef6) принят
первым родителем.

Что изменено?
- `package.json` (+35/-27): апстримный блок scripts в npm-форме, `engines` node
  >=22.12.0 и npm >=11.17.0, `overrides` вместо `resolutions`; форковые
  `l10n:parity`, `l10n:audit`, `l10n:upstream`, `l10n:bundles` и
  `release-build-info` сохранены внутри нового блока, ссылок на yarn в scripts нет.
- `package-lock.json` (+17484/-0) и `app/package-lock.json` (+4163/-0): локи
  апстрима приняты без правок — иначе `npm ci` не пройдёт; `yarn.lock` (-7272),
  `app/yarn.lock` (-2304) и `vendor/yarn-1.21.1.js` (-147315) удалены апстримом.
- `.github/workflows/ci.yml` (+29/-24): приняты `cache: npm` и
  `cache-dependency-path` по четырём локам, `npm ci` и `npm run …`; поверх
  возвращён форковый кеш встроенного Git (dugite) с ключом по
  `hashFiles('app/package-lock.json')` и три попытки установки вокруг `npm ci`.
- `.github/actions/setup-ci-environment/action.yml` (+11/-18): апстримный
  `npm ci` с `npm_config_arch`, форковый повтор установки сохранён; шаг
  `yarn add --optional` для cross-arch Copilot SDK удалён — npm ставит нужный
  runtime сам через `--cpu`.
- `app/src/lib/stores/app-store.ts` (+1487/-380): принят апстримный
  `performPush`; блоки, где жили `t('appStore.pushingTo')` и подписи
  fast-forward, апстрим вынес из этого места, поэтому конфликт снят удалением
  наших блоков, импорт `t` из `../l10n/core` и остальные 10 вызовов на месте.
- `app/src/ui/changes/commit-message.tsx` (+845/-291): файл переписан апстримом
  (режимы коммита, `DropdownSelectButton`, `CopilotCommitPanel`); из нашей
  версии возвращены 42 вызова `t()` — заголовок кнопки и «последний коммит»,
  тексты хуков, подсказки длины summary, статус «Committed Just now», бейдж New,
  выбранные файлы и требование summary; импорт `t` добавлен заново.
- `app/src/ui/clone-repository/clone-repository.tsx` (+42/-0) и
  `app/src/ui/add-repository/create-repository.tsx` (+129/-40): объединены
  импорты — наш `t`/`Trans` плюс апстримные `canonicalMutationPath`,
  `isRepositoryAffectedByAssistedCommit`, `withoutRepositoryGitAccess`.
- `app/src/ui/lib/author-input/author-handle.tsx` (+19/-3): апстримная подпись
  с `instruction`; фраза «press backspace…» вынесена в новый ключ
  `authorHandle.removeInstruction`, «Remove {author}» — в
  `authorHandle.removeAriaLabel`.
- `app/src/ui/lib/author-input/author-input.tsx` (+157/-40): принята апстримная
  логика `pendingAuthorResolutions`; импорты `t` и `arrayEquals` объединены.
- `app/src/ui/worktrees/worktree-list-item-context-menu.ts` (+5/-2): объединены
  импорты `t` и `isRepositoryAffectedByAssistedCommit`.
- Остальные 237 файлов — правки апстрима без форкового пересечения.

Зачем?
Апстрим сменил пакетный менеджер: yarn в репозитории больше нет, установка идёт
через `npm ci`, а скрипты — через `npm run`. Без резолва форк остался бы с
yarn-вызовами в CI и релизных workflow, которые этот мерж ломает. Одновременно
появилась новая механика коммита через Copilot, и её строки надо было вернуть в
слой перевода, иначе эти экраны остались бы на английском.

Замеры?
Сняты на хосте, контейнер ещё не переведён на npm. `git merge --no-ff` дал 9
контентных конфликтов против 9 предсказанных `git merge-tree`; маркеров
конфликта в `app/src`, `app/locales`, `script`, `docs`, `.github` и
`package.json` — 0; `git diff --check` чист. Форковые скрипты в `package.json`
проверены разбором JSON: `l10n:parity/audit/upstream/bundles` и
`release-build-info` присутствуют, ни один script не содержит `yarn`. Точных
`t()`-вызовов: 10 в `app-store.ts`, 42 в `commit-message.tsx`; импорт `t`
добавлен там, где апстримная версия его не содержала. Локи не правились:
`git diff --cached --numstat 1527ef6 -- package-lock.json app/package-lock.json`
показывает только добавления апстрима. Итог мержа — 246 файлов,
+81 728/-160 879.

Принятый остаток?
Гейты не сняты: `tsc --noEmit`, `npm test`, `l10n:parity/audit/upstream/bundles`,
`lint`, `markdownlint` и `test:script` требуют контейнера на npm — его перевод и
пересборка идут следующим коммитом. Форматирование Prettier не прогонялось.
Восемь новых строк Copilot-панели и ещё около десяти краевых (`commitMessage.*`,
`authorHandle.*`) пока литералы: они переводятся отдельными коммитами, поэтому
`l10n:audit` временно покажет рост. `tlh` и `qya` для этих строк получат
перевод, а не заглушки. Пуш — за пользователем.

Итог
Дерево догнало апстрим по структуре: npm-миграция принята, форковые скрипты и
dugite-кеш сохранены, все локализованные экраны удержали перевод после
переписывания `commit-message.tsx` и выбора аккаунта. Проверка типов и тестов —
следующий шаг, до неё коммит считается непринятым.

---

EN: Merge upstream a95e13a - npm migration, version 3.6.11-beta1

Upstream brought 84 commits; the main one is PR desktop#22983, the yarn-to-npm migration:
the vendored yarn and every yarn.lock are gone, package-lock.json, .npmrc and the
script/npm.ts wrappers are in. Copilot assisted commit (PR desktop#23132, desktop#23125,
desktop#23059) and the ansi-regex bump came along. Our finished PR desktop#23044 merge
(1527ef6) is the first parent.

What changed?
- `package.json` (+35/-27): upstream's scripts block in npm form, `engines` node
  >=22.12.0 and npm >=11.17.0, `overrides` instead of `resolutions`; the fork's
  `l10n:parity`, `l10n:audit`, `l10n:upstream`, `l10n:bundles` and
  `release-build-info` survive inside the new block, and no script mentions yarn.
- `package-lock.json` (+17484/-0) and `app/package-lock.json` (+4163/-0):
  upstream locks taken untouched - editing them would break `npm ci`; `yarn.lock`
  (-7272), `app/yarn.lock` (-2304) and `vendor/yarn-1.21.1.js` (-147315) are
  deleted upstream.
- `.github/workflows/ci.yml` (+29/-24): `cache: npm` and `cache-dependency-path`
  for the four locks, `npm ci` and `npm run …` accepted; the fork's embedded Git
  (dugite) cache is restored on top with a key from
  `hashFiles('app/package-lock.json')` and three install attempts around `npm ci`.
- `.github/actions/setup-ci-environment/action.yml` (+11/-18): upstream `npm ci`
  with `npm_config_arch`, the fork's retry kept; the `yarn add --optional`
  cross-arch Copilot SDK step is gone because npm now picks the runtime via
  `--cpu`.
- `app/src/lib/stores/app-store.ts` (+1487/-380): upstream `performPush`
  accepted; the blocks that held `t('appStore.pushingTo')` and the fast-forward
  labels moved elsewhere upstream, so the conflict was resolved by dropping our
  blocks while the `t` import from `../l10n/core` and the other 10 calls stay.
- `app/src/ui/changes/commit-message.tsx` (+845/-291): the file was rewritten by
  upstream (commit modes, `DropdownSelectButton`, `CopilotCommitPanel`); 42 `t()`
  calls are back from our version - button title and "last commit", hook texts,
  summary-length hints, "Committed Just now", the New badge, file selection and
  the required-summary error; the `t` import was re-added.
- `app/src/ui/clone-repository/clone-repository.tsx` (+42/-0) and
  `app/src/ui/add-repository/create-repository.tsx` (+129/-40): imports merged -
  our `t`/`Trans` plus upstream's `canonicalMutationPath`,
  `isRepositoryAffectedByAssistedCommit`, `withoutRepositoryGitAccess`.
- `app/src/ui/lib/author-input/author-handle.tsx` (+19/-3): upstream's label with
  an `instruction`; the "press backspace…" phrase moved to the new
  `authorHandle.removeInstruction` key and "Remove {author}" to
  `authorHandle.removeAriaLabel`.
- `app/src/ui/lib/author-input/author-input.tsx` (+157/-40): upstream's
  `pendingAuthorResolutions` logic accepted; `t` and `arrayEquals` imports
  merged.
- `app/src/ui/worktrees/worktree-list-item-context-menu.ts` (+5/-2): `t` and
  `isRepositoryAffectedByAssistedCommit` imports merged.
- The remaining 237 files are upstream edits with no fork overlap.

Why?
Upstream switched package managers: yarn no longer exists in the repository,
installs go through `npm ci` and scripts through `npm run`. Without this
resolution the fork would keep yarn calls in CI and release workflows that this
merge breaks. At the same time Copilot gained a new commit flow whose strings had
to be returned to the translation layer, or those screens would stay English.

Verified
Measured on the host; the container is not on npm yet. `git merge --no-ff`
produced 9 content conflicts against 9 predicted by `git merge-tree`; conflict
markers in `app/src`, `app/locales`, `script`, `docs`, `.github` and
`package.json`: 0; `git diff --check` is clean. Fork scripts in `package.json`
were checked by parsing the JSON: `l10n:parity/audit/upstream/bundles` and
`release-build-info` are present and no script contains `yarn`. Strict `t()`
calls: 10 in `app-store.ts`, 42 in `commit-message.tsx`; the `t` import was
re-added wherever upstream's version lacked it. Locks were not edited:
`git diff --cached --numstat 1527ef6 -- package-lock.json app/package-lock.json`
shows upstream additions only. The merge itself is 246 files, +81 728/-160 879.

Accepted remainder
Gates are not taken: `tsc --noEmit`, `npm test`, `l10n:parity/audit/upstream/bundles`,
`lint`, `markdownlint` and `test:script` need an npm-based container, whose
conversion and rebuild are the next commit. Prettier was not run. Eight new
Copilot-panel strings and about ten edge ones (`commitMessage.*`,
`authorHandle.*`) are still literals: they get their own translation commits, so
`l10n:audit` will temporarily show growth. `tlh` and `qya` will receive real
translations, not stubs. Pushing stays with the author.

Result
The tree caught up structurally: the npm migration is in, fork scripts and the
dugite cache survive, and every localized screen kept its translation after
`commit-message.tsx` and the account picker were rewritten. Type-checking and
tests are the next step; until then this commit is not accepted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants