优化OpenClaw会话解析

This commit is contained in:
xintaofei
2026-03-17 15:35:34 +08:00
parent 2240f3054d
commit f517f4fcbb
4 changed files with 739 additions and 287 deletions

View File

@@ -1306,9 +1306,15 @@ pub async fn acp_connect(
)));
}
let local_config_json = load_agent_local_config_json(agent_type);
let runtime_env =
let mut runtime_env =
build_runtime_env_from_setting(agent_type, setting.as_ref(), local_config_json.as_deref());
// For OpenClaw: when creating a new conversation (no session_id to resume),
// signal that we want a fresh transcript via --reset-session.
if agent_type == AgentType::OpenClaw && session_id.is_none() {
runtime_env.insert("OPENCLAW_RESET_SESSION".into(), "1".into());
}
if let registry::AgentDistribution::Npx { package, .. } = meta.distribution {
if detect_npx_cached_version(package).await.is_none() {
prepare_npx_package(package).await?;