mirror of
https://github.com/crabwise-ai/crabwalk.git
synced 2026-08-14 00:57:52 +00:00
Merge pull request #8 from yeHHH1g/fix/streaming-content-replace
fix: replace streaming content instead of appending
This commit is contained in:
@@ -67,10 +67,10 @@ export function addAction(action: MonitorAction) {
|
||||
const streamingId = `${action.runId}-stream`
|
||||
const existing = actionsCollection.state.get(streamingId)
|
||||
if (existing) {
|
||||
// Append content and update sessionKey if we learned it
|
||||
// Replace content (gateway sends cumulative text, not incremental deltas)
|
||||
actionsCollection.update(streamingId, (draft) => {
|
||||
if (action.content) {
|
||||
draft.content = (draft.content || '') + action.content
|
||||
draft.content = action.content
|
||||
}
|
||||
draft.seq = action.seq
|
||||
draft.timestamp = action.timestamp
|
||||
|
||||
@@ -60,6 +60,7 @@ export interface PresenceEntry {
|
||||
}
|
||||
|
||||
// Chat events
|
||||
// Note: gateway sends cumulative message content with each delta, not incremental chars
|
||||
export interface ChatEvent {
|
||||
runId: string
|
||||
sessionKey: string
|
||||
|
||||
Reference in New Issue
Block a user