Skip to content

fix(patches): rebase 00-brand-remove-branding for VS Code 1.126.0#22

Merged
sbs44 merged 5 commits into
mainfrom
fix/1.126.0-rebase
Jun 28, 2026
Merged

fix(patches): rebase 00-brand-remove-branding for VS Code 1.126.0#22
sbs44 merged 5 commits into
mainfrom
fix/1.126.0-rebase

Conversation

@sbs44

@sbs44 sbs44 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Rebases patches/00-brand-remove-branding.patch against VS Code 1.126.0 and bumps the pin.

All 30+ patches now apply cleanly against the 1.126.0 commit. Verified locally via apply_patch loop.

Refs #21

The apiProposalNotListed context drifted (a new
apiProposalVersionNotSupported line was added between
relativeBadgeUrlRequiresHttpsRepository and apiProposalNotListed), and
the apiProposalMismatch1/2 strings in extensionValidator.ts were removed
upstream — drop those hunks since the rebrand target no longer exists.

Refs #21
@claude

claude Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @sbs44's task in 4m 47s —— View job


Code review

Found 1 issue:

1. The rebase silently replaces the !!APP_NAME!! build-time placeholder with a hardcoded BradfordCode throughout the patch (out of scope for a rebase; breaks the APP_NAME override and diverges from sibling patches).

The previous patch used the !!APP_NAME!! token for every branding string (228 occurrences); this rebase swaps all of them to the literal BradfordCode (226 occurrences, 0 placeholders):

-UpdatingVisualStudioCode=Updating Visual Studio Code...
+UpdatingVisualStudioCode=Updating BradfordCode...
diff --git a/build/win32/i18n/messages.es.isl b/build/win32/i18n/messages.es.isl

!!APP_NAME!! is not literal text — utils.sh substitutes it at apply time with the configurable APP_NAME (defaulting to BradfordCode):

code/utils.sh

Lines 26 to 28 in 932b3d9

replace "s|!!APP_NAME!!|${APP_NAME}|g" "$1"
replace "s|!!APP_NAME_LC!!|${APP_NAME_LC}|g" "$1"

Because APP_NAME="${APP_NAME:-BradfordCode}" is meant to be overridable, hardcoding the literal bakes the name in and breaks any build that sets APP_NAME to something else. It also diverges from the sibling patches (00-ui-report-issue.patch, 00-community-add-announcements.patch, 00-copilot-disable-terminal-suggest.patch), which still use !!APP_NAME!!. The default build output is unchanged, but the intent of a "rebase" should be to carry the same replacement values forward. Likely an artifact of regenerating the patch from an already-substituted tree; restoring !!APP_NAME!! would fix it.

Note: the dropped src/vs/platform/extensions/common/extensionValidator.ts hunk is not a problem — those apiProposalMismatch strings no longer exist in upstream 1.126.0, so dropping it is correct. The upstream/stable.json bump looks fine.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Rebase chain (depending on upstream changes between 1.124.2 → 1.126.0):

- 00-brand-remove-branding: !!APP_NAME!! placeholders restored (the previous
  regen captured the substituted form); validator hunk dropped (upstream
  removed the target strings). Context shift in extensionLinter.ts only.

- 00-build-disable-mangle: line-number shift in build/lib/compilation.ts.

- 00-copilot-fix-action-condition: one hunk needed re-targeting in
  chatSetupContributions.ts (lines moved); all other hunks applied clean.

- 20-keymap-use-custom-lib: single new line for @vscodium/native-keymap in
  package-lock.json main deps.

- 21-policy-use-custom-lib: swap @vscode/policy-watcher → @vscodium/policy-watcher
  in package.json + surgical removal of @vscode/policy-watcher metadata block
  in package-lock.json.

Next failure surfaces at patches/50-build-improve-gulp-tasks.patch and likely
51-ext-copilot-remove-it.patch — both will need significant rebasing against
upstream's restructured Copilot integration.

Refs #21
@claude

claude Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @sbs44's task in 1m 47s —— View job


Code review

No issues found.

The new commit f37192b resolves the !!APP_NAME!! regression flagged in the earlier review: patches/00-brand-remove-branding.patch now carries 226 !!APP_NAME!! placeholders and 0 hardcoded BradfordCode literals, restoring the build-time substitution and re-aligning with the sibling patches.

export const implicitActivationEvent = l10n.t("This activation event cannot be explicitly listed by your extension.");
-export const redundantImplicitActivationEvent = l10n.t("This activation event can be removed as VS Code generates these automatically from your package.json contribution declarations.");
+export const redundantImplicitActivationEvent = l10n.t("This activation event can be removed as !!APP_NAME!! generates these automatically from your package.json contribution declarations.");
diff --git a/extensions/extension-editing/src/extensionLinter.ts b/extensions/extension-editing/src/extensionLinter.ts
index a6ab287a..dc928226 100644
--- a/extensions/extension-editing/src/extensionLinter.ts

