Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

fix(server): 补上会话内换模型类型标注里漏掉的那个请求字段

lmlihengdb2f033af964
diff --git a/packages/server/src/runtime/session-manager.ts b/packages/server/src/runtime/session-manager.ts
index f3716114..f007eeb4 100644
--- a/packages/server/src/runtime/session-manager.ts
+++ b/packages/server/src/runtime/session-manager.ts
@@ -202,11 +202,15 @@ export interface RuntimeSession {
* the target by then; a refusal is thrown before the first event; a Session that never ran
* switches without streaming anything. Optional: test fakes may omit it, reading as
* "switching is not available".
+ *
+ * `onCompactionFailure` is core's own field of the same name (`"discard"` drops the context
+ * and switches anyway); the manager passes it straight through and never reads it.
*/
switchModel?(opts: {
provider: string;
modelId: string;
signal: AbortSignal;
+ onCompactionFailure?: SwitchFailurePolicy;
}): AsyncGenerator<OmniMessage, StopReason>;
/**
* The Session's thinking level (core `Session.thinkingLevel`, plain state): soft-limited —