From a166d9bc4e3504c11e9a4468f34eddfccf146e21 Mon Sep 17 00:00:00 2001 From: mptyl Date: Sun, 5 Jul 2026 12:41:39 +0200 Subject: [PATCH] fix(gate): guard the steering-during-lock hint on ctx.mode, not ctx.hasUI The "respond with gate widgets; use '!' for free text" notice is terminal- flavored. Like the reLoop Esc guard, it used ctx.hasUI, which on pi >=0.80 is true in RPC too, so it leaked to the browser. Now guarded on ctx.mode === "tui". The plain text is still swallowed by the `handled` return in all modes; only the warning is dropped in RPC. No functional ctx.hasUI guard remains in the gate. Co-Authored-By: Claude Opus 4.8 --- harness/.pi/extensions/tht-gate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/harness/.pi/extensions/tht-gate.js b/harness/.pi/extensions/tht-gate.js index a36486e4..07708fd4 100644 --- a/harness/.pi/extensions/tht-gate.js +++ b/harness/.pi/extensions/tht-gate.js @@ -397,7 +397,7 @@ export default function (pi) { // `!`-prefixed free text -> forward to the model (the one sanctioned steer channel). if (trimmed.startsWith("!")) return { action: "transform", text: trimmed.slice(1).trimStart() }; - if (ctx.hasUI) { + if (ctx.mode === "tui") { await ctx.ui.notify( "Durante la sessione rispondi con i widget del gate. " + "Per inviare testo libero al modello inizia la riga con '!'.",