Skip to content

Switch upstream from v0.38 to v0.37.9#14

Closed
sharon-wang wants to merge 1 commit intomainfrom
switch-to-upstream-0.37.9
Closed

Switch upstream from v0.38 to v0.37.9#14
sharon-wang wants to merge 1 commit intomainfrom
switch-to-upstream-0.37.9

Conversation

@sharon-wang
Copy link
Member

Replace the v0.38.2026020408 upstream merge with v0.37.9 from
microsoft/vscode-copilot-chat. All Positron-specific changes
(code fences, fix-copilot-auto-endpoint) are preserved.
@sharon-wang
Copy link
Member Author

354240f Plan: Switch Upstream from v0.38 to v0.37.9

Plan: Switch Upstream from v0.38 to v0.37.9

Current State

  • main = c82187a8 which includes the merge/1.109.0 PR containing v0.38.2026020408
  • Before that, 1640676a (merge/1.108.0) was at v0.36.0 (merged from v0.36.2026010701)
  • So we jumped from v0.36 -> v0.38 — there was no v0.37.x merged into this repo yet
  • Target: v0.37.9
  • Positron-specific commits to preserve:
    • 55768294 fix-copilot-auto-endpoint PR (two commits: e03a917e, dd281a49)

Approach: Build desired state on temp branch, apply as tree replacement on PR branch

Why not revert-then-merge (initial attempt, abandoned)

The initial plan was to revert the v0.38 merge and then merge v0.37.9. This doesn't work
cleanly because git revert marks file deletions as "intentional", so when v0.37.9 is
merged on top, git doesn't restore files that were removed by the revert. This left us
with 21 missing files, 207 extra v0.38-only files, and 328 compilation errors.

Why tree replacement works

Git commits store full tree snapshots, not diffs. By building the desired state on a
temp branch and then replacing the PR branch's tree with it, we get a commit whose tree
IS the v0.37.9 + Positron state. When merged to main, the v0.38 content is gone because
it's simply not in the committed tree. The PR diff will explicitly show every change,
making it fully reviewable.

Steps

1. Add the Microsoft upstream remote and fetch tags

git remote add upstream https://github.com/microsoft/vscode-copilot-chat.git
git fetch upstream --tags

2. Build desired state on a temp branch

Start from 1640676a (v0.36 base, which includes all Positron-specific files) and
merge v0.37.9 cleanly. This is a straightforward forward merge with no revert involved.

git checkout -b temp-v0.37.9 1640676a
git merge v0.37.9

7 conflicts needed resolving:

  • package.json, package-lock.json — took v0.37.9 version (no Positron changes)
  • promptFileContextService.ts, chatModelCapabilities.ts — took v0.37.9 (no Positron changes)
  • toolsService.ts — kept Positron code fences (enabledTools filtering), took v0.37.9's
    new modelSpecificOverrides/modelSpecificTools code
  • toolCalling.tsx — kept Positron telemetry disable fence, adopted v0.37.9's new
    promptContext parameter in sendToolCallTelemetry
  • configurationService.ts — took v0.37.9's Deprecated namespace (our side only had
    a placeholder comment)

3. Cherry-pick Positron-specific fixes onto temp branch

Both cherry-picks applied cleanly with no conflicts.

git cherry-pick e03a917e  # fix Auto model endpoint lookup
git cherry-pick dd281a49  # codefence the original code

4. Replace PR branch tree with temp branch content

Go back to the PR branch (based on main), remove everything, and replace with the
temp branch's tree. This creates a single commit with the exact desired state.

git checkout switch-to-upstream-0.37.9
git reset --hard main
git rm -rf .
git checkout temp-v0.37.9 -- .
git add -A
git commit -m "Switch upstream from v0.38 to v0.37.9"

5. Compile and fix

  • npm install --ignore-scripts succeeded
  • npx tsc --noEmit found 1 error: inlineCompletionProvider.ts line 222 referenced
    tracer (old v0.36 API) inside a Positron code fence. Fixed by replacing with
    logger.trace(...) which is the v0.37.9 logging pattern. This was an existing
    Positron code fence that referenced a variable that was renamed between v0.36 and v0.37.9.
  • After fix: 0 compilation errors

6. Clean up

git branch -D temp-v0.37.9

Verification

Diffed the final branch against the upstream v0.37.9 tag to confirm correctness:

git diff v0.37.9 --name-only   # 50 files differ

Positron-only files (not in upstream, expected)

  • .github/README.md — Positron README
  • LICENSE.txt — Elastic License (replaces MIT)
  • ThirdPartyNotices.txt — upstream attribution
  • extension.webpack.config.js — Positron build integration (webpack wrapper for esbuild)
  • src/extension/inlineEdits/common/positronConfig.ts — Positron config constants
  • src/extension/prompts/node/base/positronAssistant.tsx — Positron Assistant prompt element
  • src/platform/authentication/vscode-node/fileBasedAuth.ts — Positron file-based auth
  • src/util/common/crypto-redirect.ts — Positron crypto shim

Files with properly fenced changes (--- Start/End Positron ---)

.gitignore, .npmrc, script/postinstall.ts, config.ts,
completionsCoreContribution.ts, contextKeys.contribution.ts,
languageModelAccess.ts, extension.ts (both node and web),
services.ts, inlineCompletionProvider.ts, documentFilter.ts,
toolCalling.tsx, toolsService.ts, configurationService.ts,
editFileToolResult.tsx, session.ts, toolsService.ts (common),
toolsRegistry.ts, fileSystemService.ts

Pre-existing unfenced Positron changes (not introduced by this merge)

  • <PositronAssistant> prompt injection in 9 prompt files (single-line additions)
  • copilotCloudSessionsProvider.ts — session caching override
  • tsconfig.json, .github/workflows/pr.yml — config/build changes
  • Minor access modifier changes in fileSystemService.ts, toolsRegistry.ts, toolsService.ts

Conclusion: All differences from v0.37.9 are either Positron-only files or
pre-existing Positron modifications. No new unfenced changes to upstream code were
introduced by this merge.

@sharon-wang
Copy link
Member Author

0.37.9 still has the incompatible APIs -- this PR is now superseded by #15!

@sharon-wang sharon-wang deleted the switch-to-upstream-0.37.9 branch March 12, 2026 14:01
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.

1 participant