Skip to content

The agent that grows with you

fix(gateway): restore pinned parent_chat_id via replace_source

kshitijk4poor9c13cb21d47c
diff --git a/gateway/run_agent_cache.py b/gateway/run_agent_cache.py
index f18efeadf42..6b3b428a54e 100644
--- a/gateway/run_agent_cache.py
+++ b/gateway/run_agent_cache.py
@@ -4,7 +4,6 @@ for GatewayRunner (MRO mixin). ``gateway.run`` internals are imported lazily ins
from __future__ import annotations
-import dataclasses
import importlib
import logging
import threading
@@ -664,7 +663,8 @@ class GatewayAgentCacheMixin:
return channel_prompt, source
pinned_prompt, pinned_parent = pin
if pinned_parent and not getattr(source, "parent_chat_id", None):
- source = dataclasses.replace(source, parent_chat_id=pinned_parent)
+ from gateway.session_identity import replace_source
+ source = replace_source(source, parent_chat_id=pinned_parent)
return pinned_prompt, source
@staticmethod