mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1192] Silent agent failures: applyAgentResultEffects never surfaces failed agents to UI #589
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#589
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 @Romuromylus on GitHub (May 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1192
Originally assigned to: @Romuromylus on GitHub.
Symptom
When agent generations fail (any reason: 4xx from provider, timeout, malformed output), the failure is invisible in the UI. The user sees the existing empty-state panels ("No agent activity yet" / "No tracker data yet") with no error indication, no toast, no failed-agent badge.
Where the gap is
applyAgentResultEffectsinsrc/features/runtime/generation/hooks/use-generate.tsshort-circuits on!result.success:Meanwhile
agent.store.tsalready defines a surface for failed agents:failedAgentTypes: string[]failedAgentFailures: AgentFailure[](carrieserror+reasonLabel)setFailedAgentTypes/setFailedAgentFailuressettersclearFailedAgentTypesclearerAnd the UI already consumes them -
RoleplayHUDActionsMenuandChatSettingsDrawerboth render a failed-agent block with a retry button when these arrays are non-empty.The setters are defined and the UI is wired, but nothing in the per-turn hot path ever calls them. The only caller of
clearFailedAgentTypesis theretryAgentsflow. So failed agents from a normal generation never populate the store, and the failed-agent UI never lights up.Concrete repro (from #1188)
Provider returned HTTP 400 Bad Request: prompt is too long: ...That bug was hard to spot because the failure surface was invisible. The token-bloat fix in #1191 removes the trigger for that specific class, but the same silent-failure path exists for any future cause of agent failure.
Suggested fix shape
In
applyAgentResultEffects, afteraddResultand before the!result.successearly return, append to the failed-agent arrays so the UI lights up the existing failed-agent block.Considerations:
clearFailedAgentTypesat the start of each generation (inrunGenerationWithUi), to avoid stale failures persisting across turns.AgentFailureshape carrieserror+reasonLabel;reasonLabelwould ideally classify by provider-error class (prompt_too_long,rate_limited,auth,unknown) so the UI can hint at remediation without exposing raw provider strings.retryAgents, so no UI work needed beyond the store call.Not a regression - this gap has existed since the failure-arrays plumbing was added. Filing now so it does not drift after #1191 lands.