fix(apiproxy): omit an unresolved compression option

ApiProxyDefaults uses an exact optional property, so passing config.sessionExportCompressionLevel directly made the service object carry an explicit undefined that is not assignable to the resolved request shape. The full host build caught this distinction after the redundant fallback was removed.\n\nConditionally omit the property when Cordis has not supplied a value. Direct createApiProxy callers still receive the implementation-owned default, while configured plugin values pass through without introducing another defaulting site.
This commit is contained in:
Tianyi Cui
2026-08-11 17:59:07 +08:00
parent 544a17f604
commit b52ddb2887
+3 -1
View File
@@ -94,7 +94,9 @@ export class ApiProxyService extends Service implements ApiProxy {
saveDefaultModelSelection: selection => ctx.agentDefaultModel.saveSelection(selection),
cwd: process.cwd(),
...config.nativeOpen === undefined ? {} : { canOpenPath: () => config.nativeOpen as boolean },
sessionExportCompressionLevel: config.sessionExportCompressionLevel,
...(config.sessionExportCompressionLevel === undefined
? {}
: { sessionExportCompressionLevel: config.sessionExportCompressionLevel }),
})
this.sessions = api.sessions
this.subagents = api.subagents