Four ds-review-bot findings: - examples/tui-agent composed dsh-mode without the now-required modes.plan.section, so the TUI leaf failed at Loader startup (the keyless smoke only asserts the banner and missed it); graft the same deployment plan instructions the ACP leaf carries. - The prompt-submit and turn-continuation flushes ran before next(), so a session/set_mode arriving while a downstream async listener (the shipped hooks listeners' shape) awaited applied one request late; both listeners now prepend and flush after next(), matching the request-error wrapper, with a regression test pinning the ordering. - An HMR unload during the exit_plan_mode review let a later approval write into the disposed service and claim an exit whose flush could never land; the execute path now checks the fiber lifetime after the await and fails the call (the mode stays plan; the model re-presents). - resolveConfig accepted empty/untrimmed mode names that list()/ACP then advertised while the package invariant rejected their selection, desynchronizing the picker; names are validated non-empty and trimmed at load, the same shape the invariant enforces.
tui-agent
The full-screen interactive coding agent: DeepSeek V4, local bash and filesystem tools, compaction, subagents, workflows and fresh-agent Ralph iteration, todo_write, session modes (/mode, plan mode with the reviewed exit), timeout/spill policy, and @deepseek-ai/dsh-tui-demo.
Run it
pnpm run demo:tui
The command needs DEEPSEEK_API_KEY in the environment or gitignored repository-root .env. Set RESUME_SESSION_ID to reopen a persisted conversation under ./.sessions.
The TUI renders Markdown history, reasoning, tool-owned terminal/diff/generic cards, token totals, and the latest todo list. Long tool bodies keep a head/tail preview; Ctrl+O expands or collapses every card. Enter submits or steers while the agent runs, Ctrl+R toggles reasoning, Escape cancels, and /help lists commands. /model opens a keyboard selector for the current provider catalog; use Up/Down and Enter, or /model <model> and /model <provider>/<model> for direct selection. ask_user_question opens a wide bottom-left keyboard panel with batch progress and numbered options.
Run pnpm run demo:code-mode tui for the Code Mode overlay.
Composition
cordis.yml owns the interactive coding composition directly. code-mode.cordis.yml includes that leaf and replaces the tool presentation mode while adding the code runtime. Non-interactive automation uses the sibling headless-agent composition.
Snapshot tests
tests/snapshots/<scenario>/session.jsonl supplies recorded user prompts and model chunks; sibling child logs drive subagents and workflows. The keyless suite executes those scripts through the real loop and tools, then compares readable terminal cell/style output. Use pnpm run test:snapshot:refresh for presentation-only changes and pnpm run test:snapshot:record with a DeepSeek key when a recorded model journey changes. The implemented TUI snapshot Agent Note owns the scenario matrix.