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

Function errorTool

packages/opencode/test/acp/event.test.ts:280–296  ·  view source on GitHub ↗
(sessionID: string, callID: string)

Source from the content-addressed store, hash-verified

278}
279
280function errorTool(sessionID: string, callID: string) {
281 return {
282 id: `part_${callID}`,
283 sessionID,
284 messageID: `msg_${callID}`,
285 type: "tool",
286 callID,
287 tool: "bash",
288 state: {
289 status: "error",
290 input: { cmd: "exit 1" },
291 error: "failed hard",
292 metadata: { exit: 1 },
293 time: { start: Date.now() - 1, end: Date.now() },
294 },
295 } satisfies ToolPart
296}
297
298function toolUpdates(updates: SessionUpdateParams[]) {
299 return updates.filter((item): item is ToolSessionUpdateParams => {

Callers 1

event.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected