Skip to content

Commit baabd94

Browse files
committed
test: lock the no-background shell description strip
1 parent 9e7b0e9 commit baabd94

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

  • packages/agent-core-v2/test/os/backends/node-local/tools

packages/agent-core-v2/test/os/backends/node-local/tools/bash.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,25 @@ describe('BashTool', () => {
13071307
expect(description).toContain('run_in_background=true');
13081308
});
13091309

1310+
it('strips every background sentence from the description when background execution is off', () => {
1311+
const { runner } = createTestRunner(processWithOutput());
1312+
const tool = bashTool(
1313+
runner,
1314+
createTestEnv(),
1315+
createTestCtx(),
1316+
createFakeTaskService().service,
1317+
stubToolPolicy((name) => name !== 'TaskList'),
1318+
);
1319+
1320+
const description = tool.description;
1321+
expect(description).toContain('Background execution is disabled for this agent.');
1322+
expect(description).not.toContain('background-task panel');
1323+
expect(description).not.toContain('run_in_background=true`,');
1324+
expect(description).not.toContain('move a running foreground command to the background');
1325+
expect(description).not.toContain('moved to the background instead of being killed');
1326+
expect(description).toContain('a foreground command that hits its timeout is killed');
1327+
});
1328+
13101329
it('disables background execution when TaskList is inactive even if TaskOutput/TaskStop are active', async () => {
13111330
const { runner, exec } = createTestRunner(processWithOutput());
13121331
const tool = bashTool(

0 commit comments

Comments
 (0)