Skip to content

Release v0.0.193 — REPL UX, Codex WebSocket transport, markdown tables - #141

Merged
justrach merged 6 commits into
mainfrom
release/v0.0.193
Jul 10, 2026
Merged

Release v0.0.193 — REPL UX, Codex WebSocket transport, markdown tables#141
justrach merged 6 commits into
mainfrom
release/v0.0.193

Conversation

@justrach

@justrach justrach commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Release v0.0.193 — REPL UX hardening, the Codex WebSocket transport, and markdown tables.

Highlights

  • REPL/TUI UX: colored prompt-mode badges, model/settings pickers that resize to the terminal and preselect the current value, and a single command_catalog.zig powering /help, the bare / menu, and tab completion so they never drift. /key <provider> <secret> is masked and kept out of live + persisted history. /models health reports active/saved model, context/compaction limits, credential source (never value), Codex catalog source/count, WebSocket→SSE status, and fallback policy. Prompt context line is unambiguous (used/full ctx (% · compact@limit)).
  • Codex WebSocket transport: root Codex Responses turns run over wss://…/codex/responses with automatic SSE fallback on any handshake failure (GRAFF_CODEX_WS=off forces SSE). Verified live end-to-end on gpt-5.5 and gpt-5.6 (sol/terra/luna)101 Switching Protocols, streamed events, clean reply.
  • Model catalog & fallback: dynamic Codex model discovery + graff models [refresh]; cross-provider fallback is opt-in per workspace via /fallback; unknown remote model names are rejected before switching or changing the saved default.
  • Markdown pipe tables in the REPL TUI + GUI chat (merges feat: markdown pipe tables in the repl TUI and GUI chat #127): box-drawing tables with wrapped cells, a narrow-terminal record fallback, and \| escape handling.

Fixes in this PR

  • fix(repl): restore missing command_catalog.zig — the handoff commit added the import + usages but never staged the file, breaking zig build on every platform (zig + windows CI were red). Reconstructed with a catalog-integrity test.

Validation

zig build · zig build test 150/150 · zig build repl-test 15/15 (incl. table + escaped-pipe tests) · test-pty-repl / test-json-controls / test-pty-markdown / test-model-preference / test-pty-spinner all pass. CI green on zig + windows + sdk.

Follow-ups (non-blocking)

🤖 Generated with Claude Code

justrach and others added 6 commits July 8, 2026 21:02
TUI (first, per harness-first rule): renderMarkdown in repl.zig now
detects | pipe tables and draws them with box-drawing characters,
wrapping cell text to fit the terminal width (width_hint cached from
the last rendered frame; 0 assumes 100 cols).

GUI: table rendering extracted from MarkdownRenderer into a dedicated
ChatTable component (alignment, header styling unchanged) with tests.

Co-Authored-By: blackfloofie <265516171+blackfloofie@users.noreply.github.com>
…WebSocket/SSE/fallback, context limits, pickers, spinner, narrow-terminal, model preference, fallback PTY tests
Commit 413536a added the imports and usages of `command_catalog` across
main.zig, commands_misc.zig, and pickers.zig but never staged the file
itself, so `zig build` failed everywhere with
`unable to load 'command_catalog.zig': FileNotFound` — the zig + windows
CI jobs on PR #141 (and any local build) were red.

Reconstruct the module from its three consumers and the pre-refactor
/help text:
- Item { name, desc = "", usage = "" } — matches every PickItem literal
  (file/reasoning/login/ultracode pickers) and the /help renderer, which
  reads .usage.
- commands[]: the canonical menu/help list; `name` is the runnable "/foo"
  (the bare "/" menu passes it straight to handleCommand), `usage` the
  fuller form shown only in /help, `desc` the one-liner.
- names: derived from commands so tab completion never drifts from the
  menu. Re-exported as main.repl_commands.
- catalog-integrity unit test (restores the suite to 150/150).

Validation: zig build; zig build test (150/150); test-pty-repl.py,
test-json-controls.py (19/19), test-pty-markdown.py,
test-model-preference.py, test-pty-spinner.py all pass; diff --check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Brings the pipe-table renderer into release/v0.0.193. GUI files
(ChatTable.tsx/.test.tsx, MarkdownRenderer.tsx) merged clean; only
src/repl.zig conflicted because v0.0.193 had extracted repl.zig into
sibling modules (repl_model_turn/render, repl_run, repl_util) after this
branch was cut.

Conflict resolution + adaptations:
- src/repl.zig: kept v0.0.193's extraction aliases (startJob/finishJob/
  drainSteer/setGoal, spinnerFrame/statusLine/render, run/runScripted/
  main) and layered in the PR's new table helpers (isTableRow/isTableSep/
  plainInline/dispWidth/wrapCell/tableRule/renderRecords/renderTable);
  dropped the PR's stale pre-refactor copies of renderInline/run/
  runScripted/main/etc. that now live in the sibling files.
- renderMarkdown kept `pub` + gained the `width_hint` arg; repl_model_turn
  finishJob now passes self.last_term_width; repl_model_render render()
  caches self.last_term_width = term_width each frame (else the width
  feature silently no-ops). Test's bare stripControl -> util.stripControl.
- Quick-fix: the TUI cell splitter now honors escaped `\|` as a literal
  pipe (parity with the GUI parser), covered by a new unit test.

Known follow-ups (non-blocking, tracked separately): TUI dispWidth counts
codepoints not display width (CJK/emoji border misalignment); TUI ignores
column alignment (:--:) that the GUI honors.

Validation: zig build; zig build test 150/150; zig build repl-test 15/15
(incl. 4 PR table tests + the new escape test); test-pty-repl/json-controls/
markdown all pass. GUI bun tests not run (node_modules not installed;
files merged clean and were reviewed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@justrach justrach changed the title WIP: prepare v0.0.193 REPL UX handoff Release v0.0.193 — REPL UX, Codex WebSocket transport, markdown tables Jul 10, 2026
@justrach
justrach marked this pull request as ready for review July 10, 2026 14:57
@justrach
justrach merged commit 4456bb2 into main Jul 10, 2026
6 checks passed
@justrach
justrach deleted the release/v0.0.193 branch August 4, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants