diff --git a/src/agents/pi-tool-definition-adapter.ts b/src/agents/pi-tool-definition-adapter.ts index f8fb0ba9b9c..2d8a73502bf 100644 --- a/src/agents/pi-tool-definition-adapter.ts +++ b/src/agents/pi-tool-definition-adapter.ts @@ -159,6 +159,9 @@ export function findClientToolNameConflicts(params: { if (existingNormalized.has(normalizedName)) { conflicts.add(rawName); } + // Keep the first client-provided spelling for each normalized name so every + // later duplicate is reported against a stable original entry, even when + // the later name also collides with an existing built-in tool. const priorClientName = seenClientNames.get(normalizedName); if (priorClientName) { conflicts.add(priorClientName); diff --git a/src/gateway/openresponses-http.ts b/src/gateway/openresponses-http.ts index 7de65ab354b..467bb9d2755 100644 --- a/src/gateway/openresponses-http.ts +++ b/src/gateway/openresponses-http.ts @@ -840,24 +840,6 @@ export async function handleOpenResponsesHttpRequest( finalUsage = finalUsage ?? createEmptyUsage(); startStream(); - if (isClientToolNameConflictError(err)) { - const errorResponse = createResponseResource({ - id: responseId, - model, - status: "failed", - output: [], - error: { code: "invalid_request_error", message: "invalid tool configuration" }, - usage: finalUsage, - }); - - writeSseEvent(res, { type: "response.failed", response: errorResponse }); - emitAgentEvent({ - runId: responseId, - stream: "lifecycle", - data: { phase: "error" }, - }); - return; - } const errorResponse = createResponseResource({ id: responseId, model,