fix(opencode): preserve extra model fields during serialization

Add `extra` field with serde flatten to OpenCodeModel struct to capture
custom fields like cost, modalities, thinking, and variants that were
previously lost during save operations.
This commit is contained in:
Jason
2026-01-23 20:42:50 +08:00
parent d6cf4390ac
commit a6ad896db0
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -310,6 +310,8 @@ export interface OpenCodeModel {
output?: number;
};
options?: Record<string, unknown>; // 模型级别额外选项(provider 路由等)
// 支持任意额外字段(cost、modalities、thinking、variants 等)
[key: string]: unknown;
}
// OpenCode 供应商选项