fix: clear session-scoped model after session reset

This commit is contained in:
Mikita Lisavets
2026-04-06 16:52:27 +02:00
committed by Teknium
parent 9afb9a6cb2
commit 29b5ec2555

View File

@@ -3264,13 +3264,13 @@ class GatewayRunner:
except Exception:
pass
# Reset the session
new_entry = self.session_store.reset_session(session_key)
# Clear any session-scoped model override so the next agent picks up
# the configured default instead of the previously switched model.
self._session_model_overrides.pop(session_key, None)
# Reset the session
new_entry = self.session_store.reset_session(session_key)
# Emit session:end hook (session is ending)
await self.hooks.emit("session:end", {
"platform": source.platform.value if source.platform else "",