Fix/user message selection and stdin deadlock - #47
Closed
a1dake wants to merge 2 commits into
Closed
Conversation
The Formatted/Plain Text toggle only made Claude's replies selectable (bSelectionMode was gated with `!bIsUser`); user messages stayed a plain, non-selectable STextBlock. Give user messages the same formatted/selectable SWidgetSwitcher pattern already used by SMarkdownWidget, and drop the `!bIsUser` gate so the toggle applies to both sides of the conversation.
Multi-turn conversations froze after the first reply, showing "No output from Claude for Ns" with no tool calls ever reaching the Agent SDK. Root cause: ExecuteProcess() wrote the entire stdin payload (system prompt + conversation history) to the child's stdin pipe *before* starting to read its stdout. Windows anonymous pipes have a small fixed buffer (~4KB). Turn 1 has no history yet, so its payload fits in one write. From turn 2 on, the prompt carries the accumulated history and reliably exceeds the buffer: WritePipe blocks waiting for the child to drain stdin, while the child blocks writing its own early stdout (e.g. the "system" init NDJSON event) because nothing is reading it yet — a classic two-way pipe deadlock that only the silence watchdog ever notices. Fix: write stdin on a background thread (Async(EAsyncExecution::Thread)) so it runs concurrently with ReadProcessOutput(), letting both pipe directions drain in parallel instead of serially.
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.
No description provided.