From 14c3cb36a3b037111a9fbdf8ff6ea32ee62b3be1 Mon Sep 17 00:00:00 2001 From: Agando Date: Thu, 22 Oct 2026 00:43:13 +0200 Subject: fix(newos4): coreutils flags + loop-guard arg key, both found by the agent's live run (v4.6.49) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agent session surfaced two real defects: 1. The A4 prompt told it to use grep -n / sed -n 'N,Mp' / wc -l / head -N — none of those flags parsed: grep treated '-n' as the pattern (6/6 variants failed), wc read '-l' as a filename, head looked for a file named '-2', sed had no range parser. Fixed the tools, not just the text: grep now accepts -n/-i/-c/-v/-l (line numbers were already printed), wc accepts -l/-w/-c, head accepts -N and -n N, sed accepts Np and N,Mp, tail no longer prints a blank line for a trailing newline. Prompt re-ranked to the working forms. 2. Loop guard keyed calls by tool name plus the raw arguments field. When arguments was already an object (parsed upstream), the key became 'run_command:[object Object]', collapsing distinct batched commands into one signature and producing false "called 3x" warnings. Now the key is JSON.stringify(arguments) whenever it is not a string (3 sites: sig, _sigR, _sigD). Verified live v4.6.49: grep -n/-c, wc -l, head -2, sed -n '2,3p', tail -n 1 all correct. --- main.html | 6 +- modules/core/core-bundle.js | 120 ++++++++++++++++++++++++++++++++-------- modules/core/module-aiassist.js | 17 ++++-- modules/core/module-fs.js | 103 +++++++++++++++++++++++++++------- modules/core/module-loader.js | 2 +- 5 files changed, 196 insertions(+), 52 deletions(-) diff --git a/main.html b/main.html index c3b9dfd..636a0a1 100644 --- a/main.html +++ b/main.html @@ -1349,13 +1349,13 @@ - + - + - +