mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
fix(venice): disable streaming to prevent SDK crash (#15878)
* fix(venice): disable streaming to prevent SDK crash with usage-only chunks (#15819) Venice.ai API returns SSE chunks containing only usage metadata without a choices array. The SDK crashes trying to access choices[0] on these chunks with: Cannot read properties of undefined (reading '0') Changes: - Disable streaming by default for all Venice models - Apply to both static catalog and dynamically discovered models - Users can explicitly enable streaming in config if needed This is a workaround until the SDK handles Venice's streaming format. Fixes #15819 * fix(venice): avoid usage streaming chunks for Venice models (openclaw#15878) thanks @Shuai-DaiDai --------- Co-authored-by: 帅小呆1号 <shuaixiaodai1@openclaw.ai> Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -300,6 +300,11 @@ export function buildVeniceModelDefinition(entry: VeniceCatalogEntry): ModelDefi
|
||||
cost: VENICE_DEFAULT_COST,
|
||||
contextWindow: entry.contextWindow,
|
||||
maxTokens: entry.maxTokens,
|
||||
// Avoid usage-only streaming chunks that can break OpenAI-compatible parsers.
|
||||
// See: https://github.com/openclaw/openclaw/issues/15819
|
||||
compat: {
|
||||
supportsUsageInStreaming: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -381,6 +386,10 @@ export async function discoverVeniceModels(): Promise<ModelDefinitionConfig[]> {
|
||||
cost: VENICE_DEFAULT_COST,
|
||||
contextWindow: apiModel.model_spec.availableContextTokens || 128000,
|
||||
maxTokens: 8192,
|
||||
// Avoid usage-only streaming chunks that can break OpenAI-compatible parsers.
|
||||
compat: {
|
||||
supportsUsageInStreaming: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user