Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/core/parser-vscode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,4 +742,21 @@ describe('parseSessionFile — skill detection', () => {
expect(session!.requests[0].skillsUsed).toContain('playwright-cli');
});
});
});
});
describe('harnessFromPath — VS Code Server', () => {
it('returns "Local Agent (Server)" for .vscode-server paths', () => {
expect(harnessFromPath('/home/alice/.vscode-server/data/User/workspaceStorage')).toBe('Local Agent (Server)');
});

it('returns "Local Agent (Server Insiders)" for .vscode-server-insiders paths', () => {
expect(harnessFromPath('/home/alice/.vscode-server-insiders/data/User/workspaceStorage')).toBe('Local Agent (Server Insiders)');
});

it('does not match .vscode-server-insiders as plain .vscode-server', () => {
// .vscode-server-insiders contains the string ".vscode-server" — ensure
// the more-specific check fires first.
const result = harnessFromPath('/home/alice/.vscode-server-insiders/data/User/workspaceStorage');
expect(result).toBe('Local Agent (Server Insiders)');
expect(result).not.toBe('Local Agent (Server)');
});
});
11 changes: 11 additions & 0 deletions src/core/parser-vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function isObj(v: unknown): v is Record<string, unknown> {

export function harnessFromPath(logsDir: string): string {
if (logsDir.includes('Code - Insiders')) return 'Local Agent (Insiders)';
if (logsDir.includes('.vscode-server-insiders')) return 'Local Agent (Server Insiders)';
if (logsDir.includes('.vscode-server')) return 'Local Agent (Server)';
if (logsDir.includes('.copilot')) return 'GitHub Copilot CLI';
return 'Local Agent';
}
Expand All @@ -42,6 +44,15 @@ export function findVsCodeDirs(): string[] {
if (vsPath && fs.existsSync(vsPath) && !dirs.includes(vsPath)) dirs.push(vsPath);
}

// VS Code Server (remote/SSH/devcontainer) paths
if (process.platform !== 'win32' && home) {
const serverEditions = ['.vscode-server', '.vscode-server-insiders'];
for (const serverDir of serverEditions) {
const serverPath = path.join(home, serverDir, 'data', 'User', 'workspaceStorage');
if (fs.existsSync(serverPath) && !dirs.includes(serverPath)) dirs.push(serverPath);
}
}

// Copilot CLI paths
const cliActive = path.join(home, '.copilot', 'session-state');
const cliLegacy = path.join(home, '.copilot', 'history-session-state');
Expand Down
Loading