fix(types): preserve reasoning policy record shapes (#8811)

This commit is contained in:
backryun
2026-07-28 10:38:08 +09:00
committed by GitHub
parent 308d3f06e2
commit 1b1e962221

View File

@@ -127,7 +127,7 @@ function detectThinkingBudget(
thinking: JsonRecord,
thinkingConfig: JsonRecord
): boolean {
return [
const budgetFields: Array<[JsonRecord, string]> = [
[thinking, "budget_tokens"],
[thinking, "budgetTokens"],
[reasoning, "budget_tokens"],
@@ -137,7 +137,8 @@ function detectThinkingBudget(
[body, "thinkingBudget"],
[thinkingConfig, "thinkingBudget"],
[thinkingConfig, "thinking_budget"],
].some(([record, key]) => hasNumericField(record, key));
];
return budgetFields.some(([record, key]) => hasNumericField(record, key));
}
function hasReasoningSignal(
@@ -503,7 +504,7 @@ export function attachReasoningRuleDirective(
decision: ReasoningRuleDecision
): JsonRecord {
const source = asRecord(bodyInput);
const body = {
const body: JsonRecord = {
...source,
model: decision.rule.scope === "connection" ? source.model : decision.targetModel,
};