[P0] Stream events carry no session_id → cross-conversation token bleed #32
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_shrimp#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The engine emits
llm:delta(and other stream events) without asession_id/job_idin the payload, so the SSE bus forwards them to every subscriber. The web UI therefore routes tokens by a single global heuristic (currentStreamingId/jobStreamJobId). With two conversations/jobs active, one job's tokens can land in another conversation's message.Evidence
crates/hero_shrimp_runtime/src/llm/completion/mod.rs—emit_scoped("llm:delta", {stream_id, kind, text, model, alias, phase})— no session_id.crates/hero_shrimp_web/ui/src/store.ts— SSE handler routes by globalcurrentStreamingId/jobStreamJobId; comments already call this a "best-effort bandaid".Proposed fix (root)
Stamp every stream event with
session_id(+artifact_job_idfor jobs) at emit time, and have the UI subscribe/route per conversation. This is the single change that removes most of the streaming whack-a-mole.Related: #29, #31.
Filed from a comparative audit of Hero Shrimp vs Qwen-Code / kimi-cli / picoclaw (2026-05-23). Severity in title: P0=correctness/trust, P1=reliability/UX, P2=cleanup.