The remaining changes are mechanical rebase updates against the 1.126.0 tree and check out:

  • The dropped extensionValidator.ts hunk is correct — those apiProposalMismatch strings no longer exist upstream.
  • 00-build-disable-mangle.patch adapts only to the streamToPromise(...) wrapper introduced upstream; the mangle block removal is unchanged in intent.
  • 00-copilot-fix-action-condition.patch, 20-keymap-use-custom-lib.patch, 21-policy-use-custom-lib.patch are index-hash / line-offset / context-line adjustments only.
  • The lone BradfordCode literal in 21-policy-use-custom-lib.patch (the createWatcher call) is pre-existing on origin/main, not introduced here.
  • upstream/stable.json bump to 1.126.0 / 7e7950df… looks fine.

Checked for bugs, leaked literals, and CLAUDE.md compliance (no CLAUDE.md present in the repo or touched directories).

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Patch 50 (gulp tasks): single context-line drift — upstream inserted
`getCopilotTgrepExcludeFilter` into the copilot import; corrected the
trailing context line so the hunk applies.

Patch 51 (copilot removal): fully re-authored against 1.126's substantially
expanded Copilot/agent-host subsystem. The old patch (written for ~1.124) was
hopelessly stale — 7 of its 8 target deletions no longer matched, and 19+ new
SDK-importing files existed that it never touched.

