fix: handle missing cost.cache in provider models (#133)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-02-14 09:31:38 -05:00
1 parent 19963f579e
commit c78c96ed86
1 file changed
+3 -3
+3 -3
View File
@@ -19,7 +19,7 @@ export interface OpenCodeModel {
cost: {
input: number;
output: number;
cache: {
cache?: {
read: number;
write: number;
};
@@ -171,8 +171,8 @@ async function getProvidersFromOpenCodeServer(): Promise<{ providers: Provider[]
cost: {
input: openCodeModel.cost.input,
output: openCodeModel.cost.output,
cache_read: openCodeModel.cost.cache.read,
cache_write: openCodeModel.cost.cache.write,
cache_read: openCodeModel.cost.cache?.read ?? 0,
cache_write: openCodeModel.cost.cache?.write ?? 0,
},
limit: {
context: openCodeModel.limit.context,