From 877724d7bc5d17652ba5d8833912ef9122809e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Wed, 2 Sep 2026 20:14:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E6=8C=81Direct=E8=A7=82=E5=AF=9F?= =?UTF-8?q?=E5=99=A8=E8=B0=83=E7=94=A8=E6=8E=A5=E5=8F=A3=E7=A8=B3=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保留原有run_turn_with_direct_observer参数形状。 将历史回放参数收口到内部专用入口。 --- .../src-tauri/src/agent/codex_app_server.rs | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server.rs index 68b6472af..84b23aba9 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server.rs @@ -2079,7 +2079,6 @@ impl CodexAppServerConnection { snapshot, llm, request, - None, on_agent_message_delta, None, None, @@ -2088,6 +2087,27 @@ impl CodexAppServerConnection { } async fn run_turn_with_direct_observer( + &self, + snapshot: &AgentRuntimeProviderRequestSnapshot, + llm: &GameCreatorLlmConfig, + request: LlmRunRequest, + mut on_agent_message_delta: Option<&mut (dyn FnMut(&platform_llm::LlmStreamDelta) + Send)>, + mut direct_observer: Option<&mut (dyn FnMut(DirectCodexTurnObservation) + Send)>, + mut audit: Option<&mut DirectCodexTurnAudit>, + ) -> Result { + self.run_turn_with_direct_observer_and_history( + snapshot, + llm, + request, + None, + on_agent_message_delta, + direct_observer, + audit, + ) + .await + } + + async fn run_turn_with_direct_observer_and_history( &self, snapshot: &AgentRuntimeProviderRequestSnapshot, llm: &GameCreatorLlmConfig, @@ -3179,7 +3199,7 @@ pub(crate) async fn direct_game_creator_codex_chat_at_with_optional_observer( .with_request_timeout_ms(config.llm.request_timeout_ms) .with_max_output_tokens(16_000); connection - .run_turn_with_direct_observer( + .run_turn_with_direct_observer_and_history( &snapshot, &config.llm, request, @@ -4652,7 +4672,6 @@ while IFS= read -r line; do :; done &test_snapshot(), &llm, tool_request(), - None, Some(&mut on_delta), Some(&mut observer), None,