fix(cli): default limit.context to 128k when unknown in OpenCode configs (#11035, #11032) (#11054)

5 — OpenCode config: limit.context default 128k quando metadata de catálogo desconhecida (#11035/#11032); limit emitido por model entry. TDD, suíte aberta limpa.
This commit is contained in:
Rouzbeh†
2026-08-22 03:36:21 +03:30
committed by GitHub
parent 7e48be8061
commit 8643e0f57c
4 changed files with 32 additions and 14 deletions

View File

@@ -57,10 +57,19 @@ export const buildOpenCodeProviderConfig = ({
? normalizedModels
: [...new Set([normalizedModel, ...OPENCODE_DEFAULT_MODELS].filter(Boolean))];
const modelsRecord: Record<string, { name: string }> = {};
const modelsRecord: Record<
string,
{ name: string; limit: { context: number; output: number } }
> = {};
for (const m of uniqueModels) {
if (m) {
modelsRecord[m] = { name: getModelEntryName(m, normalizedLabels) };
modelsRecord[m] = {
name: getModelEntryName(m, normalizedLabels),
limit: {
context: 128_000,
output: 8_192,
},
};
}
}