Repository navigation
docs: diagnose silent TUI exit after sending a message - #880
Merged
Merged
Conversation
Root-cause write-up for the no-output crash report: - Part (b): the TUI only prints a failure when exit.reason is set (app.tsx:402-404); a renderer destroy without a reason resolves the shutdown deferred with Effect.void (app.tsx:277) and cli/cmd/tui.ts ends in an unconditional process.exit(0) - silent exit, code 0. - opentui's nativeSession.closed.catch funnels errors through handleError (console.error into the cache with openConsoleOnError:false) and then destroys the renderer itself; exit.consoleLogs is only captured inside stopOnError, so the real error is never dumped. - cliErrorMessage returns "" for some error types (util/error.ts), and "" ?? errorFormat(...) does not fall through - stderr gets just a newline. - Worker-crash logs default to a console.error snapshot written into the active alternate screen and are discarded on restore; onExit's exitCode=1 is overwritten by the trailing process.exit(0). - Part (a): repro matrix (layouts, widths, tool calls, scroll, worker SIGSEGV restart, repo config) did not crash; evidence narrows the trigger to the silent failure classes above. Includes capture recipe (OPENCODE_PRINT_LOGS, OTUI_DUMP_CAPTURES) and recommended fixes. Co-authored-by: arena-agent <[email protected]>
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous Review Summary (commit 297b629)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 297b629)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by free · Input: 72.1K · Output: 2.6K · Cached: 166.6K |
mdev34-lab
commented
Nov 30, 2026
mdev34-lab
left a comment
Owner
Author
There was a problem hiding this comment.
Review findings: the investigation is useful and the documented shutdown path is supported by the current source. I found two issues in the recommended fixes that should be corrected before treating this write-up as implementation guidance. GitHub does not allow a REQUEST_CHANGES review on the PR author’s own pull request, so I am leaving these as review comments.
- Fix 1: do not synthesize a crash reason for every reason-less destroy. SIGHUP and reason-less ExitProvider exits legitimately destroy the renderer without a reason; capture console cache on any destroy, but gate the synthesized reason on an explicit exit.intentional flag so normal exits do not print a false 'renderer destroyed unexpectedly'. - Fix 3: a direct process.stderr.write callback does not help - writes still land inside the active alternate screen and are discarded on restore, and the default logger already writes directly to stderr. Buffer worker log messages instead and flush after run() completes (renderer destroyed, terminal restored). - Part (a): rank the silent failure classes explicitly as candidates, not a confirmed root cause - the original failure was not reproduced. Co-authored-by: arena-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Diagnostic follow-up to the report of Silvercode exiting after a message is sent without terminal output. No issue number was provided.
Type of change
What does this PR do?
Adds
silent-crash-diagnosis.md, documenting the investigation into the silent TUI exit.The write-up identifies the renderer shutdown path, opentui's cached error handling, empty error messages, and worker-crash logging as concrete diagnostic gaps. The original crash trigger could not be reproduced, so the document distinguishes confirmed behavior from the likely native-session failure and includes a capture recipe for the next occurrence.
No runtime code is changed.
How did you verify your code works?
This is a documentation-only change. The investigation included a PTY reproduction matrix, the
packages/tuitest suite (953 tests), andbun typecheck; all reported green. The crash itself was not reproduced. Details and limitations are recorded in the added document.Screenshots / recordings
Not applicable; this PR changes documentation only.
Checklist