Direct 回合兜底收口同时写项目侧脱敏诊断
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 / Frontend 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

TurnReservation 兜底收口时除应用日志外,再写一份 .agent/runtime/errors 脱敏诊断
诊断正文带 threadId 与 turnToken,便于与账本、运行日志对账
This commit is contained in:
kdletters
2026-10-02 13:54:50 +08:00
parent a6428228d1
commit b8a659c12f
@@ -94,6 +94,16 @@ impl Drop for TurnReservation {
// application.log 全空)。测试态不写,避免用例污染本机 AppData。
#[cfg(not(test))]
if finalized_by_guard {
// 项目侧也留一份脱敏诊断:用户在项目目录里就能看到这一轮的收场,
// 不必只依赖 AppData 的应用日志。
let failure = DirectTurnError::TurnFailed {
stage: DirectCodexFailureStage::CodeGeneration,
detail: format!(
"DirectProject 宿主任务提前结束(panic、future 被丢弃或被取消),本轮未写下终态;threadId={} turnToken={}",
self.thread_id, self.token
),
};
let _ = record_direct_codex_failure(Path::new(&self.thread_id), &failure, None);
let _ = crate::append_application_log(
"error".to_string(),
"direct-turn".to_string(),