mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2415] [Issue]: 11-PROV-RUNTIME-stream-event-contract embedded stream errors bypass event contract #1184
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1184
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?
Originally created by @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2415
Originally assigned to: @Xelvanis on GitHub.
Summary
11-PROV-RUNTIME-stream-event-contracthas embedded-vs-remote drift: remote/api/llm/streamsends anerrorstream event on Rust failure, but embedded Tauri channel streaming rejects the command and the shared API throws instead of yielding anerrorchunk.Expected behavior
Streaming should expose the same stable event contract across embedded Tauri and remote runtime:
start,token,thinking,usage,tool_call,error, anddone. Provider/Rust failures should surface through the documented stream event contract before the stream terminates.Actual behavior
The refactor declares
erroras part ofLlmChunk, and remote runtime emitstype: "error"SSE onllm_stream_eventsfailure. Embedded Tauri usesllm_stream_channel; if the native command rejects,src/shared/api/llm-api.tsstores the failure and throws from the async generator instead of yielding anerrorevent.Steps to reproduce
llm_stream_eventsto return anAppError.llmApi.stream(...)./api/llm/streamfor the same Rust failure path.Impact area
Environment
Logs, screenshots, or video
Static proof:
error:src/engine/capabilities/llm.ts:31src/shared/api/llm-api.ts:121src-tauri/src/commands/storage/llm.rs:171type: "error"when Rust streaming returns an error:src-tauri/src/http_server.rs:1216errorevents from/api/generate:packages/server/src/routes/generate.routes.ts:11143onmainpackages/server/src/routes/generate/sse.ts:14onmainRegression notes
Legacy
/api/generateused SSEerrorevents for generation failures. The refactor contract still includeserror, but embedded Tauri does not preserve the same stream-event envelope for native command failures.Source surface: #2410,
11-PROV-RUNTIME-stream-event-contract.Additional context
Acceptance criteria:
AbortErrorfor cancellation keep working.11-PROV-RUNTIME-stream-event-contractvisible in the fix notes.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: