diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/parallel_read.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/parallel_read.rs index e11fcd9e9..2b943d66d 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/parallel_read.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/parallel_read.rs @@ -717,7 +717,6 @@ pub(in crate::agent) fn project_game_creator_agent_runtime_parallel_read_batch( )); } } - *observations = stored_observations; let mut runtime_projected_count = 0_usize; let mut missing_projection_seen = false; @@ -892,10 +891,6 @@ pub(in crate::agent) fn project_game_creator_agent_runtime_parallel_read_batch( if !already_projected_to_context { context_tracker.record(&observation); observations.push(observation); - *observations = sanitize_game_creator_agent_runtime_context_observations_for_storage( - root, - observations, - ); persist_game_creator_agent_runtime_context( root, runtime, diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/provider_action_batch.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/provider_action_batch.rs index 13c3e4764..8cdf0665a 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/provider_action_batch.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/provider_action_batch.rs @@ -267,7 +267,12 @@ pub(in crate::agent) fn build_game_creator_agent_runtime_pending_tool_action( .map(|item| sanitize_agent_runtime_text(item, 180)) .collect(), fallback_response: sanitize_agent_runtime_text(&plan.response, 1_200), - observations: observations.to_vec(), + // pending action 是 fail-closed 门禁保护的 durable ledger:嵌进去的观察必须先按存储口径 + // 脱敏,否则工具输出里的绝对路径会让整次持久化被拒。给模型看的那份 observation 不受影响。 + observations: sanitize_game_creator_agent_runtime_context_observations_for_storage( + root, + observations, + ), project_revision_before: project_revision_before.clone(), verification_gate_before: read_game_creator_agent_runtime_verification_gate( root, diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop.rs index 0df942e3f..8423f1cc8 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop.rs @@ -1810,10 +1810,7 @@ async fn run_game_creator_agent_background_task_pass_without_deadline( final_reply_revision = Some(planning_request_revision.revision); } } - observations = sanitize_game_creator_agent_runtime_context_observations_for_storage( - &root, - &observations, - ); + // prompt 用的是内存里的原文;落盘那份由持久化自己按存储口径脱敏。 let _ = context_tracker.complete_loop(loop_index + 1); if let Err(error) = persist_game_creator_agent_runtime_context( &root, diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs index ad78e0a75..1d1763fc8 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_state.rs @@ -998,8 +998,6 @@ pub(crate) fn prepare_game_creator_agent_background_stale_continuation_at( plan.response.clear(); context_tracker.record(&blocker); observations.push(blocker); - *observations = - sanitize_game_creator_agent_runtime_context_observations_for_storage(root, observations); let next_loop_index = usize::try_from(state.loop_iteration).unwrap_or(usize::MAX); persist_game_creator_agent_runtime_context( root,