From ee002a15bdad73bcd3e10e8253a23ac89a1c5ec1 Mon Sep 17 00:00:00 2001 From: sim Date: Tue, 8 Sep 2026 14:42:05 +0800 Subject: [PATCH] =?UTF-8?q?test(core):=20=E9=99=90=E5=AE=9A=E6=B2=99?= =?UTF-8?q?=E7=AE=B1=E6=9D=83=E9=99=90=E6=AE=B5=E7=9A=84=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crates/openless-core/src/coding_agent.rs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/openless-all/app/crates/openless-core/src/coding_agent.rs b/openless-all/app/crates/openless-core/src/coding_agent.rs index cc7ad26d..297f40b5 100644 --- a/openless-all/app/crates/openless-core/src/coding_agent.rs +++ b/openless-all/app/crates/openless-core/src/coding_agent.rs @@ -2891,13 +2891,19 @@ broken: npx broken - ✗ Failed to connect\n"; let before = run(&[]); let after = run(&hardening); let roots = |output: &str| { - output - .split("writable root") - .nth(1) - .unwrap_or_default() - .chars() - .take(400) - .collect::() + // The debug output also contains app/tool instructions with backticks. + // Count paths only in the permissions block, not a fixed-length excerpt. + let (_, permissions) = output + .split_once("") + .expect("Codex debug output must include permissions instructions"); + let (permissions, _) = permissions + .split_once("") + .expect("Codex permissions instructions must be closed"); + permissions + .split_once("writable root") + .expect("Codex permissions must declare writable roots") + .1 + .to_string() }; let before = roots(&before); let after = roots(&after);