From ab51ae2bb3a233c5ac77bff2a046ca710201c138 Mon Sep 17 00:00:00 2001 From: Agando Date: Tue, 29 Sep 2026 13:49:18 +0200 Subject: fix: parse per-call captured output for unknown-cmd error (race-free under Promise.all) --- modules/core/terminal.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'modules/core/terminal.js') diff --git a/modules/core/terminal.js b/modules/core/terminal.js index 5c7a8fb..3b28b52 100644 --- a/modules/core/terminal.js +++ b/modules/core/terminal.js @@ -17,7 +17,6 @@ this.whitelist = new Set(this._baseWhitelist); // AI loop-guard: depth counter (reentrant, race-safe vs parallel tool calls) this._aiToolDepth = 0; - this._lastUnknownCmd = null; // Load persisted user deltas (add/remove) so hardcoded defaults can be demoted. this._loadSecurityDeltas(); this._registerBuiltIn(); @@ -171,7 +170,6 @@ return { cmd, args, known, destructive, system, unknown, hasSuspicious }; } async checkAndRun(rawInput) { - this._lastUnknownCmd = null; const { cmd, args, known, destructive, system, unknown, hasSuspicious } = this._classify(rawInput); // Level 3 Audit: just log and allow if (this.level === 3) { @@ -202,7 +200,6 @@ } // AI-invoked commands must not route back to AI (infinite loop) — return structured error if (this._aiToolDepth > 0) { - this._lastUnknownCmd = cmd; this.terminal.print(`Command not found: ${cmd}${sug ? `. Did you mean: ${sug.cmd}?` : ''}`, 'error'); return; } -- cgit v1.2.3