feat(core): refine User-Agent for VS Code traffic (unified format) (#23256)

This commit is contained in:
Sehoon Shon
2026-03-20 15:31:01 -04:00
committed by GitHub
parent cca595971d
commit 05e4ea80ee
3 changed files with 156 additions and 11 deletions

View File

@@ -37,9 +37,10 @@ export function determineSurface(): string {
return ide.name;
}
// If the detected IDE is 'vscode', we only accept it if TERM_PROGRAM confirms it.
// This prevents generic terminals from being misidentified as VSCode.
if (process.env['TERM_PROGRAM'] === 'vscode') {
// If the detected IDE is 'vscode', we only accept it if TERM_PROGRAM or VSCODE_PID confirms it.
// This prevents generic terminals from being misidentified as VSCode, while still detecting
// background processes spawned by the VS Code extension host (like a2a-server).
if (process.env['TERM_PROGRAM'] === 'vscode' || process.env['VSCODE_PID']) {
return ide.name;
}