mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5] [CLOSED] Fix unreachable case "error" branches by making streamEvents yield errors instead of throwing #4384
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#4384
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5
Author: @Copilot
Created: 3/9/2026
Status: ❌ Closed
Base:
release/1.2.0← Head:copilot/sub-pr-1-yet-again📝 Commits (2)
423f262Initial planc745a0aFix unreachable case "error" branches: change streamEvents to yield errors📊 Changes
2 files changed (+17 additions, -13 deletions)
View changed files
📝
packages/client/src/hooks/use-generate.ts(+15 -8)📝
packages/client/src/lib/api-client.ts(+2 -5)📄 Description
api.streamEvents()was throwing anApiErroron{ type: "error" }SSE events, making thecase "error"switch branches inuse-generate.tsdead code. Error handling was inconsistent: error events were exceptions while all other events were yielded.Changes
api-client.tsstreamEventsnow yields{ type: "error", data }like any other event, thenreturns — making it a terminal event rather than a thrown exceptionuse-generate.tsflushTypewriterBuffer()helper to eliminate duplicated flush logic acrosscase "error"and thecatchblockcase "error"ingenerateloop now reachable: callsflushTypewriterBuffer()+toast.error()case "error"inretryAgentsloop setshasError = trueto suppress thetoast.success("Agent retry completed")that would otherwise fire after an error-terminated streamcatchblocks remain as fallback for unexpected errors (network failures,AbortError)🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.