@@ -33,6 +33,7 @@ import {
3333 type SSHServerConfig ,
3434} from "../runtime/ssh-fixture" ;
3535import type { RuntimeConfig } from "../../src/types/runtime" ;
36+ import type { WorkspaceChatMessage } from "../../src/types/ipc" ;
3637import type { ToolPolicy } from "../../src/utils/tools/toolPolicy" ;
3738
3839// Tool policy: Only allow bash tool
@@ -41,6 +42,20 @@ const BASH_ONLY: ToolPolicy = [
4142 { regex_match : "file_.*" , action : "disable" } ,
4243] ;
4344
45+ function collectToolOutputs (
46+ events : WorkspaceChatMessage [ ] ,
47+ toolName : string
48+ ) : string {
49+ return events
50+ . filter ( ( event : any ) => event . type === "tool-call-end" && event . toolName === toolName )
51+ . map ( ( event : any ) => {
52+ const output = event . result ?. output ;
53+ return typeof output === "string" ? output : "" ;
54+ } )
55+ . join ( "
56+ " ) ;
57+ }
58+
4459// Skip all tests if TEST_INTEGRATION is not set
4560const describeIntegration = shouldRunIntegrationTests ( ) ? describe : describe . skip ;
4661
@@ -264,7 +279,8 @@ describeIntegration("Runtime Bash Execution", () => {
264279
265280 // Verify command completed successfully (not timeout)
266281 expect ( responseText ) . toContain ( "test" ) ;
267- expect ( responseText ) . toContain ( "data" ) ;
282+ const bashOutput = collectToolOutputs ( events , "bash" ) ;
283+ expect ( bashOutput ) . toContain ( '"test": "data"' ) ;
268284
269285 // Verify command completed quickly (not hanging until timeout)
270286 // With tokenizer preloading, both local and SSH complete in ~8s total
0 commit comments