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 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 12:41:39 +02:00
co-authored by Claude Opus 4.8
parent d6b4729ddf
commit a166d9bc4e
+1 -1
View File
@@ -397,7 +397,7 @@ export default function (pi) {
// `!`-prefixed free text -> forward to the model (the one sanctioned steer channel). // `!`-prefixed free text -> forward to the model (the one sanctioned steer channel).
if (trimmed.startsWith("!")) if (trimmed.startsWith("!"))
return { action: "transform", text: trimmed.slice(1).trimStart() }; return { action: "transform", text: trimmed.slice(1).trimStart() };
if (ctx.hasUI) { if (ctx.mode === "tui") {
await ctx.ui.notify( await ctx.ui.notify(
"Durante la sessione rispondi con i widget del gate. " + "Durante la sessione rispondi con i widget del gate. " +
"Per inviare testo libero al modello inizia la riga con '!'.", "Per inviare testo libero al modello inizia la riga con '!'.",