MCPcopy Create free account
hub / github.com/anomalyco/opencode / runningTool

Method runningTool

packages/opencode/src/acp/event.ts:281–317  ·  view source on GitHub ↗
(sessionId: string, part: ToolPart, cwd: string)

Source from the content-addressed store, hash-verified

279 }
280
281 private async runningTool(sessionId: string, part: ToolPart, cwd: string) {
282 if (part.state.status !== "running") return
283
284 const output = part.tool === "bash" ? shellOutputSnapshot(part.state) : undefined
285 if (output !== undefined) {
286 if (this.shellSnapshots.get(part.callID) === output) {
287 await this.input.connection.sessionUpdate({
288 sessionId,
289 update: {
290 sessionUpdate: "tool_call_update",
291 ...duplicateRunningToolUpdate({
292 toolCallId: part.callID,
293 toolName: part.tool,
294 state: part.state,
295 cwd,
296 }),
297 },
298 })
299 return
300 }
301 this.shellSnapshots.set(part.callID, output)
302 }
303
304 await this.input.connection.sessionUpdate({
305 sessionId,
306 update: {
307 sessionUpdate: "tool_call_update",
308 ...runningToolUpdate({
309 toolCallId: part.callID,
310 toolName: part.tool,
311 state: part.state,
312 output,
313 cwd,
314 }),
315 },
316 })
317 }
318
319 private async toolStart(sessionId: string, part: ToolPart, cwd: string) {
320 if (this.toolStarts.has(part.callID)) return

Callers 1

handleToolPartMethod · 0.95

Calls 5

shellOutputSnapshotFunction · 0.90
runningToolUpdateFunction · 0.90
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected