diff --git a/extensions/openrouter/index.ts b/extensions/openrouter/index.ts index 7c56d8f19ddb..84c5aa168002 100644 --- a/extensions/openrouter/index.ts +++ b/extensions/openrouter/index.ts @@ -162,7 +162,8 @@ function resolveFusionExtraBody( ]; let effective: Record | undefined; for (const source of sources) { - const raw = source && Object.hasOwn(source, "extra_body") ? source.extra_body : source?.extraBody; + const raw = + source && Object.hasOwn(source, "extra_body") ? source.extra_body : source?.extraBody; const candidate = readRecord(raw); if (candidate) { effective = candidate; diff --git a/extensions/openrouter/provider-routing.ts b/extensions/openrouter/provider-routing.ts index 5871b45546bf..babc30ebf4ac 100644 --- a/extensions/openrouter/provider-routing.ts +++ b/extensions/openrouter/provider-routing.ts @@ -73,6 +73,7 @@ function resolveOpenRouterProviderConfigParams( for (const [, config] of prioritizedProviders) { const params = readRecord(config.params); if (params) { + // SAFETY: both inputs are sanitized plain records, so the recursive merge remains a record. matchedParams = mergeDeep(matchedParams ?? {}, params) as Record; } } diff --git a/src/auto-reply/reply/memory-flush.test.ts b/src/auto-reply/reply/memory-flush.test.ts index dbce6169cb85..8f57bde36d95 100644 --- a/src/auto-reply/reply/memory-flush.test.ts +++ b/src/auto-reply/reply/memory-flush.test.ts @@ -76,14 +76,13 @@ describe("Responses server compaction host/transport parity", () => { defaults: { params: { responsesCompactThreshold: 120_000 }, }, - entries: [ - { - id: "audit", + entries: { + audit: { models: { [modelRef]: { params: { responsesCompactThreshold: 175_000 } }, }, }, - ], + }, }, };