fix(tui): stop a stream outlived by /new from leaking into the next conversation #13

Merged
enderofwings merged 6 commits from fix/tui-history-leak into main 2026-08-26 19:04:59 +00:00
6 Commits
Author SHA1 Message Date
Jon Wingender 35f7461ca4 fix(tui): stop a stream outlived by /new from leaking into the next conversation
package / wheel (pull_request) Waiting to run
_finish_stream appended the completed reply to self.history - whatever
list that name currently pointed at - not to the conversation the
stream was actually answering. /new reassigns self.history to a fresh
list; a stream still running when that happens finished by silently
appending the old conversation's trailing reply onto the new one, which
then rides along in that new conversation's next /chat/stream history
payload. The conversation_id was already captured by closure for this
exact reason (see the tool-denial path); self.history needed the same
treatment.
2026-08-26 14:01:19 -05:00
Athena Kaminsky 9ed2908170 fix(tui): prioritize interrupt and quit keys
package / wheel (pull_request) Waiting to run
Declare Ctrl+C and Ctrl+D as priority Textual bindings so the focused prompt cannot consume them. Drive exit and silent-stream cancellation regressions through Pilot key events instead of calling action handlers directly.
2026-08-26 08:17:31 -05:00
Athena Kaminsky 9ca37057eb fix(tui): cancel silent streams promptly
Move chat streaming onto a cancellable async task so Ctrl+C interrupts a pending socket read on macOS instead of waiting for the 120-second read timeout. Add a headless silent-stream regression that verifies prompt recovery and a successful next message.
2026-08-26 08:17:31 -05:00
Athena Kaminsky da3509eb04 fix(tui): retain stream conversation for tool denial
Capture each stream's conversation ID before starting its worker so /new cannot redirect a later action denial. Add a headless regression that mutates the active conversation while a tool request is in flight.
2026-08-26 08:17:31 -05:00
Athena Kaminsky 6f5094b5fc fix(tui): preserve errors and deny gated tools safely
Keep stream failures in the persistent transcript instead of clearing them with the live preview. Use each tool request's capability token to deny actions immediately until the TUI has an interactive approval flow, and cover both behaviors with focused regressions.
2026-08-26 08:17:31 -05:00
Athena Kaminsky 1449280fcd feat(cli): add interactive TUI chat
Add a Textual chat interface with threaded SSE streaming, slash commands, interrupt handling, and bare nexus dispatch. Package it behind the tui extra, document usage, and cover command routing, dependencies, and headless interaction with tests.
2026-08-26 08:17:31 -05:00