Skip to content

Research plan for streaming custom data alongside AI responses#9

Draft
Copilot wants to merge 1 commit intoupgrade-ai-sdk-v6from
copilot/sub-pr-6
Draft

Research plan for streaming custom data alongside AI responses#9
Copilot wants to merge 1 commit intoupgrade-ai-sdk-v6from
copilot/sub-pr-6

Conversation

Copy link

Copilot AI commented Jan 18, 2026

User requested a plan with multiple approaches to add an ability for additional data to be streamed alongside streaming responses, similar to AI SDK's streaming custom data feature.

Created comprehensive technical analysis with four distinct approaches:

Approach 1: Extended Delta Format (Recommended)

  • Extend existing StreamDelta to include optional data field for arbitrary JSON
  • Reuses current delta infrastructure (throttling, compression, subscriptions)
  • Minimal changes, no breaking API updates

Approach 2: Parallel Metadata Stream

  • Separate streamMetadata table running parallel to streamDeltas
  • Independent cursor/subscription mechanism
  • Complete separation of concerns, different streaming rates possible

Approach 3: Callback-Based Side Channel

  • Add onStreamData callback to streamText/generateText options
  • Developer-controlled timing and content
  • Writes to separate table/structure

Approach 4: Enhanced onStepFinish with Data Attachment

  • Extend existing onStepFinish to return custom data
  • Auto-attached to step/message metadata
  • Natural extension of current patterns

Recommendation: Approach 1 as primary (best fit with existing architecture, proven infrastructure, simple API) with Approach 4 as complementary for step-level metadata.

Implementation sketch:

// In DeltaStreamer
await streamer.addParts(parts, { 
  customData: { progress: 0.5, currentTool: "search" } 
});

// Extended delta format
interface StreamDelta {
  streamId: string;
  start: number;
  end: number;
  parts: T[];
  data?: Record<string, JSONValue>; // New
}

No code changes made - this PR documents the research and recommendation for review before implementation.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Author

Copilot AI commented Jan 18, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ai-sdk.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update createTool to support AI SDK v5 and v6 features Research plan for streaming custom data alongside AI responses Jan 18, 2026
Copilot AI requested a review from zboyles January 18, 2026 02:47
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 18, 2026

Open in StackBlitz

npm i https://pkg.pr.new/zboyles/agent/@convex-dev/agent@9

commit: 502d9d8

Base automatically changed from zboyles/ai-sdk-v6/add-tool-approval to upgrade-ai-sdk-v6 January 19, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants