Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/enterprise/src/custom-elements.d.ts
12 changes: 11 additions & 1 deletion packages/opencode/src/session/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ export namespace SessionProcessor {
value.error instanceof Question.RejectedError
) {
blocked = shouldBreak
} else if (!shouldBreak) {
// Automatic Recovery: Inject a system hint to retry
await Session.updatePart({
id: Identifier.ascending("part"),
messageID: input.assistantMessage.id,
sessionID: input.assistantMessage.sessionID,
type: "text",
synthetic: true,
text: `\n<system>The tool ${value.toolName} failed with an error. Please analyze the error message in the tool output and try again with corrected inputs.</system>\n`,
})
}
delete toolcalls[value.toolCallId]
}
Expand Down Expand Up @@ -352,7 +362,7 @@ export namespace SessionProcessor {
message: retry,
next: Date.now() + delay,
})
await SessionRetry.sleep(delay, input.abort).catch(() => {})
await SessionRetry.sleep(delay, input.abort).catch(() => { })
continue
}
input.assistantMessage.error = error
Expand Down
Loading