mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2680] [Issue]: Tool agent's tool-call exception corrupts co-grouped agents (missing await in executeAgent) → siblings overwritten as failed #1327
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#1327
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 @kolacheee on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2680
Originally assigned to: @kolacheee on GitHub.
Summary
A tool-using agent whose tool call throws does not just fail itself — it corrupts the results of every other agent sharing its provider+model job group, overwriting their already-successful output with
success: falseerror results.Expected behavior
When a single tool agent's tool call throws, only that agent should be marked failed (a failed
AgentResultviamakeError). Co-grouped agents (e.g. the built-intracker/expressionbatch agents, or sibling tool agents) that ran successfully should keep their real output, and the main user turn should be unaffected.Actual behavior
A single tool agent's rethrow rejects the whole group, and every agent in that group — including co-grouped batch agents and sibling tool agents that already succeeded — is overwritten with a
success: falseerror result, discarding their real output.Root cause chain:
packages/server/src/services/agents/agent-executor.ts—executeAgentreturns the tool path withreturn executeAgentWithTools(...)and noawait(line ~305). Because there is noawait, the function's owntry/catch(catch at line ~420, which would have produced a failedAgentResultviamakeError) never runs for the tool path.executeAgentWithToolsrethrows (throw err, line ~525). With noawaitat the call site,executeAgentreturns a rejected promise instead of a failedAgentResult.packages/server/src/services/agents/agent-pipeline.ts—executeGroupjoins batch and tool agents for the same provider+model group withPromise.all([...])(line ~188), with the tool agents inside aPromise.all(lines ~179–186). One tool agent's rejection rejects thatPromise.all, rejecting the wholeexecuteGroup.executePhasecatches the rejected group viaPromise.allSettledand, at lines ~245–262, overwrites every agent in the group withsuccess: falseerror results — including co-grouped batch agents and sibling tool agents that already succeeded.Steps to reproduce
tracker,expression).executeToolCallraises).Environment
staging)Logs, screenshots, or video
In the server log you would see
[agent-pipeline] Group REJECTED in phase "..."followed by the group's whole agent list, even though only one tool agent actually failed.Additional context
Two fix options:
awaitatagent-executor.ts:305(return await executeAgentWithTools(...)) so the existing catch at ~420 converts the rethrow into a failedAgentResultfor only that agent. Minimal; preserves per-agent isolation.agent-executor.ts:525and instead return a failedAgentResultfor that agent.Option (a) is the minimal fix. A PR implementing it is being opened against
staging.Template check
@kolacheee commented on GitHub (Jun 20, 2026):
assign me pls
@kolacheee commented on GitHub (Jun 20, 2026):
Picking this up — draft PR opened against
staging: #2681 (owner: @kolacheee). Implements fix option (a): addawaitto the tool-loop call inexecuteAgentso a tool-call rethrow is caught locally and fails only that agent, instead of rejecting the group and overwriting co-grouped agents.Note: I don't have triage permission here to add the
in-prlabel — a maintainer may want to apply it.