fix: ACP: separate conversational text from execute tool command title (#23179)

This commit is contained in:
Sri Pasumarthi
2026-03-23 17:39:15 -07:00
committed by GitHub
parent a7bed2cc4c
commit 84caf00cd4
7 changed files with 247 additions and 19 deletions
+33
View File
@@ -668,6 +668,39 @@ describe('ShellTool', () => {
});
});
describe('getDisplayTitle and getExplanation', () => {
it('should return only the command for getDisplayTitle', () => {
const invocation = shellTool.build({
command: 'echo hello',
description: 'prints hello',
dir_path: 'foo/bar',
is_background: true,
});
expect(invocation.getDisplayTitle?.()).toBe('echo hello');
});
it('should return the context for getExplanation', () => {
const invocation = shellTool.build({
command: 'echo hello',
description: 'prints hello',
dir_path: 'foo/bar',
is_background: true,
});
expect(invocation.getExplanation?.()).toBe(
'[in foo/bar] (prints hello) [background]',
);
});
it('should construct explanation without optional parameters', () => {
const invocation = shellTool.build({
command: 'echo hello',
});
expect(invocation.getExplanation?.()).toBe(
`[current working directory ${process.cwd()}]`,
);
});
});
describe('llmContent output format', () => {
const mockAbortSignal = new AbortController().signal;