handleStreamingResponse and buildOnStreamComplete each generated their own streamDetailId for what should be one logical record — the placeholder row (0 tokens) and the final row (real usage) never shared an id, so the DB's ON CONFLICT(id) upsert never merged them, leaving a permanent 0-token stub for every streaming request. Share the id from buildOnStreamComplete with handleStreamingResponse so both writes hit the same row. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| .. | ||
| nonStreamingHandler.js | ||
| requestDetail.js | ||
| sseToJsonHandler.js | ||
| streamingHandler.js | ||