#15518: tui: recover local no-output runs via history fallback
stale
Cluster:
TUI and Tool Execution Fixes
#### Summary
Fixes a TUI reliability bug where local runs can finalize as `(no output)` even though assistant text is persisted shortly after.
Code word: lobster-biscuit
#### Repro Steps
Related reports:
- https://github.com/openclaw/openclaw/issues/4499
- https://github.com/openclaw/openclaw/issues/15432
1. Start `openclaw tui` with a provider/model that intermittently emits empty `chat.final` payload text.
2. Trigger a run that finishes with `(no output)` in TUI.
3. Reopen/reconnect TUI and observe assistant text appears from history.
#### Root Cause
`chat.final` can occasionally arrive without renderable assistant text while transcript persistence catches up moments later. TUI currently finalizes immediately and never retries history for local runs, so users see `(no output)` until reconnect.
#### Behavior Changes
- For **local runs only**, if final text resolves to `(no output)` and stopReason is not `error`, schedule two short history refresh retries (200ms, 1000ms).
- Keep existing behavior unchanged for non-local runs and for runs with valid final output.
- Centralize no-output placeholder handling in formatter helpers.
#### Codebase and GitHub Search
- Code paths searched:
- `src/tui/tui-event-handlers.ts`
- `src/tui/tui-stream-assembler.ts`
- `src/tui/tui-formatters.ts`
- Issue search checked:
- #4499 (`MiniMax responses show '(no output)' until TUI restart`)
- #15432 (`[Bug]: no output`)
#### Tests
- `pnpm vitest src/tui/tui-event-handlers.test.ts src/tui/tui-formatters.test.ts --run`
- `pnpm check`
#### Manual Testing
### Prerequisites
- A TUI session connected to gateway.
### Steps
1. Run a local TUI conversation where a final event may be empty.
2. Confirm TUI schedules short history fallback and self-recovers without restart.
3. Confirm normal final outputs still render once with no extra history churn.
#### Evidence
- Added targeted test: local final `(no output)` triggers 2 history retries in `src/tui/tui-event-handlers.test.ts`.
**Sign-Off**
- Models used: GPT-5 Codex
- Submitter effort (self-reported): High
- Agent notes (optional, cite evidence): Local targeted tests + lint/type checks passed.
Most Similar PRs
#18942: fix(tui): trigger render after finalizing chat assistant message
by BinHPdev · 2026-02-17
73.0%
#6502: fix(tui): skip empty text for tool-only assistant turns
by douvy · 2026-02-01
70.8%
#9220: Fix: TUI drops API responses silently when runID already finalized
by vishaltandale00 · 2026-02-05
70.7%
#12974: fix: intermittent (no output) reported by users
by vincentkoc · 2026-02-10
69.7%
#21932: fix(tui): eliminate stale model indicator lag in TUI
by graysurf · 2026-02-20
68.4%
#20516: fix(tui): preserve streamed text on finalize for pure text responses
by MisterGuy420 · 2026-02-19
67.5%
#4495: Fix: emit final assistant event when reply tags hide stream
by ukeate · 2026-01-30
66.8%
#17647: fix: Display error messages instead of (no output) for non-Claude m...
by MisterGuy420 · 2026-02-16
66.8%
#21791: feat(TUI): show main agent model in status footer
by chansuke · 2026-02-20
66.3%
#11109: fix(tui): prefer config contextTokens over persisted session value
by marezgui · 2026-02-07
66.3%