fix(gate): guard the TUI-only "Esc" notice on ctx.mode, not ctx.hasUI
reLoop's "Esc non chiude il gate..." warning is terminal-specific. On pi 0.73 ctx.hasUI was false in RPC, so `if (ctx.hasUI)` effectively meant "TUI only". On pi >=0.80 hasUI is true in RPC too (dialog-capable UI via the bridge), so the notice leaked to the browser on any invalid gate response. Guard on ctx.mode === "tui" to restore the original intent. The fake pi runtime gains mode:"tui" so the roundtrip test still exercises the notice. Audit of the other 5 ctx.ui.notify: left as-is. They are valid in both live modes (TUI and RPC, both hasUI=true) and the gate cannot run headless (emitAndWait needs a UI), so a guard would be dead code. Their dual-mode rationalization belongs with the future present() work (tracked in the eval doc). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ function createFakePi() {
|
||||
const tools = new Map();
|
||||
const ctx = {
|
||||
hasUI: true,
|
||||
mode: "tui",
|
||||
cwd: "/tmp/fake-pi-session",
|
||||
notifications: [],
|
||||
uiCalls: [],
|
||||
|
||||
Reference in New Issue
Block a user