fix(openai): avoid invalid reasoning replay

This commit is contained in:
Peter Steinberger
2026-01-10 00:45:10 +00:00
parent 626b085c85
commit cb10682d3e
8 changed files with 495 additions and 6 deletions

View File

@@ -651,7 +651,9 @@ export function createClawdbotCodingTools(options?: {
// Without this, some providers (notably OpenAI) will reject root-level union schemas.
const normalized = subagentFiltered.map(normalizeToolParameters);
const withAbort = options?.abortSignal
? normalized.map((tool) => wrapToolWithAbortSignal(tool, options.abortSignal))
? normalized.map((tool) =>
wrapToolWithAbortSignal(tool, options.abortSignal),
)
: normalized;
// Anthropic blocks specific lowercase tool names (bash, read, write, edit) with OAuth tokens.