mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1645] [MERGED] Surface connected command failures instead of swallowing them #5178
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#5178
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/1645
Author: @Romuromylus
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/connected-command-errors📝 Commits (2)
0c243bcSurface connected command failures instead of swallowing themaa6303eFormat connected-command files to repository Prettier style📊 Changes
4 files changed (+110 additions, -17 deletions)
View changed files
📝
src/engine/generation/connected-commands.test.ts(+71 -0)📝
src/engine/generation/connected-commands.ts(+32 -17)📝
src/engine/generation/generation-events.ts(+1 -0)📝
src/features/runtime/generation/hooks/use-generate.ts(+6 -0)📄 Description
Why this change
persistConnectedCommandTagswrappedexecuteCommandin a blanket.catch(() => null), andparseCharacterCommandsstrips command tags from the visible content unconditionally (regardless of whether the command ran). So when a connected command threw, the failure collapsed tonull, emitted no event, and left the user with a clean message and no error or retry. Two integration commands (haptic,spotify) also returned a silentnullwhen their integration was absent, while their tag was still stripped from the content.What changed
Mirror the existing
selfie_errorevent end to end, for commands:generation-events.ts/connected-commands.ts: add acommand_errorvariant to both theGenerationEventandConnectedCommandEventunions, plus aneventsPushCommandErrorhelper (sibling ofeventsPushSelfieError).connected-commands.ts: replace the blanket.catch(() => null)aroundexecuteCommandwith atry/catchthat emitscommand_errorand lets generation continue (no rethrow); emitcommand_erroron thehaptic/spotifyintegration-absent branches.use-generate.ts: consumecommand_errorwith a toast, exactly likeselfie_error.The fix is mode-neutral — no mode flag is added to the shared helper (per
marinara-mode-separation); roleplay/game modes that route through the same helper now get the same visible error instead of a silent strip.Verification
pnpm exec tsc -bclean;pnpm check:architectureclean (events ride the existing pass-through; no new caller wiring, no React/Tauri import added to engine).connected-commands.test.tscases: a throwing command emitscommand_error(tag still stripped), the loop continues after a failure, an unsupportedhapticwithout integrations surfaces an error, and the happy path emits no error. Fullsrc/engine/generationsuite (193 tests) green.Risk / note
The toast consumer is untested, consistent with the existing untested
selfie_error/illustration_errorsiblings (covered by tsc + the structural mirror). A message with many failing command tags fires one toast per failure (per-command granularity, matches the existing design); aggregation is out of scope. Raw error text surfaces in the toast, parity withselfie_error.Linked issue
Closes #1535.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.