Changesets · Branches · Tags · Compare
| Changeset | 10459a948591a3b2b7f9d07d3f9b6d033531cafe044f327e5fb5a23bcdddb78c |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-08-28 19:01 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-08-28 19:01 -07:00 |
| Parents | 2993b729f81c |
1 file changed
modified extensions/cli/src/commands/serve.helpers.ts +6 −21
| @@ -31,28 +31,13 @@ | ||
| 31 | 31 | |
| 32 | 32 | // Create callbacks to capture tool events |
| 33 | 33 | const callbacks: StreamCallbacks = { |
| 34 | - onContent: (content: string) => { | |
| 35 | - if (!currentStreamingItem) { | |
| 36 | - currentStreamingItem = { | |
| 37 | - message: { role: "assistant", content: "" }, | |
| 38 | - contextItems: [], | |
| 39 | - }; | |
| 40 | - state.session.history.push(currentStreamingItem); | |
| 41 | - } | |
| 42 | - currentStreamingItem.message.content = | |
| 43 | - (currentStreamingItem.message.content as string) + content; | |
| 44 | - }, | |
| 34 | + onContent: (_: string) => {}, | |
| 45 | 35 | onContentComplete: (content: string) => { |
| 46 | - if (currentStreamingItem) { | |
| 47 | - currentStreamingItem.message.content = content; | |
| 48 | - currentStreamingItem = null; | |
| 49 | - } else { | |
| 50 | - // Add complete assistant message | |
| 51 | - state.session.history.push({ | |
| 52 | - message: { role: "assistant", content: content }, | |
| 53 | - contextItems: [], | |
| 54 | - }); | |
| 55 | - } | |
| 36 | + currentStreamingItem = { | |
| 37 | + message: { role: "assistant", content }, | |
| 38 | + contextItems: [], | |
| 39 | + }; | |
| 40 | + state.session.history.push(currentStreamingItem); | |
| 56 | 41 | }, |
| 57 | 42 | onToolStart: (toolName: string, toolArgs?: any) => { |
| 58 | 43 | // If there was streaming content, finalize it first |