mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
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>