File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/opencode/src/tool Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ export const TaskTool = Tool.define("task", async () => {
3131 const session = params . session_id
3232 ? await Session . get ( params . session_id )
3333 : await Session . create ( {
34- parentID : ctx . sessionID ,
35- title : params . description + ` (@${ agent . name } subagent)` ,
36- } )
34+ parentID : ctx . sessionID ,
35+ title : params . description + ` (@${ agent . name } subagent)` ,
36+ } )
3737 const msg = await MessageV2 . get ( { sessionID : ctx . sessionID , messageID : ctx . messageID } )
3838 if ( msg . info . role !== "assistant" ) throw new Error ( "Not an assistant message" )
3939
@@ -96,9 +96,11 @@ export const TaskTool = Tool.define("task", async () => {
9696 all = all . filter ( ( x ) => x . info . role === "assistant" )
9797 all = all . flatMap ( ( msg ) => msg . parts . filter ( ( x : any ) => x . type === "tool" ) as MessageV2 . ToolPart [ ] )
9898 const text = ( result . parts . findLast ( ( x : any ) => x . type === "text" ) as any ) ?. text ?? ""
99- const output = text ? `${ text }
99+ const output = text
100+ ? `${ text }
100101
101- [task-session:${ session . id } ]` : `[task-session:${ session . id } ]`
102+ [task-session:${ session . id } ]`
103+ : `[task-session:${ session . id } ]`
102104 return {
103105 title : params . description ,
104106 metadata : {
You can’t perform that action at this time.
0 commit comments