From 1c03736d6b179808f5ee96c1b800beffcc457228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 24 Sep 2026 13:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=BF=E4=B8=BB=EF=BC=9A=E5=88=A0=E6=8E=89?= =?UTF-8?q?=E6=81=92=E4=B8=BA=20false=20=E7=9A=84=20invites=5Frepair=20?= =?UTF-8?q?=E5=88=A4=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit direct_turn_error.rs:DirectDomainFact::invites_repair 每个分支都返回 false,is_model_repairable 里的 is_none_or(invites_repair) 实际等价于 is_none(),第一个分支还误导性地暗示"有些事实值得反馈"。删掉该方法,调用点直接写 is_none(),并把"认出是哪一类就拦"的理由写进注释;行为逐条不变(direct_ 过滤 474 passed)。 --- .../src-tauri/src/agent/direct_turn_error.rs | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_turn_error.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_turn_error.rs index 1afcb32ea..b8d0ea853 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_turn_error.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_turn_error.rs @@ -492,9 +492,11 @@ impl DirectTurnError { pub(crate) fn is_model_repairable(&self) -> bool { match self { Self::ModelCallFailed { kind, .. } => kind.is_model_repairable(), - // 阶段失败 / 桥变体:只认得出的事实才拦(产生层还没 typed 出口的深层事实)。 + // 阶段失败 / 桥变体:**认出是哪一类就拦**(产生层还没 typed 出口的深层事实才继续 + // 反馈)。已归类的都是模型改不动的事实——凭据 / 权限 / 额度 / 历史一致性与契约变化, + // 把同一份输入再跑一轮只会拿到同一结论;旧的字面量判据也是这个口径。 Self::TurnFailed { detail, .. } | Self::TurnFailedUnclassified { detail } => { - DirectDomainFact::classify(detail).is_none_or(DirectDomainFact::invites_repair) + DirectDomainFact::classify(detail).is_none() } _ => false, } @@ -827,29 +829,6 @@ impl DirectDomainFact { .map(|(fact, _)| *fact) } - /// 值不值得把这条失败作为下一轮调试上下文反馈给模型。 - fn invites_repair(self) -> bool { - match self { - Self::ArtIdentityRejected | Self::ContractChanged => false, - Self::PaidCreditsInsufficient - | Self::CredentialStorageUnprepared - | Self::CredentialNotPersisted - | Self::LocalDeveloperKeyMissing - | Self::AuthenticationRejected - | Self::PermissionDenied - | Self::CredentialsUnavailable - | Self::HistoryInjectionOversize - | Self::HistoryShapeUnsupported - | Self::HistoryContention - | Self::ProjectWriteLockContention - | Self::ValidationBudgetExhausted - | Self::ValidationAlreadyRunning - | Self::PlaytestAttemptLimitExceeded - | Self::ToolArgumentsInvalid - | Self::Cancelled => false, - } - } - /// 用户重试这一轮有没有意义:同一份输入每次都会得到同一结论的事实不标可重试。 fn is_retryable(self) -> bool { match self {