mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2681] [MERGED] fix(agents): await tool-loop result so a tool failure can't corrupt co-grouped agents #5716
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#5716
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/2681
Author: @kolacheee
Created: 6/20/2026
Status: ✅ Merged
Merged: 6/21/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/issue-2680-agent-tool-rethrow-group📝 Commits (1)
1ac51f2fix(agents): await tool-loop result so a tool failure can't corrupt co-grouped agents (#2680)📊 Changes
1 file changed (+6 additions, -2 deletions)
View changed files
📝
packages/server/src/services/agents/agent-executor.ts(+6 -2)📄 Description
Linked issue
Closes #2680
Why this change
A tool-using agent whose tool call throws should fail only itself — but today it corrupts every other agent that shares its provider+model job group:
executeAgentreturned the tool path withreturn executeAgentWithTools(...)and noawait(agent-executor.ts). Without theawait, a rethrow from the tool loop (executeToolCallthrowing →throw err) escaped this function's owntry/catch— the catch that would have produced a failedAgentResultviamakeError— and surfaced as a rejected promise.agent-pipeline.ts,executeGroupjoins batch + tool agents for the same provider+model group withPromise.all([...]). One tool agent's rejection rejected thatPromise.all, rejecting the whole group.executePhasethen caught the rejected group viaPromise.allSettledand overwrote every agent in the group — including co-grouped batch agents (e.g.tracker,expression) and sibling tool agents that already succeeded — withsuccess: falseerror results, discarding their real output.This is reachable with a realistic config: a custom tool-using agent sharing the default-for-agents connection with the built-in batch agents.
What changed
awaitto the tool-loop call inexecuteAgent(return await executeAgentWithTools(...)), so a rethrow is caught by the function's existingcatchand converted into a failedAgentResultfor only the failing agent — restoring per-agent isolation.awaitisn't "optimized away" by a future reader.Minimal, behavior-preserving for the success path: the no-tools path already returned a failed
AgentResulton error, and this makes the tool path do the same.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm check(TypeScript + ESLint + build) passed in the automated run that produced this change. A human should still confirm:tracker,expression). Force its tool call to throw (e.g. a tool whoseexecuteToolCallraises). Confirm that only the failing tool agent is reportedsuccess: false, and the co-grouped batch agents keep their real output (no[agent-pipeline] Group REJECTEDlog for the whole group).Docs and release impact
UI evidence (if applicable)
n/a — server-side agent pipeline change, no UI surface.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.