aboutsummaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-09-29 13:49:54 +0200
committerAgando <roduccomm@gmail.com>2026-09-29 13:49:54 +0200
commit25adb2f8bb96ac1e534645083e02557875af8b67 (patch)
treebd319958c73c4e9ec469be5310c3c4ea5af4a7f0 /modules/core
parentab51ae2bb3a233c5ac77bff2a046ca710201c138 (diff)
fix: regex captures full command name + suggestion in unknown-cmd tool error
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/core-bundle.js2
-rw-r--r--modules/core/module-aiassist.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/core/core-bundle.js b/modules/core/core-bundle.js
index 8db04d4..c7a91dc 100644
--- a/modules/core/core-bundle.js
+++ b/modules/core/core-bundle.js
@@ -10260,7 +10260,7 @@ buildSystemPrompt() {
this.terminal.security._aiToolDepth++;
try { await this.terminal.security.checkAndRun(cmd); } finally { this.terminal.security._aiToolDepth--; this.terminal.print = originalPrint; }
// Parse per-call captured output (race-free) — not shared security state
- const nfMatch = output.match(/Command not found: (\S+?)(?:\. Did you mean: (\S+)\?)?/);
+ const nfMatch = output.match(/Command not found: ([^\s.]+)(?:\. Did you mean: ([^\s.?]+)\?)?/);
if (nfMatch) {
return JSON.stringify({ error: `Command not found: ${nfMatch[1]}`, suggestion: nfMatch[2] || null });
}
diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js
index 145e248..3d04df7 100644
--- a/modules/core/module-aiassist.js
+++ b/modules/core/module-aiassist.js
@@ -2268,7 +2268,7 @@ buildSystemPrompt() {
this.terminal.security._aiToolDepth++;
try { await this.terminal.security.checkAndRun(cmd); } finally { this.terminal.security._aiToolDepth--; this.terminal.print = originalPrint; }
// Parse per-call captured output (race-free) — not shared security state
- const nfMatch = output.match(/Command not found: (\S+?)(?:\. Did you mean: (\S+)\?)?/);
+ const nfMatch = output.match(/Command not found: ([^\s.]+)(?:\. Did you mean: ([^\s.?]+)\?)?/);
if (nfMatch) {
return JSON.stringify({ error: `Command not found: ${nfMatch[1]}`, suggestion: nfMatch[2] || null });
}