Compare commits

...
Author SHA1 Message Date
Aiden Cline cc956258d6 fix(sync): preserve reasoning options 2026-06-04 11:49:16 -05:00
2 changed files with 17 additions and 0 deletions

No files matched your search

+16
View File
@@ -494,6 +494,10 @@ function formatNumber(n: number) {
return Number.isInteger(n) ? formatInteger(n) : String(n);
}
function formatReasoningValue(value: string | null) {
return value === null ? quote("null") : quote(value);
}
function formatToml(model: z.infer<typeof SyncedAuthoredModel>) {
const lines: string[] = [];
@@ -516,6 +520,18 @@ function formatToml(model: z.infer<typeof SyncedAuthoredModel>) {
if (model.open_weights !== undefined) lines.push(`open_weights = ${model.open_weights}`);
if (model.status !== undefined) lines.push(`status = ${quote(model.status)}`);
for (const option of model.reasoning_options ?? []) {
lines.push("", "[[reasoning_options]]");
lines.push(`type = ${quote(option.type)}`);
if (option.type === "effort") {
lines.push(`values = [${option.values.map(formatReasoningValue).join(", ")}]`);
}
if (option.type === "budget_tokens") {
if (option.min !== undefined) lines.push(`min = ${formatInteger(option.min)}`);
if (option.max !== undefined) lines.push(`max = ${formatInteger(option.max)}`);
}
}
if (model.interleaved !== undefined) {
lines.push("");
if (model.interleaved === true) {
@@ -123,6 +123,7 @@ function buildModel(model: GoogleModel, existing: ExistingModel): SyncedModel {
temperature: model.temperature !== undefined || model.maxTemperature !== undefined
? true
: existing.temperature,
reasoning_options: existing.reasoning_options,
tool_call: toolCall,
structured_output: existing.structured_output,
knowledge: existing.knowledge,