From 99bbe512f882af64067e268314d42ec5e4003702 Mon Sep 17 00:00:00 2001 From: Yuimi-chaya Date: Tue, 7 Jul 2026 02:22:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20goal=20resume=20guard=20/=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9B=AE=E6=A0=87=E7=BB=AD=E8=B7=91=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 中文说明: 新增可选的目标续跑保护开关。开启后,Codex++ 会在检测到 Codex goal 上下文的 Responses 请求中追加轻量保护提示,要求恢复时优先当前 active goal 和 checkpoint 文件,避免压缩后把旧手动引导或旧目标结果当成新任务。 保护提示会要求读取 .codexpp-goal-state.md 或 GOAL_STATE.md,并在长任务中按小批次或阶段及时更新 checkpoint,减少中断、压缩或隔天恢复时重复执行旧步骤。 本提交同时补齐管理器设置、英文 i18n、设置保存/合并,以及目标检测和去重单测。另同步上游 rustfmt 对 cdp_bridge.rs 的一处格式化,保证 cargo fmt --check 可通过。 English Summary: Add an optional goal resume guard. When enabled, Codex++ appends a lightweight guard instruction to Responses requests that contain Codex goal context, so resumed work prefers the current active goal and checkpoint files instead of replaying stale manual steering or old goal results. The guard asks Codex to read .codexpp-goal-state.md or GOAL_STATE.md and to update checkpoints after meaningful small batches or completed stages during long-running goals, reducing duplicated work after compaction, interruption, or later resume. This commit also wires the manager setting, English i18n, settings persistence/merge behavior, goal-context detection, de-duplication tests, and one upstream rustfmt-only cdp_bridge.rs formatting sync needed for cargo fmt --check. --- apps/codex-plus-manager/src/App.tsx | 18 +- apps/codex-plus-manager/src/i18n-en.ts | 3 + crates/codex-plus-core/src/protocol_proxy.rs | 167 ++++++++++++++++++- crates/codex-plus-core/src/settings.rs | 7 + crates/codex-plus-core/tests/cdp_bridge.rs | 4 +- tools/i18n-keys.json | 2 + 6 files changed, 198 insertions(+), 3 deletions(-) diff --git a/apps/codex-plus-manager/src/App.tsx b/apps/codex-plus-manager/src/App.tsx index 0d9ac577e..391d9f190 100644 --- a/apps/codex-plus-manager/src/App.tsx +++ b/apps/codex-plus-manager/src/App.tsx @@ -171,6 +171,7 @@ type BackendSettings = { codexAppImageOverlayPath: string; codexAppImageOverlayOpacity: number; codexGoalsEnabled: boolean; + codexAppGoalResumeGuard: boolean; launchMode: LaunchMode; relayBaseUrl: string; relayApiKey: string; @@ -691,6 +692,7 @@ const defaultSettings: BackendSettings = { codexAppImageOverlayPath: "", codexAppImageOverlayOpacity: 35, codexGoalsEnabled: false, + codexAppGoalResumeGuard: false, launchMode: "patch", relayBaseUrl: "", relayApiKey: "", @@ -3916,7 +3918,7 @@ function RelayProfileDetail({ - + {isAggregateRelayProfile(draft) ? null : ( void; onProfileChange: (value: RelayProfile) => void; onSwitch: () => void; actions: Actions; @@ -4095,6 +4099,17 @@ function RelayProfileEditor({ /> {t("启用目标功能")} + +

+ {t("检测到目标上下文时,Codex++ 会在中转请求中追加续跑保护提示,减少压缩后重做旧任务。")} +