()
| 32 | const signal = new AbortController().signal; |
| 33 | |
| 34 | async function captureSpawnEnv(): Promise<Record<string, string>> { |
| 35 | const execWithEnv = vi.fn().mockResolvedValue(fakeProcess()); |
| 36 | const tool = new BashTool( |
| 37 | createFakeKaos({ execWithEnv, osEnv: posixEnv }), |
| 38 | '/workspace', |
| 39 | createBackgroundManager().manager, |
| 40 | ); |
| 41 | await executeTool(tool, { |
| 42 | turnId: '0', |
| 43 | toolCallId: 'tc_env', |
| 44 | args: { command: 'true', timeout: 1000 }, |
| 45 | signal, |
| 46 | }); |
| 47 | return execWithEnv.mock.calls[0]?.[1] as Record<string, string>; |
| 48 | } |
| 49 | |
| 50 | describe('BashTool noninteractive env semantics', () => { |
| 51 | it('preserves an existing GIT_TERMINAL_PROMPT from the ambient env', async () => { |
no test coverage detected