fix(web): pending user-input Submit bypasses normal-send guards #9319
ClosedImBIOS(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/9319/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -0,0 +1,17 @@1+/**2+ * Strip terminal escape sequences from captured CLI stdout.3+ *4+ * OpenCode's CLI (and potentially other provider CLIs) can emit OSC title5+ * sequences (`ESC ]0;<title> BEL` / `ESC \`) and ANSI CSI color codes directly6+ * to stdout, even when stdout is a pipe. When T3 Code captures that output7+ * via `ChildProcessSpawner`, those bytes pollute structured parsing — e.g.8+ * `opencode agent list` becomes `\x1b]0;t3code: ready\x07build (primary)`9+ * instead of `build (primary)`, causing the agent inventory to store a10+ * polluted id that later fails with `Agent not found`.11+ *12+ * This is defensive for any provider CLI; the regexes are intentionally13+ * permissive and also handle Ghostty/Zsh title integrations that can leak14+ * through `shell: true` spawns.15+ */16+const OSC_RE = /\x1b\].*?(?:\x07|\x1b\\)/g;17+const CSI_RE = /\x1b\[[0-9;?]*[ -/]*[@-~]/g;
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed