From 492790d5ca9b622f9d3d992bc9afb3ce42e681fe Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 27 Mar 2026 08:54:33 -0700 Subject: [PATCH] Don't write ahp commit hash to every file (#305695) * Don't write ahp commit hash to every file Co-authored-by: Copilot * undo --------- Co-authored-by: Copilot --- scripts/sync-agent-host-protocol.ts | 11 ++++++++--- .../agentHost/common/state/protocol/.ahp-version | 1 + .../common/state/protocol/action-origin.generated.ts | 1 - .../agentHost/common/state/protocol/actions.ts | 1 - .../agentHost/common/state/protocol/commands.ts | 1 - .../agentHost/common/state/protocol/errors.ts | 1 - .../agentHost/common/state/protocol/messages.ts | 1 - .../agentHost/common/state/protocol/notifications.ts | 1 - .../agentHost/common/state/protocol/reducers.ts | 1 - .../platform/agentHost/common/state/protocol/state.ts | 9 ++++++++- .../common/state/protocol/version/registry.ts | 1 - 11 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 src/vs/platform/agentHost/common/state/protocol/.ahp-version diff --git a/scripts/sync-agent-host-protocol.ts b/scripts/sync-agent-host-protocol.ts index 02469d17051..f2dd4a988b5 100644 --- a/scripts/sync-agent-host-protocol.ts +++ b/scripts/sync-agent-host-protocol.ts @@ -172,7 +172,7 @@ function mergeDuplicateImports(content: string): string { -function processFile(src: string, dest: string, commitHash: string): void { +function processFile(src: string, dest: string): void { let content = fs.readFileSync(src, 'utf-8'); content = stripExistingHeader(content); @@ -182,7 +182,7 @@ function processFile(src: string, dest: string, commitHash: string): void { content = convertIndentation(content); content = content.split('\n').map(line => line.trimEnd()).join('\n'); - const header = `${COPYRIGHT}\n\n${BANNER}\n// Synced from agent-host-protocol @ ${commitHash}\n`; + const header = `${COPYRIGHT}\n\n${BANNER}\n`; content = header + '\n' + content; if (!content.endsWith('\n')) { @@ -219,9 +219,14 @@ function main() { console.error(` SKIP (not found): ${file.src}`); continue; } - processFile(srcPath, file.dest, commitHash); + processFile(srcPath, file.dest); } + // Write the source commit hash to a single version file + const versionFile = path.join(DEST_DIR, '.ahp-version'); + fs.writeFileSync(versionFile, commitHash + '\n', 'utf-8'); + console.log(` .ahp-version -> ${commitHash}`); + console.log(); console.log('Done.'); } diff --git a/src/vs/platform/agentHost/common/state/protocol/.ahp-version b/src/vs/platform/agentHost/common/state/protocol/.ahp-version new file mode 100644 index 00000000000..1e7e823363b --- /dev/null +++ b/src/vs/platform/agentHost/common/state/protocol/.ahp-version @@ -0,0 +1 @@ +101c091 diff --git a/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts b/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts index c65d536c7d3..e06342c661b 100644 --- a/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts +++ b/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc // Generated from types/actions.ts — do not edit // Run `npm run generate` to regenerate. diff --git a/src/vs/platform/agentHost/common/state/protocol/actions.ts b/src/vs/platform/agentHost/common/state/protocol/actions.ts index ee22225be03..27f726af24a 100644 --- a/src/vs/platform/agentHost/common/state/protocol/actions.ts +++ b/src/vs/platform/agentHost/common/state/protocol/actions.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc import { ToolCallConfirmationReason, ToolCallCancellationReason, PendingMessageKind, type URI, type StringOrMarkdown, type IAgentInfo, type IErrorInfo, type IUserMessage, type IResponsePart, type IToolCallResult, type IToolDefinition, type ISessionActiveClient, type IUsageInfo, type ISessionCustomization } from './state.js'; diff --git a/src/vs/platform/agentHost/common/state/protocol/commands.ts b/src/vs/platform/agentHost/common/state/protocol/commands.ts index 1793016f86b..4c06a7cc45a 100644 --- a/src/vs/platform/agentHost/common/state/protocol/commands.ts +++ b/src/vs/platform/agentHost/common/state/protocol/commands.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc import type { URI, ISnapshot, ISessionSummary, ITurn } from './state.js'; import type { IActionEnvelope, IStateAction } from './actions.js'; diff --git a/src/vs/platform/agentHost/common/state/protocol/errors.ts b/src/vs/platform/agentHost/common/state/protocol/errors.ts index cfa1291eaab..f582cdae0b2 100644 --- a/src/vs/platform/agentHost/common/state/protocol/errors.ts +++ b/src/vs/platform/agentHost/common/state/protocol/errors.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc // ─── Standard JSON-RPC Codes ───────────────────────────────────────────────── diff --git a/src/vs/platform/agentHost/common/state/protocol/messages.ts b/src/vs/platform/agentHost/common/state/protocol/messages.ts index e3cd6567b10..4e61208780d 100644 --- a/src/vs/platform/agentHost/common/state/protocol/messages.ts +++ b/src/vs/platform/agentHost/common/state/protocol/messages.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc import type { IInitializeParams, IInitializeResult, IReconnectParams, IReconnectResult, ISubscribeParams, ISubscribeResult, ICreateSessionParams, IDisposeSessionParams, IListSessionsParams, IListSessionsResult, IFetchContentParams, IFetchContentResult, IBrowseDirectoryParams, IBrowseDirectoryResult, IFetchTurnsParams, IFetchTurnsResult, IUnsubscribeParams, IDispatchActionParams, IAuthenticateParams, IAuthenticateResult } from './commands.js'; diff --git a/src/vs/platform/agentHost/common/state/protocol/notifications.ts b/src/vs/platform/agentHost/common/state/protocol/notifications.ts index 7e255adac8f..b4d7e5052c8 100644 --- a/src/vs/platform/agentHost/common/state/protocol/notifications.ts +++ b/src/vs/platform/agentHost/common/state/protocol/notifications.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc import type { URI, ISessionSummary } from './state.js'; diff --git a/src/vs/platform/agentHost/common/state/protocol/reducers.ts b/src/vs/platform/agentHost/common/state/protocol/reducers.ts index 39a6aec57e5..4c830b93b95 100644 --- a/src/vs/platform/agentHost/common/state/protocol/reducers.ts +++ b/src/vs/platform/agentHost/common/state/protocol/reducers.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc import { ActionType } from './actions.js'; import { SessionLifecycle, SessionStatus, TurnState, ToolCallStatus, ToolCallConfirmationReason, ToolCallCancellationReason, ResponsePartKind, PendingMessageKind, type IRootState, type ISessionState, type IToolCallState, type IResponsePart, type IToolCallResponsePart, type ITurn, type IPendingMessage } from './state.js'; diff --git a/src/vs/platform/agentHost/common/state/protocol/state.ts b/src/vs/platform/agentHost/common/state/protocol/state.ts index 42a5f0138f5..6f27c6a0d24 100644 --- a/src/vs/platform/agentHost/common/state/protocol/state.ts +++ b/src/vs/platform/agentHost/common/state/protocol/state.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc // ─── Type Aliases ──────────────────────────────────────────────────────────── @@ -875,6 +874,14 @@ export interface ICustomizationRef { description?: string; /** Icons for the plugin */ icons?: Icon[]; + /** + * Opaque version token for this customization. + * + * Clients SHOULD include a nonce with every customization they provide. + * Consumers can compare nonces to detect whether a customization has + * changed since it was last seen, avoiding redundant reloads or copies. + */ + nonce?: string; } /** diff --git a/src/vs/platform/agentHost/common/state/protocol/version/registry.ts b/src/vs/platform/agentHost/common/state/protocol/version/registry.ts index 14833d6e340..c3d45ae3dfa 100644 --- a/src/vs/platform/agentHost/common/state/protocol/version/registry.ts +++ b/src/vs/platform/agentHost/common/state/protocol/version/registry.ts @@ -5,7 +5,6 @@ // allow-any-unicode-comment-file // DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts -// Synced from agent-host-protocol @ 32572fc import { ActionType, type IStateAction } from '../actions.js'; import { NotificationType, type IProtocolNotification } from '../notifications.js';