mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1520] [Issue]: Malformed encounter action output silently advances combat #767
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#767
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 @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1520
Originally assigned to: @Romuromylus on GitHub.
During the Roleplay A13 native encounter audit on
origin/refactorcommit229e7d89, malformed combat action model output was treated as a successful combat turn instead of surfacing a recoverable error.Related smoke umbrella: #1486.
Repro
combatagent enabled and a deterministic local OpenAI-compatible test connection, clickEncounter.Begin Combat.Expected
Malformed combat action output should be understandable and recoverable. The encounter should not fake a successful turn without telling the user that the model output was invalid. A reasonable result would be an inline combat error with retry/close options and unchanged combat state.
Actual
The invalid action response did not surface an error. The encounter silently used deterministic fallback action resolution, advanced combat state, and in the A13 repro ended the encounter as
victory.Because the fallback path treated the turn as successful, the combat summary path then wrote back to chat. In the deterministic repro the visible chat got an assistant summary row after the malformed action path, even though the action model output was invalid.
Evidence
Native A13 probe:
A13 Training Dummy, party HP, enemy HP, and custom action controlsA13_MALFORMED_NON_JSON_RESPONSEVICTORYCode path:
completeJsonObject(...)catches/returnsnullfor failed parse/LLM errorsresolveRoleplayEncounterAction(...)passes that throughsanitizeCombatActionResult(...)sanitizeCombatActionResult(...)usesfallbackActionResult(...)useEncounter.sendAction(...)receives a valid-looking object and therefore does not render itsAI returned an invalid response. Try again.error pathLikely Owner
src/engine/modes/roleplay/encounter/encounter-service.tsandsrc/features/modes/roleplay/encounter/hooks/use-encounter.ts.The service likely needs to distinguish "sanitized malformed fields from a valid response" from "no valid response at all", so the UI can show a retryable combat error without silently inventing a successful turn.
@Romuromylus commented on GitHub (May 30, 2026):
Fixed by #1641, merged into
refactor.