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

Function failTool

packages/opencode/src/cli/cmd/run/demo.ts:540–566  ·  view source on GitHub ↗
(state: State, ref: Ref, error: string)

Source from the content-addressed store, hash-verified

538}
539
540function failTool(state: State, ref: Ref, error: string): void {
541 feed(state, {
542 type: "message.part.updated",
543 properties: {
544 sessionID: state.id,
545 time: Date.now(),
546 part: {
547 id: ref.part,
548 sessionID: state.id,
549 messageID: ref.msg,
550 type: "tool",
551 callID: ref.call,
552 tool: ref.tool,
553 state: {
554 status: "error",
555 input: ref.input,
556 error,
557 metadata: {},
558 time: {
559 start: ref.start,
560 end: Date.now(),
561 },
562 },
563 },
564 },
565 } as Event)
566}
567
568function emitError(state: State, text: string): void {
569 const event = {

Callers 2

permissionFunction · 0.70
questionRejectFunction · 0.70

Calls 1

feedFunction · 0.70

Tested by

no test coverage detected