Repository navigation
Conversation
Two defects in the QA chat hook: - A second question overwrote the in-flight AbortController instead of cancelling it, so the old stream kept writing into the same state. - The error placeholder written into the message list was replayed to the model as assistant history on the next question. The new question now cancels the previous request, the superseded turn leaves the transcript instead of leaving a question without an answer, and conversationHistory holds only the turns the model actually answered. The request is also aborted on unmount, and the transcript is read from a mirror rather than a stale render closure. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #228.
Two defects in the QA chat hook (
apps/web/src/hooks/use-qa-chat.ts):AbortControllerinstead of cancelling it, so the old stream kept writing into the same state. The new question now cancels the previous request, the superseded turn stops writing, and every write is keyed to the request that owns the transcript.conversationHistorynow holds only the turns the model actually answered; a failed turn stays visible in the transcript but is not conversation.Also fixed in the same place: a cancelled turn left the user's question in the transcript with no answer, the request was not aborted on unmount, and the history was read from a stale render closure.
Tests:
apps/webQA chat hook suite — 9/9 passed. The three new tests (concurrent send cancels the previous request, the superseded turn leaves the transcript, the error placeholder is not replayed as history) fail on the previous implementation.apps/websuite — 1216 passed, 26 skipped, 0 failedgit diff --checkpassedcopilotkit-internal:cr-loopis unavailable; its findings (stale token writes, a superseded turn that could linger when the cancelled request never settles, and the unbounded unanswered-id set) are addressed.🤖 Generated with Claude Code