Approach (Copilot-only removal; Claude + agentHost + sessions kept, all MIT):
- Removed @github/copilot + @github/copilot-sdk from package.json and all 11
  node_modules/@github/copilot* blocks from package-lock.json (proprietary
  Copilot binaries can't be redistributed in a signed .dmg).
- Deleted 15 Copilot-CLI-provider source files + 9 provider-specific tests.
- Kept shared agent infra (copilotToolDisplay, mapSessionEvents,
  sessionCustomizationDiscovery, both otel services, copilotTestEvents fixture)
  and stripped their @github/copilot-sdk *type* imports, replacing them with
  local type defs / `any` aliases so the kept Claude provider + agentService
  tests keep compiling.
- Unregistered the Copilot provider in agentHostMain.ts + agentHostServerMain.ts.
- Reworked build wiring: gulpfile.vscode.ts + gulpfile.reh.ts (drop copilot
  import, compileCopilotExtensionBuildTask, copilotRuntimePrebuilds + copilot/
  ripgrep filters, prepareCopilotRipgrepShim task + call), build/npm/dirs.ts
  (drop extensions/copilot), build/npm/postinstall.ts (drop copilot-sdk patch).

Verified: all 36 patches apply cleanly in CI order; zero remaining
@github/copilot import statements and zero imports of deleted files across
src/ + build/.

Refs #21
@claude

claude Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @sbs44's task in 10m 38s —— View job


Code review

No issues found. Checked for bugs and CLAUDE.md compliance (no CLAUDE.md present in the repo).

Reviewed the latest commit 2f68075 (the re-authored 51-ext-copilot-remove-it.patch for 1.126.0's expanded Copilot/agent subsystem, plus the 50-build-improve-gulp-tasks.patch context fix) and the full PR. Verified:

  • No new hardcoded BradfordCode literals — all branding comments/stubs use the !!APP_NAME!! placeholder; the earlier regression remains fixed.
  • The dropped extensionValidator.ts hunk is correct — the apiProposalMismatch1/apiProposalMismatch2 strings no longer exist in upstream 1.126.0.
  • Copilot removal is internally consistent: compileCopilotExtensionBuildTask and the getCopilot*/ripgrep-shim helpers are removed from both gulpfile.vscode.ts and gulpfile.reh.ts, providers are unregistered in agentHostMain.ts/agentHostServerMain.ts, and package.json/package-lock.json removals match the source changes.
  • The lone 'BradfordCode' in 21-policy-use-custom-lib.patch is pre-existing on origin/main (only the index hash / hunk offsets changed here), so it is out of scope.
  • upstream/stable.json bump to 1.126.0 / 7e7950df… is consistent with all patch index hashes.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

The re-engineered patches now apply cleanly and the build reaches the tsgo
typecheck, which surfaced 3 errors (2 pre-existing, exposed now that earlier
patch-apply failures are gone):

- patch 51 / copilotToolDisplay.ts: the local `PermissionRequest` stub used
  `kind: string`, too broad for `permissionKind` (TS2322). Narrowed it to the
  exact union agentService's `IAgentToolPendingConfirmationSignal.permissionKind`
  expects.

- patch 21 / copilotManagedSettingsService.ts: new-in-1.126 file imports
  `@vscode/policy-watcher`, which patch 21 renames to `@vscodium/policy-watcher`.
  Added the same rename hunk (matching the existing nativePolicyService.ts
  rewrite) so the custom policy-watcher lib resolves (TS2307 ×2).

All 36 patches apply cleanly in CI order.

Refs #21
@claude

claude Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Claude finished @sbs44's task in 14m 52s —— View job


Code review

No issues found. Checked for bugs and CLAUDE.md compliance (no CLAUDE.md present in the repo).

Reviewed the latest commit e4acf064 (tsgo typecheck fixes for 21-policy-use-custom-lib.patch and 51-ext-copilot-remove-it.patch) and the full PR across five parallel review passes (shallow bug scan, git history, prior-PR comments, code-comment/script conventions, and internal consistency of the Copilot/build patches). Verified:

  • The !!APP_NAME!! regression from the earlier commit stays fixed — 00-brand-remove-branding.patch carries 226 !!APP_NAME!! placeholders and 0 hardcoded BradfordCode literals; the three intermediate BradfordCode comment literals in 51-ext-copilot-remove-it.patch were converted back to placeholders in e4acf064.
  • The lone 'BradfordCode' in 21-policy-use-custom-lib.patch (the createWatcher registry-hive name) is pre-existing on origin/main, not introduced here.
  • The dropped extensionValidator.ts hunk is correct — the apiProposalMismatch1/2 strings no longer exist upstream in 1.126.0.
  • Copilot removal is internally consistent: compileCopilotExtensionBuildTask, the getCopilot*/ripgrep-shim helpers, providers in agentHostMain.ts/agentHostServerMain.ts, and package.json/package-lock.json removals all line up; agentHostOTelService.ts moves TelemetryConfig to a local common-layer type.
  • 00-build-disable-mangle.patch adapts only to upstream's streamToPromise(...) wrapper; mangle-removal intent is unchanged and consistent with 50-build-improve-gulp-tasks.patch.
  • upstream/stable.json bump to 1.126.0 / 7e7950df… is consistent with the patch index hashes.

A few dead-code observations (stubbed-but-uncalled files, an undeleted build/lib/copilot.ts, the in-tree extensions/copilot sources excluded via dirs.ts) were considered but are intentional/standard exclusion patterns that compile cleanly — not defects.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@claude

claude Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance (no CLAUDE.md present in the repo).

Reviewed the latest commit e4acf064 (tsgo typecheck fixes) against the previously reviewed 2f68075:

  • patches/21-policy-use-custom-lib.patch: adds a new hunk for the new-in-1.126.0 copilotManagedSettingsService.ts file, replacing both the import type { Watcher } and the dynamic import('@vscode/policy-watcher') with @vscodium/policy-watcher. Consistent with the existing nativePolicyService.ts hunk in the same patch; index hashes look correct.

  • patches/51-ext-copilot-remove-it.patch: narrows the local PermissionRequest stub from { kind: string } to the explicit union 'shell' | 'write' | 'mcp' | 'read' | 'url' | 'custom-tool' | 'hook' | 'memory' | 'extension-management' | 'extension-permission-access' to satisfy the permissionKind assignment in agentService. Replaces three is removed in BradfordCode comment literals (from commit 3) with proper !!APP_NAME!! placeholders, restoring build-time substitutability. Adds similarly-templated local type stubs for TelemetryConfig, CopilotClient, Attachment, SessionEvent, AssistantMessageToolRequest, and ToolExecutionCompleteData.

All !!APP_NAME!! usage is consistent; no new hardcoded BradfordCode literals introduced.

this._onDidPolicyChange(update);
c();
});
diff --git a/src/vs/platform/policy/node/copilotManagedSettingsService.ts b/src/vs/platform/policy/node/copilotManagedSettingsService.ts
index 5b76979d..40abf52e 100644
--- a/src/vs/platform/policy/node/copilotManagedSettingsService.ts
+++ b/src/vs/platform/policy/node/copilotManagedSettingsService.ts
@@ -11,7 +11,7 @@ import { IManagedSettingsPolicyDefinitions, ManagedSettingsData } from '../../..
import { ILogService } from '../../log/common/log.js';
import { collectManagedSettingsDefinitions, ICopilotManagedSettingsService } from '../common/copilotManagedSettings.js';
import { PolicyDefinition, PolicyValue } from '../common/policy.js';
-import type { Watcher } from '@vscode/policy-watcher';
+import type { Watcher } from '@vscodium/policy-watcher';
export interface ICopilotPolicyWatcherOptions {
readonly registryPath?: string;
@@ -89,7 +89,7 @@ export class CopilotManagedSettingsService extends Disposable implements ICopilo
return;
}
- const { createWatcher } = this.watcherFactory ? { createWatcher: this.watcherFactory } : (await import('@vscode/policy-watcher') as { createWatcher: CopilotPolicyWatcherFactory });
+ const { createWatcher } = this.watcherFactory ? { createWatcher: this.watcherFactory } : (await import('@vscodium/policy-watcher') as { createWatcher: CopilotPolicyWatcherFactory });
await this.throttler.queue(() => new Promise<void>((c, e) => {
try {
this.logService.trace(`Creating Copilot managed-settings watcher for productName ${this.productName}`);

-import type { PermissionRequest } from '@github/copilot-sdk';
+// `PermissionRequest` originally came from '@github/copilot-sdk' (removed in
+// !!APP_NAME!!). Only its `kind` discriminator is referenced here, so model it
+// as a minimal local shape.
+type PermissionRequest = { kind: 'shell' | 'write' | 'mcp' | 'read' | 'url' | 'custom-tool' | 'hook' | 'memory' | 'extension-management' | 'extension-permission-access' };
import { hasKey } from '../../../../base/common/types.js';

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@claude

claude Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Claude finished @sbs44's task in 1m 37s —— View job


Code review

No issues found. Checked for bugs and CLAUDE.md compliance (no CLAUDE.md present in the repo).

Reviewed the new commit 3606ca2 (the only change since the last review of e4acf064), which adapts copilotManagedSettingsService.ts in patches/21-policy-use-custom-lib.patch to the @vscodium/policy-watcher fork's createWatcher signature.

Verified:

  • The wrapper correctly adapts the fork's (vendorName, productName, policies, onDidChange) signature to the service's CopilotPolicyWatcherFactory shape (productName, policies, onDidChange), resolving the TS2352 mismatch. The injected-factory path (this.watcherFactory) is preserved unchanged, so the existing unit tests are unaffected.

  • The hardcoded 'BradfordCode' vendor name is consistent with the established pre-existing pattern in the sibling nativePolicyService.ts hunk (createWatcher('BradfordCode', this.productName, …)), which is already on origin/main. This is a registry vendor-name argument, not a !!APP_NAME!! build-time branding token, so it is not a branding regression.

- const { createWatcher } = this.watcherFactory ? { createWatcher: this.watcherFactory } : (await import('@vscode/policy-watcher') as { createWatcher: CopilotPolicyWatcherFactory });
+ let createWatcher: CopilotPolicyWatcherFactory;
+ if (this.watcherFactory) {
+ createWatcher = this.watcherFactory;
+ } else {
+ const policyWatcher = await import('@vscodium/policy-watcher');
+ // `@vscodium/policy-watcher`'s `createWatcher` takes a leading vendor name
+ // and no options argument, unlike upstream `@vscode/policy-watcher`; adapt
+ // it to this service's CopilotPolicyWatcherFactory shape.
+ const createNativeWatcher = policyWatcher.createWatcher as unknown as (
+ vendorName: string,
+ productName: string,
+ policies: Record<string, { type: 'string' | 'number' | 'boolean' }>,
+ onDidChange: (update: Record<string, PolicyValue | undefined>) => void,
+ ) => Watcher;
+ createWatcher = (productName, policies, onDidChange) => createNativeWatcher('BradfordCode', productName, policies, onDidChange);
+ }

  • The !!APP_NAME!! regression from earlier in the PR remains fixed, and no new hardcoded BradfordCode branding literals are introduced.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

The previous fix renamed @vscode/policy-watcher -> @vscodium/policy-watcher in
copilotManagedSettingsService.ts, which let the module resolve and exposed a
deeper mismatch (TS2352): the @VSCodium fork's createWatcher signature is
(vendorName, productName, policies, onDidChange) with no options arg, whereas
upstream is (productName, policies, onDidChange, options). nativePolicyService.ts
was already adapted by patch 21 (it prepends a vendor name); the new-in-1.126
copilotManagedSettingsService.ts was not.

Adapt the production import to the fork's signature while preserving the file's
own CopilotPolicyWatcherFactory abstraction, so the 5 injected-factory unit
tests stay untouched: wrap the fork's createWatcher to prepend the 'BradfordCode'
vendor name (matching nativePolicyService) and ignore the unsupported options.

All 36 patches apply cleanly in CI order.

Refs #21
@sbs44 sbs44 force-pushed the fix/1.126.0-rebase branch from 3606ca2 to 3bfc05b Compare June 28, 2026 15:35
@claude

claude Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Code review

Working…

  • Check eligibility (closed/draft/already reviewed)
  • Locate relevant CLAUDE.md files
  • Summarize the change
  • Run parallel review passes
  • Score & filter findings
  • Post review

View job run

@sbs44 sbs44 merged commit 321b5d6 into main Jun 28, 2026
5 of 6 checks passed
@sbs44 sbs44 deleted the fix/1.126.0-rebase branch June 28, 2026 16:29
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