Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([med-tests-no-tests-for-server-lib-ansistrip-js]): address codex review

[._.]/ Adam Eivy771d86298714
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index dcbfa4b398..6c93fd837e 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -10,7 +10,7 @@
## Added
-- **[med-tests-no-tests-for-server-lib-ansistrip-js] Tests for `server/lib/ansiStrip.js` and `server/lib/tuiHandshake.js`.** New `ansiStrip.test.js` (25 tests) covers `stripAnsi` one-shot behavior, the `createStreamingAnsiStripper` chunk-boundary buffering (CSI/OSC split across chunks, bare `\x1B` at chunk end resolved as either single-byte or CSI on the next chunk, OSC body leak when terminator never arrives within the 4096-byte window, older unterminated bytes past the window). New `tuiHandshake.test.js` (29 tests) pins every paste-timing constant both production paths (`tuiPromptRunner.js`, `agentTuiSpawning.js`) depend on, plus `PASTE_MARKER_PATTERN`, `inferTuiCommand`, `applyCommandDefaults` (codex `--ask-for-approval never` injection), `buildTuiInvocation` (model-flag baked-in suppression for `--model`/`-m`/`=` forms + codex sentinel), and `detectMissingTuiBinary`. A latent OSC-stripping bug surfaced during the write — `ANSI_PATTERN`'s OSC alternative is dead code because the single-byte alternative `[@-Z\\-_]` matches `\x1B]` first, so OSC bodies leak into the cleaned stream; tests document the current behavior and the issue is logged as [ansistrip-osc-alternative-unreachable] in PLAN.md for a separate fix.
+- **[med-tests-no-tests-for-server-lib-ansistrip-js] Tests for `server/lib/ansiStrip.js` and `server/lib/tuiHandshake.js`.** New `ansiStrip.test.js` covers `stripAnsi` one-shot behavior and the `createStreamingAnsiStripper` chunk-boundary buffering (CSI/OSC split across chunks, bare `\x1B` at chunk end resolved as either single-byte or CSI on the next chunk, OSC body leak when terminator never arrives within the 4096-byte window, older unterminated bytes past the window). New `tuiHandshake.test.js` pins every paste-timing constant both production paths (`tuiPromptRunner.js`, `agentTuiSpawning.js`) depend on, plus `PASTE_MARKER_PATTERN`, `inferTuiCommand`, `applyCommandDefaults` (codex `--ask-for-approval never` injection), `buildTuiInvocation` (model-flag baked-in suppression for `--model X`, `--model=X`, `-m X`, `-m=X`, and the codex sentinel), and `detectMissingTuiBinary`. A latent OSC-stripping bug surfaced during the write — `ANSI_PATTERN`'s OSC alternative is dead code because the single-byte alternative `[@-Z\\-_]` matches `\x1B]` first, so OSC bodies leak into the cleaned stream; tests document the current behavior and the issue is logged as [ansistrip-osc-alternative-unreachable] in PLAN.md for a separate fix.
- **Network Exposure dashboard widget.** New widget surfaces how PortOS is actually exposed on the network: HTTPS vs HTTP, bind address + audience (loopback-only / all-interfaces / specific-interface), cert mode (Tailscale-trusted hostname vs self-signed), the loopback HTTP mirror port when HTTPS is on, and a mic-availability hint computed from the browser origin (HTTPS or loopback ⇒ available; HTTP on a Tailscale IP ⇒ blocked by the browser's secure-context rule). Renders a warning banner when bound on all interfaces over plain HTTP. Seeded into the `default` (Everything) and `ops` built-in dashboard layouts so the security posture is visible product UX, not a docs-only invariant. Backed by `GET /api/network-exposure/status`.
diff --git a/server/lib/tuiHandshake.test.js b/server/lib/tuiHandshake.test.js
index d1b4574233..bb40f93e55 100644
--- a/server/lib/tuiHandshake.test.js
+++ b/server/lib/tuiHandshake.test.js
@@ -155,6 +155,7 @@ describe('tuiHandshake.buildTuiInvocation', () => {
{ form: '--model X', bakedArgs: ['--model', 'baked-in'] },
{ form: '--model=X', bakedArgs: ['--model=baked-in'] },
{ form: '-m X', bakedArgs: ['-m', 'baked-in'] },
+ { form: '-m=X', bakedArgs: ['-m=baked-in'] },
])('does NOT append --model when provider.args pins one ($form form)', ({ bakedArgs }) => {
const provider = { id: 'claude', args: ['-p', '-', ...bakedArgs] };
const out = buildTuiInvocation(provider, 'caller-model');