mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #212] [MERGED] Universal agent tool support #4507
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#4507
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/212
Author: @adunato
Created: 4/24/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @SpicyMarinara
Base:
main← Head:upstream-main📝 Commits (10+)
17f4939docs: init HLD and implementation plan for CR002 universal_agent_tool_supportd70a806feat: relocate and generalize agent tool resolutionf51226cfeat: add debug logging for agent tool calls and resultsdacd62afeat: improve agent-pipeline logging to show both batchable and tool-using agent names2bc2466fix: consolidate spotify tool context flow6248b4bfix: guard invalid custom tool schemas9f386f4fix: resolve spotify creds without active agent9277140fix: resolve agent tool defs independentlyb8daaa0fix: enforce agent tool allowlists2479ffcfix: filter main generation tool calls📊 Changes
5 files changed (+340 additions, -174 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+275 -160)📝
packages/server/src/services/agents/agent-executor.ts(+54 -1)📝
packages/server/src/services/agents/agent-pipeline.ts(+1 -1)📝
packages/server/src/services/tools/tool-executor.ts(+9 -12)📝
packages/shared/src/types/agent.ts(+1 -0)📄 Description
Closes #279
Resubmission of universal agent tool support #188 after clean up and addressing previous copilot feedback
CR002 Universal Agent Tool Support - Upstream PR Description
Why this change
Problem statement
The generation pipeline previously only attached function-calling support to the built-in Spotify agent. Other built-in and custom agents could have
enabledToolsconfigured, but they were still treated as text-only agents in the pipeline and executed asbatchable.This meant non-Spotify agents could not actually invoke tools during their turn, even when tool usage was configured for that agent.
Solution
This change generalizes agent tool support in
generate.routes.ts.When chat-level tools are enabled, the route now resolves tool definitions once, filters them per agent allowlist, and attaches
toolContextto any resolved agent with active tools. This preserves chat-level tool gating while enabling both built-in and custom agents to use tools correctly.What changed
Core changes
generate.routes.tstoolContextattachment for resolved agents with allowed toolsagent-pipeline.tsbatchableagents fromtool-usingagentsagent-executor.ts[agent-tools]diagnostics for tool invocation and completionDEBUG_AGENTS=trueValidation
pnpm checkManual verification notes
Custom-agent tool path:
roll_diceenabledtool-usinginstead ofbatchableroll_diceand received the JSON result for the follow-up model turnSpotify regression check:
spotify_get_playlist_tracks,spotify_play, andspotify_set_volumeLogging verification:
[agent-tools]tagDEBUG_AGENTS=true) includes redacted/truncated tool args and resultsBefore / after evidence
Before:
After:
Docs and release impact
UI evidence
Not applicable.
Additional notes
enabledToolsdetermines the subset of tools an agent may use once tools are enabled for the chat.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.