diff --git a/src/models.ts b/src/models.ts index 3aec41c..de9827a 100644 --- a/src/models.ts +++ b/src/models.ts @@ -19,7 +19,6 @@ export interface QoderModelEntry { enable?: boolean; display_name?: string; max_input_tokens?: number; - max_output_tokens?: number; context_config?: Record; is_vl?: boolean; is_reasoning?: boolean; @@ -589,7 +588,7 @@ export async function updateQoderModelsCache( input: isVL ? ["text", "image"] : ["text"], cost: ZERO_COST, contextWindow: ctxLen, - maxTokens: entry.max_output_tokens || 32768, + maxTokens: 32768, }); } diff --git a/src/stream.ts b/src/stream.ts index e2e13cc..f94d068 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -128,7 +128,6 @@ export function streamQoder( const modelConfig = getCachedModelConfig(model.id, providerMode) || { key: model.id, is_reasoning: false, - max_output_tokens: 32768, source: "system", }; // Use the cached entry's original upstream key when available; fall back to @@ -136,7 +135,6 @@ export function streamQoder( const qoderModel = modelConfig.key || model.id; const isReasoning = !!modelConfig.is_reasoning; - const maxOutputTokens = modelConfig.max_output_tokens || 32768; const normalizedMessages = transformMessagesForQoder(context.messages); const systemText = context.systemPrompt || ""; @@ -163,10 +161,10 @@ export function streamQoder( ? `${stablePart}-${options.sessionId}` : `${stablePart}-${crypto.randomUUID()}`; + // Qoder's catalog exposes no per-model output cap (no max_output_tokens), + // so we default to 32K (matches qodercli's 32e3 fallback) and let pi cap it + // lower when the caller sets options.maxTokens (e.g. compaction at 40K). let maxTokens = 32768; - if (maxOutputTokens > 0) { - maxTokens = maxOutputTokens; - } if (options?.maxTokens && options.maxTokens < maxTokens) { maxTokens = options.maxTokens; }