this._register(toDisposable(() => {
for (const terminalUri of this._terminals) {
}
this._terminals.clear();
}));
Frontier kind: Code frontier
unlabeled · c_7913cbdd8721
7 tests · 50468 LOC · 291 files · introduces 0 tests · 95 LOC · 3 files
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Introduced files, introduced tests, and structurally relevant concept specialization
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostRenameCommand.test|title=agentHostRenameCommand parseRenameCommand case-sensitive|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostRenameCommand.test|title=agentHostRenameCommand parseRenameCommand rejects /rename-foo (no separator)|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostRenameCommand.test|title=agentHostRenameCommand parseRenameCommand rejects /renamed (longer command)|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostRenameCommand.test|title=agentHostRenameCommand parseRenameCommand rejects leading whitespace|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostRenameCommand.test|title=agentHostRenameCommand parseRenameCommand captures the trimmed title after a space|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostRenameCommand.test|title=agentHostRenameCommand parseRenameCommand matches lone /rename as empty title|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostRenameCommand.test|title=agentHostRenameCommand parseRenameCommand trims surrounding whitespace from the title|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/instantiation/test/common/instantiationService.test|title=Instantiation Service @Param - fixed args|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/instantiation/test/common/instantiationService.test|title=Instantiation Service @Param - simple clase|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/commandLineHelpers.test|title=stripRedundantCdPrefix matches backslash extracted dir against backslash native wd on Windows|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/commandLineHelpers.test|title=stripRedundantCdPrefix matches mixed path separators (forward-slash extracted vs native fsPath wd)|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/reducers.test|title=chatReducer – summaryStatus with tool call confirmations and input requests clamps negative terminal duration|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/reducers.test|title=chatReducer – summaryStatus with tool call confirmations and input requests preserves turn start timestamp and duration after completion|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle dispose disposable array|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentHostSchema.test|title=agentHostSchema createSchema toProtocol emits a JSON-Schema-compatible object|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentHostSchema.test|title=agentHostSchema platformSessionSchema exposes approval choices in picker order with current copy|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostBangCommand.test|title=agentHostBangCommand is undefined for a lone ! or whitespace-only command|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostBangCommand.test|title=agentHostBangCommand parses a leading ! command|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
3 files ranked by introduced lines: 95 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
this._register(toDisposable(() => {
for (const terminalUri of this._terminals) {
}
this._terminals.clear();
}));
return undefined;
}
// isn't left untitled until the first real (non-command) request.
return { run: () => this._run(request.turnChannel, request.turnId, command), suggestedTitle: command };
}
private async _run(turnChannel: ProtocolURI, turnId: string, command: string): Promise<void> {
const sessionChannel = isAhpChatChannel(turnChannel) ? parseRequiredSessionUriFromChatUri(turnChannel) : turnChannel;
const toolCallId = generateUuid();
const terminalUri = `agenthost-terminal://bang/${generateUuid()}`;
const displayName = localize('agentHostBang.terminal', "Terminal");
let terminalCreated = false;
try {
const workingDirStr = ctx.getState(sessionChannel)?.workingDirectories?.[0];
const cwd = workingDirStr ? URI.parse(workingDirStr).fsPath : undefined;
const shellPath = await ctx.terminalManager.getDefaultShell();
const shellType = shellTypeForExecutable(shellPath);
// Surface the command as a tool call and transition it straight to
// running — the user typed it explicitly, so no confirmation.
ctx.dispatch(turnChannel, {
type: ActionType.ChatToolCallStart,
turnId,
toolCallId,
toolName: 'terminal',
displayName,
intention: command,
});
ctx.dispatch(turnChannel, {
type: ActionType.ChatToolCallReady,
turnId,
toolCallId,
invocationMessage: command,
toolInput: command,
confirmed: ToolCallConfirmationReason.NotNeeded,
});
const claim: TerminalSessionClaim = {
kind: TerminalClaimKind.Session,
session: sessionChannel,
turnId,
toolCallId,
};
const params: CreateTerminalParams = { channel: terminalUri, claim, name: displayName, cwd };
await ctx.terminalManager.createTerminal(params, { shell: shellPath, preventShellHistory: true, nonInteractive: true });
terminalCreated = true;
this._terminals.add(terminalUri);
// Reference the terminal so the client can stream live output while
// the command runs.
const terminalContent: ToolResultContent = { type: ToolResultContentType.Terminal, resource: terminalUri, title: displayName };
ctx.dispatch(turnChannel, {
type: ActionType.ChatToolCallContentChanged,
turnId,
toolCallId,
content: [terminalContent],
});
const result = await executeShellCommand({ terminalUri, shellType }, command, DEFAULT_SHELL_COMMAND_TIMEOUT_MS, ctx.terminalManager, ctx.logService);
const { success, pastTenseMessage } = this._summarizeResult(result);
const content: ToolResultContent[] = [terminalContent];
if (result.output) {
content.push({ type: ToolResultContentType.Text, text: result.output });
}
ctx.dispatch(turnChannel, {
type: ActionType.ChatToolCallComplete,
turnId,
toolCallId,
result: { success, pastTenseMessage, content },
});
} catch (err) {
ctx.logService.error(`[BangLocalCommand] Command failed for session=${sessionChannel}: ${err instanceof Error ? err.message : String(err)}`, err);
if (terminalCreated) {
*/
private _summarizeResult(result: IShellCommandResult): { success: boolean; pastTenseMessage: string } {
case 'completed': {
const exitCode = result.exitCode ?? 0;
return exitCode === 0
? { success: true, pastTenseMessage: localize('agentHostBang.ran', "Ran command") }
: { success: false, pastTenseMessage: localize('agentHostBang.exited', "Command exited with code {0}", exitCode) };
case 'timeout':
return { success: false, pastTenseMessage: localize('agentHostBang.timedOut', "Command timed out") };
return { success: false, pastTenseMessage: localize('agentHostBang.shellExited', "Shell exited unexpectedly") };
return { success: true, pastTenseMessage: localize('agentHostBang.background', "Command is running in the background") };
return { success: true, pastTenseMessage: localize('agentHostBang.interactive', "Command opened an interactive terminal") };
}
}
return part;
}
// Only these tool-call states carry `content` (a live terminal ref lives here).
if (tc.status !== ToolCallStatus.Running && tc.status !== ToolCallStatus.Completed && tc.status !== ToolCallStatus.PendingResultConfirmation) {
return part;
}
return part;
}
const content = tc.content.filter(c => c.type !== ToolResultContentType.Terminal);
localChatCommand.ts
if (content.length === tc.content.length) {
return part;
}
});
return { ...turn, responseParts };
async createTerminal(params: CreateTerminalParams): Promise<void> {
this._onDidCreateTerminal.fire(params.channel);
}
writeInput(): void { }
async sendText(uri: string, data: string): Promise<void> { this.sentTexts.push({ uri, data }); }
onClaimChanged(_uri: string, cb: (claim: TerminalClaim) => void): IDisposable { return this._onClaimChanged.event(cb); }
onCommandFinished(_uri: string, cb: (event: ICommandFinishedEvent) => void): IDisposable {
return this._onCommandFinished.event(cb);
}
createAltBufferPromise(): Promise<void> { return new Promise<void>(() => { }); }
getContent(): string | undefined { return undefined; }