Skip to content

Commit 1440182

Browse files
committed
Fix streaming for programmatic agents
1 parent 35f1e5f commit 1440182

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

backend/src/run-programmatic-step.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { executeToolCall } from './tools/tool-executor'
1111
import { logger } from './util/logger'
1212
import { SandboxManager } from './util/quickjs-sandbox'
1313
import { getRequestContext } from './websockets/request-context'
14+
import { sendAction } from './websockets/websocket-action'
1415

1516
// Global sandbox manager for QuickJS contexts
1617
const sandboxManager = new SandboxManager()
@@ -119,6 +120,18 @@ export async function runProgrammaticStep(
119120
userId,
120121
repoId,
121122
agentTemplate: template,
123+
sendSubagentChunk: (data: {
124+
userInputId: string
125+
agentId: string
126+
agentType: string
127+
chunk: string
128+
prompt?: string
129+
}) => {
130+
sendAction(ws, {
131+
type: 'subagent-response-chunk',
132+
...data,
133+
})
134+
},
122135
agentState: { ...agentState },
123136
agentContext: agentState.agentContext,
124137
messages: [...agentState.messageHistory],

0 commit comments

Comments
 (0)