From fe3eeac2171c537cdb32ad558fc3f6a0461c974c Mon Sep 17 00:00:00 2001 From: JamesDAdams Date: Thu, 13 Aug 2026 16:31:42 +0200 Subject: [PATCH] fix: omniroute provider compatibility issues - omit top_p from request body when undefined (strict providers reject null) - add items field to project-tasks tool attachments array schema (Gemini rejects arrays without items) - improve LLM stream error log to include message via String(error) --- src/server/llm/client-pure.ts | 2 +- src/server/llm/client.ts | 2 +- src/server/tools/project-tasks.ts | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/llm/client-pure.ts b/src/server/llm/client-pure.ts index 75c3708a..0b2de987 100644 --- a/src/server/llm/client-pure.ts +++ b/src/server/llm/client-pure.ts @@ -257,7 +257,7 @@ async function buildChatCompletionCreateParams( ...(request.toolChoice ? { tool_choice: request.toolChoice as ChatCompletionToolChoiceOption } : {}), temperature, max_tokens: maxTokens, - top_p: topP, + ...(topP !== undefined && { top_p: topP }), stream: isStreaming, ...(isStreaming ? { stream_options: { include_usage: true } } : {}), } diff --git a/src/server/llm/client.ts b/src/server/llm/client.ts index 3be17f62..71570326 100644 --- a/src/server/llm/client.ts +++ b/src/server/llm/client.ts @@ -376,7 +376,7 @@ export function createLLMClient(config: Config, initialBackend: Backend = 'unkno }, } } catch (error) { - logger.error('LLM stream error', { error }) + logger.error('LLM stream error', { error: String(error) }) yield { type: 'error', error: error instanceof Error ? error.message : 'Unknown LLM error', diff --git a/src/server/tools/project-tasks.ts b/src/server/tools/project-tasks.ts index 0cef6b64..cbdff76f 100644 --- a/src/server/tools/project-tasks.ts +++ b/src/server/tools/project-tasks.ts @@ -83,7 +83,11 @@ export const projectTasksTool = createTool( action: { type: 'string', enum: VALID_ACTIONS, description: 'The action to perform' }, taskId: { type: 'string', description: 'Target task id (edit, move, set_gate_value, delete)' }, prompt: { type: 'string', description: 'The prompt/instruction executed when the task launches' }, - attachments: { type: 'array', description: 'Optional attachments (same shape as chat attachments)' }, + attachments: { + type: 'array', + description: 'Optional attachments (same shape as chat attachments)', + items: {}, + }, agentId: { type: 'string', description: 'Selected agent id' }, providerId: { type: 'string', description: 'Provider id used when a session is spawned' }, model: { type: 'string', description: 'Model label used when a session is spawned' },