mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5542] [MERGED] Sidecar as the agents default connection plus bulk assignment #6807
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#6807
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/5542
Author: @kolacheee
Created: 8/25/2026
Status: ✅ Merged
Merged: 8/25/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/5539-sidecar-agents-default📝 Commits (2)
ad0ce07feat(agents): sidecar as the agents default connection plus bulk assignment89244bbstyle: collapse two wrapped lines Prettier wants on one line📊 Changes
13 files changed (+264 additions, -12 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
packages/client/src/components/agents/AgentEditor.tsx(+12 -3)📝
packages/client/src/components/panels/AgentsPanel.tsx(+101 -0)📝
packages/client/src/components/panels/ConnectionsPanel.tsx(+36 -4)📝
packages/client/src/hooks/use-agents.ts(+13 -0)📝
packages/client/src/localization/locales/en.json(+6 -0)📝
packages/client/src/stores/sidecar.store.ts(+1 -0)📝
packages/server/src/routes/generate/retry-agents-route.ts(+10 -2)📝
packages/server/src/routes/sidecar.routes.ts(+1 -0)📝
packages/server/src/services/generation/agent-resolution.ts(+29 -2)📝
packages/server/src/services/sidecar/sidecar-model.service.ts(+1 -0)📝
packages/shared/src/types/sidecar.ts(+5 -0)📝
scripts/regressions/agent-runtime.regression.ts(+45 -1)📄 Description
Linked issue
Closes #5539
Why this change
The built-in Local Model could only power agents through a per-agent connection override. Two structural gaps forced the hand-edit-every-agent round trip described in the issue: the sidecar is a client-fabricated pseudo-connection with no stored connection row, so the defaults section's
defaultForAgentsrow flag could not express it; and the only bulk control ("Use local model for all tracker agents") covers tracker-category agents only.What changed
The agents-default status lives in the sidecar config (
useAsAgentsDefault, defaultfalse; old saved configs pick it up via the defaults merge on load). Server resolution — both the generation pipeline and the retry route, which duplicates the logic — substitutes the sidecar sentinel for the row default through one exported helper,resolveAgentsDefaultConnectionId.The helper substitutes only while the sidecar is actually available. That guard is load-bearing: the existing
skip-local-sidecartrap only inspects the requested id, so feeding the sentinel into the default slot while the model is missing would flow through untrapped into a misleading "connection was deleted" warning. Degrading to the row default (then chat connection) is also the right semantics — a default is a preference, unlike an explicit per-agent selection, which deliberately skips the agent rather than silently running it on another backend.The sentinel default also never matches
defaultAgentConn.id, so the "agents billing a paid API" warning correctly stays silent for the local model.Connections panel, defaults section: the Agents picker now offers the Local Model (gated on the model being downloaded, or the flag already being set so a stale default stays visible and clearable; hidden in Lite builds). Selecting it writes the sidecar config and clears any row default; selecting a row or "use chat connection" clears the flag — one source of truth at a time. The other four pairs (Main/Images/Videos/Audio) are unchanged.
Agent editor: the "" option label now shows Agent default (Local Model (sidecar)) when the sidecar default is active, instead of claiming "Use chat connection".
Agents panel, bulk assignment: a connection select plus an Apply-to-all button under the Create/Import/Select row. Options mirror the per-agent picker (saved language connections + the sidecar pseudo-connection + "Agent default connection"). Applies with a confirm dialog, then PATCHes installed package agents by type (
/agents/type/:agentType, which creates missing config rows) and custom agents by id — sending only{ connectionId }, so agent settings are never clobbered (the wholesale-settings-rewrite hazard from the #5537 investigation). NewuseUpdateAgentByTypehook; new localization keys inen.jsononly, per the locale fallback convention.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated, from this branch:
pnpm lintandpnpm buildpass (clienttscruns in the build and is clean).node ./scripts/run-regressions.mjs --filter scripts/regressions/agent-runtime.regression.tspasses, including four new assertions onresolveAgentsDefaultConnectionId: sidecar wins over a row default while available; unavailable degrades to the row default; flag off keeps the row default; nothing set stays null (chat-connection inheritance).pnpm localization:checkpasses (audit clean, new keys inen.jsononly).format:checkfails pre-existing on CRLF Windows checkouts).Needs a human with the local model downloaded:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG entry under
[Unreleased] → Added. Nodocs/page documents connection defaults today, so no docs-i18n impact from this PR.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.