Claude Code Direct 回合补分段 trace
Project CI / Frontend tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
- claude_code_cli:cc Direct 回合在执行器入口、MCP loopback 就绪、sidecar 启动、sidecar 返回、解析 stream 前各写一条 agent.direct_turn.trace - direct_runtime:direct_turn_trace 提升为 pub(crate),让 Claude Code 执行器复用同一份分段留痕
This commit is contained in:
@@ -732,7 +732,9 @@ pub(crate) async fn direct_game_creator_claude_code_chat_at(
|
||||
client_turn_id: Option<&str>,
|
||||
observer: Option<&mut (dyn FnMut(DirectCodexTurnObservation) + Send)>,
|
||||
) -> Result<String, String> {
|
||||
direct_turn_trace("claude-executor-enter");
|
||||
let (mcp_url, mcp_token) = start_external_mcp_loopback(root, llm.web_search_enabled).await?;
|
||||
direct_turn_trace("claude-mcp-loopback-ready");
|
||||
let _mcp_guard = ExternalMcpStopGuard;
|
||||
let home = crate::project::resolve_local_project_path(root, ".agent/runtime/claude-code/home")?;
|
||||
std::fs::create_dir_all(&home)
|
||||
@@ -742,6 +744,7 @@ pub(crate) async fn direct_game_creator_claude_code_chat_at(
|
||||
.lock()
|
||||
.ok()
|
||||
.and_then(|sessions| sessions.get(&session_key).cloned());
|
||||
direct_turn_trace("claude-sidecar-start");
|
||||
let payload = serde_json::json!({
|
||||
"type": "turn",
|
||||
"id": client_turn_id.unwrap_or("claude-direct-turn"),
|
||||
@@ -769,6 +772,7 @@ pub(crate) async fn direct_game_creator_claude_code_chat_at(
|
||||
client_turn_id,
|
||||
)
|
||||
.await?;
|
||||
direct_turn_trace("claude-sidecar-done");
|
||||
if let Some(session_id) = sidecar
|
||||
.result
|
||||
.get("session_id")
|
||||
@@ -785,6 +789,7 @@ pub(crate) async fn direct_game_creator_claude_code_chat_at(
|
||||
.filter_map(|event| serde_json::to_string(&event).ok())
|
||||
.collect::<Vec<_>>();
|
||||
stream.push(String::new());
|
||||
direct_turn_trace("claude-parse-start");
|
||||
parse_direct_stream_result(stream.join("\n").as_bytes(), observer)
|
||||
}
|
||||
|
||||
|
||||
@@ -4301,7 +4301,7 @@ pub(crate) fn check_direct_turn_preconditions(
|
||||
/// `agent.direct_codex.*` 都没有。窗口就夹在 `begin` 与执行器调用之间,需要知道
|
||||
/// 具体停在哪一步。测试态不写,避免污染本机 AppData。
|
||||
#[cfg(not(test))]
|
||||
fn direct_turn_trace(stage: &str) {
|
||||
pub(crate) fn direct_turn_trace(stage: &str) {
|
||||
let _ = crate::append_application_log(
|
||||
"info".to_string(),
|
||||
"direct-turn".to_string(),
|
||||
@@ -4310,7 +4310,7 @@ fn direct_turn_trace(stage: &str) {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn direct_turn_trace(_stage: &str) {}
|
||||
pub(crate) fn direct_turn_trace(_stage: &str) {}
|
||||
|
||||
pub(crate) async fn run_direct_game_creator_turn_at_with_creation_type_and_emitter(
|
||||
root: &Path,
|
||||
|
||||
Reference in New Issue
Block a user