Fix/sdk UI#88
Open
ankushchhabradelta4infotech-ai wants to merge 13 commits intoYourGPT:feat/generative-ui-v2from
Open
Fix/sdk UI#88ankushchhabradelta4infotech-ai wants to merge 13 commits intoYourGPT:feat/generative-ui-v2from
ankushchhabradelta4infotech-ai wants to merge 13 commits intoYourGPT:feat/generative-ui-v2from
Conversation
…into fix/sdk-ui # Conflicts: # packages/copilot-sdk/src/chat/classes/AbstractChat.ts
# Conflicts: # pnpm-lock.yaml
…into fix/sdk-ui
…into fix/sdk-ui
…vior - 'multi-step' (default) — one bubble per server agent iteration (OpenAI/LiteLLM style), default unchanged - 'single-turn' — all iterations collapsed into one bubble per user turn (Vercel AI SDK / Claude.ai style) Usage: <CopilotProvider streamMode="single-turn" /> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AbstractChat: check toolResults.size in message:end so tool-only turns reset streamState and don't attach next turn's tools to previous message - AbstractChat: in single-turn mode parent insertChainParentId from message before the streaming message, not from streamState.messageId - AbstractChat: skip role:tool messages from done.messages in single-turn (already in streamState.toolResults, re-inserting creates duplicates) - connected-chat: restrict liveExecutions to last assistant message only; prefer metadata.toolExecutions for historical messages - connected-chat: filter unmatched executions to pending/executing only so stale completed cards don't bleed into new streaming message - connected-chat: null-safe message filter to prevent render crashes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@ankushchhabradelta4infotech-ai is attempting to deploy a commit to the Delta4 Infotech Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
Changes
// Before
if (!this.streamState.content) {
// After
if (!this.streamState.content && (this.streamState.toolResults?.size ?? 0) === 0) {
// Before
let insertChainParentId: string | undefined = this.streamState?.messageId;
// After
if (this.config.streamMode === "single-turn" && this.streamState) {
const allMsgs = this._allMessages();
const streamIdx = allMsgs.findIndex((m) => m.id === this.streamState!.messageId);
insertChainParentId = streamIdx > 0 ? allMsgs[streamIdx - 1].id : undefined;
} else {
insertChainParentId = this.streamState?.messageId;
}
if (this.config.streamMode === "single-turn" && msg.role === "tool") continue;
const isLastMsg = m.id === [...messages].reverse().find(msg => msg.role === "assistant")?.id;
if (!isLastMsg && savedMeta?.length > 0) {
messageToolExecutions = savedMeta;
} else {
const liveExecutions = isLastMsg ? toolExecutions.filter(...) : [];
...
}
// Before
(exec) => !allMatchedIds.has(exec.id)
// After
(exec) => !allMatchedIds.has(exec.id) &&
(exec.status === "executing" || exec.status === "pending" || exec.approvalStatus === "required")
// Before
.filter((m) => {
// After
.filter((m): m is NonNullable<typeof m> => {
if (!m) return false; |
Previously request.systemPrompt || this.config.systemPrompt meant a client-sent prompt could silently override the server-configured one, breaking generativeUISystemPrompt and any server-side prompt setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
Changesruntime.tsFix 1 — Server systemPrompt overridden by client request // Before — client wins
systemPrompt: request.systemPrompt || this.config.systemPrompt
// After — server config wins
systemPrompt: this.config.systemPrompt ?? request.systemPromptApplied in 3 places (lines 275, 1004, 1421). GenUIFrame.tsxFix 2 — Chart.js and iframe background ignoring app theme Changes:
|
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.
Description
Fixes stream handling bugs introduced by the generative-ui-v2 merge (
bc77df3). The newstreamMode: 'single-turn'config broke tool attachment, duplicate rendering, and stale execution card behavior.Changes
streamStateinmessage:end— caused next turn's tools to attach to previous messageinsertChainParentIdincorrectly parenting tool results under the current streaming message in single-turn moderole: "tool"fromdone.messagesin single-turn — already instreamState.toolResults, re-inserting created duplicatesliveExecutionsto last assistant message only — prevented current-turn tools appearing on old bubblespending/executingonly — stopped stale cards bleeding into new streaming messageType of Change
Testing
Checklist
Screenshots (if applicable)
N/A — stream behavior fixes, no visual diff to capture.