|
|
@@ -40,9 +40,12 @@ class FeishuChannelConfig:
|
|
|
typing_reaction_enabled: bool = True
|
|
|
typing_reaction_emoji: str = "Typing"
|
|
|
# Trace 跟单结束后的生命周期(Workspace 沙箱 / 渠道绑定)
|
|
|
- stop_container_on_trace_terminal: bool = True
|
|
|
+ # 默认不在单次 Trace 终态时停沙箱:同一用户共用一个 workspace/容器,多轮对话与多 trace 复用。
|
|
|
+ stop_container_on_trace_terminal: bool = False
|
|
|
stop_container_on_trace_not_found: bool = True
|
|
|
release_ref_on_trace_terminal: bool = False
|
|
|
+ # False:绑定新 trace 时仍保留旧 trace 在 workspace 的引用,便于 Executor 等按 trace_id 解析同一用户目录
|
|
|
+ release_previous_trace_ref_on_bind: bool = False
|
|
|
|
|
|
|
|
|
class FeishuChannelManager(ChannelRegistry):
|
|
|
@@ -59,7 +62,10 @@ class FeishuChannelManager(ChannelRegistry):
|
|
|
)
|
|
|
self._workspace_manager = WorkspaceManager.from_env()
|
|
|
self._trace_manager = TraceManager.from_env(self._workspace_manager)
|
|
|
- self._trace_backend = LifecycleTraceBackend(self._trace_manager)
|
|
|
+ self._trace_backend = LifecycleTraceBackend(
|
|
|
+ self._trace_manager,
|
|
|
+ release_previous_trace_ref_on_bind=self._config.release_previous_trace_ref_on_bind,
|
|
|
+ )
|
|
|
self._identity = DefaultUserIdentityResolver()
|
|
|
self._executor = FeishuHttpRunApiExecutor(
|
|
|
base_url=self._config.agent_api_base_url,
|
|
|
@@ -131,9 +137,10 @@ class FeishuChannelManager(ChannelRegistry):
|
|
|
assistant_max_text_chars=env_int("FEISHU_AGENT_ASSISTANT_MAX_CHARS", 8000),
|
|
|
typing_reaction_enabled=env_bool("FEISHU_TYPING_REACTION", True),
|
|
|
typing_reaction_emoji=env_str("FEISHU_TYPING_REACTION_EMOJI", "Typing") or "Typing",
|
|
|
- stop_container_on_trace_terminal=env_bool("GATEWAY_WORKSPACE_STOP_ON_TRACE_TERMINAL", True),
|
|
|
+ stop_container_on_trace_terminal=env_bool("GATEWAY_WORKSPACE_STOP_ON_TRACE_TERMINAL", False),
|
|
|
stop_container_on_trace_not_found=env_bool("GATEWAY_WORKSPACE_STOP_ON_TRACE_NOT_FOUND", True),
|
|
|
release_ref_on_trace_terminal=env_bool("GATEWAY_LIFECYCLE_RELEASE_REF_ON_TRACE_TERMINAL", False),
|
|
|
+ release_previous_trace_ref_on_bind=env_bool("GATEWAY_LIFECYCLE_RELEASE_PREV_TRACE_REF_ON_BIND", False),
|
|
|
)
|
|
|
)
|
|
|
|