feat(agent): make model presets session-scoped (#4866)

This commit is contained in:
chengyongru authored and GitHub committed 2026-07-23 00:38:49 +08:00
1 parent 66690fdb0c
commit c22efb5f7a
41 files changed
+1140 -155

No files matched your search

+2 -4
View File
@@ -84,8 +84,6 @@ class LLMRuntime:
def runtime_from_provider_snapshot(
snapshot: ProviderSnapshot,
*,
model_preset: str | None = None,
) -> LLMRuntime:
"""Convert a provider factory snapshot into the canonical runtime value."""
if snapshot.generation is not None:
@@ -94,13 +92,13 @@ def runtime_from_provider_snapshot(
model=snapshot.model,
generation=snapshot.generation,
context_window_tokens=snapshot.context_window_tokens,
model_preset=model_preset,
model_preset=snapshot.model_preset,
snapshot_signature=snapshot.signature,
)
return LLMRuntime.capture(
snapshot.provider,
snapshot.model,
context_window_tokens=snapshot.context_window_tokens,
model_preset=model_preset,
model_preset=snapshot.model_preset,
snapshot_signature=snapshot.signature,
)