File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,6 @@ export async function runProgrammaticStep(
200200 role : 'assistant' as const ,
201201 content : toolCallString ,
202202 } )
203- onResponseChunk ( toolCallString )
204203 state . sendSubagentChunk ( {
205204 userInputId,
206205 agentId : agentState . agentId ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type {
44 ClientToolName ,
55 CodebuffToolCall ,
66} from '@codebuff/common/tools/list'
7+ import { PrintModeEvent } from '@codebuff/common/types/print-mode'
78import type { ProjectFileContext } from '@codebuff/common/util/file'
89
910type PresentOrAbsent < K extends PropertyKey , V > =
@@ -22,7 +23,7 @@ export type CodebuffToolHandlerFunction<T extends ToolName = ToolName> = (
2223
2324 fullResponse : string
2425
25- writeToClient : ( chunk : string ) => void
26+ writeToClient : ( chunk : string | PrintModeEvent ) => void
2627
2728 getLatestState : ( ) => any
2829 state : { [ K in string ] ?: any }
Original file line number Diff line number Diff line change 66 executeAgent ,
77} from './spawn-agent-utils'
88import { MAX_AGENT_STEPS_DEFAULT } from '@codebuff/common/constants/agents'
9- import { expireMessages } from '../../../util/messages'
109
1110import type { CodebuffToolHandlerFunction } from '../handler-function-type'
1211import type { CodebuffToolCall } from '@codebuff/common/tools/list'
@@ -24,6 +23,7 @@ export const handleSpawnAgentInline = ((params: {
2423 fileContext : ProjectFileContext
2524 clientSessionId : string
2625 userInputId : string
26+ writeToClient : ( chunk : string | PrintModeEvent ) => void
2727
2828 getLatestState : ( ) => { messages : CodebuffMessage [ ] }
2929 state : {
@@ -44,6 +44,7 @@ export const handleSpawnAgentInline = ((params: {
4444 userInputId,
4545 getLatestState,
4646 state,
47+ writeToClient,
4748 } = params
4849 const {
4950 agent_type : agentTypeStr ,
@@ -102,10 +103,8 @@ export const handleSpawnAgentInline = ((params: {
102103 localAgentTemplates,
103104 userId,
104105 clientSessionId,
105- onResponseChunk : ( chunk : string | PrintModeEvent ) => {
106- // Child agent output is streamed directly to parent's output
107- // No need for special handling since we share message history
108- } ,
106+ // Inherits parent's onResponseChunk
107+ onResponseChunk : writeToClient ,
109108 } )
110109
111110 // Update parent's message history with child's final state
You can’t perform that action at this time.
0 commit comments