You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add streaming terminal chat with multiline input, cancellation, tool activity, and a plain-chat fallback. Fix renderer mode compatibility and document runtime and FFI requirements.
Summary
Describe the problem and the changes in this pull request.
Validation
npm run typecheck
npm run build
npm test
Checklist
Tests added or updated where behavior changed
Documentation updated where needed
No secrets or generated credentials are included
Changes are focused and backward-compatible, or breaking changes are documented
Make the OpenTUI stack optional and compile non-TUI features when it is absent. Match Node's last-flag-wins ordering across NODE_OPTIONS and CLI arguments, with regression coverage for both review findings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SIGHUP disconnect handler converts hangup into status-0 exit
api/core/library/cliChatUi.ts:137
This SIGHUP listener converts a hangup into a normal status-0 exit because disconnect only closes readline. Supervisors and shell scripts can therefore mistake a dropped terminal for success; set exit code 129 before closing, as the adjacent SIGTERM handler already preserves signal failure semantics.
SIGHUP cleanup exits successfully instead of reporting hangup
api/core/library/cliOpenTui.ts:236
Handling SIGHUP with close suppresses Node's default signal termination, so after cleanup this process exits successfully (status 0) instead of reporting the hangup (normally 129). This can cause shells and supervisors to treat a disconnected session as a successful completion; use a dedicated hangup handler that sets the appropriate nonzero exit code before restoring the terminal.
Run native UI test in required CI and release checks
package.json:48
This native UI test is not invoked by test, release, or .github/workflows/ci.yml, so the required PR and release checks can all pass without executing cliOpenTui.ts. Add a Bun/OpenTUI CI job (or otherwise include this script in required validation) so renderer, input, and terminal-lifecycle regressions block merging and publishing.
Match tool results by name and ID to prevent cross-tool updates
api/core/library/cliOpenTui.ts:309
When different concurrent tools reuse a runtime toolCallId, this branch ignores the result's tool name and updates whichever row with that ID was inserted first. The stream contract already permits this collision (tests/agent.acpServer.test.ts:1064), and out-of-order completion can therefore display one tool's success/failure on another tool. Include name in the match when it is available.
Finish the assistant segment before inserting orphaned tool results
api/core/library/cliOpenTui.ts:318
For an orphan tool-result (a supported stream shape covered in tests/agent.acpServer.test.ts:382), this adds a tool row but leaves the current Markdown renderable active. Any later text delta is appended to that earlier renderable, so it appears before the tool result instead of after it. Finish the current assistant segment before inserting the synthesized result row.
CI omits Node FFI and optional-dependency fallback checks
.github/workflows/ci.yml:34
This CI step only exercises the Bun OpenTUI path. The newly advertised Node.js --experimental-ffi path is never mounted in CI, and test:cli-optional is also not run, so regressions in either the Node renderer or the optional-dependency fallback can merge despite the dedicated checks. Please run both scripts here (the Node check can use NODE_OPTIONS=--experimental-ffi so the spawned SIGHUP child inherits FFI).
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
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.
Add streaming terminal chat with multiline input, cancellation, tool activity, and a plain-chat fallback. Fix renderer mode compatibility and document runtime and FFI requirements.
Summary
Describe the problem and the changes in this pull request.
Validation
npm run typechecknpm run buildnpm testChecklist