MCPcopy Index your code
hub / github.com/anomalyco/opencode / toolStatus

Function toolStatus

packages/opencode/src/cli/cmd/run/session-data.ts:397–419  ·  view source on GitHub ↗
(part: ToolPart)

Source from the content-addressed store, hash-verified

395}
396
397function toolStatus(part: ToolPart): string {
398 if (part.tool !== "task") {
399 return `running ${part.tool}`
400 }
401
402 const state = part.state as {
403 input?: {
404 description?: unknown
405 subagent_type?: unknown
406 }
407 }
408 const desc = state.input?.description
409 if (typeof desc === "string" && desc.trim()) {
410 return `running ${desc.trim()}`
411 }
412
413 const type = state.input?.subagent_type
414 if (typeof type === "string" && type.trim()) {
415 return `running ${type.trim()}`
416 }
417
418 return "running task"
419}
420
421// Returns true if we can flush this part's text to scrollback.
422//

Callers 2

startToolFunction · 0.85
reduceSessionDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected