mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8595] [MERGED] fix(tools): saving a tool sends and checks only what changed; errors name the field #8691
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#8691
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/8595
Author: @SpicyMarinara
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/tool-editor-arrow-escape-8516📝 Commits (2)
c13bc1bfix(tools): saving a tool sends and checks only what changed; errors name the field (#8516)f62618cfix(mari-db): tool length limits apply only to values a change sets (#8516)📊 Changes
7 files changed (+271 additions, -51 deletions)
View changed files
📝
packages/client/src/components/agents/ToolEditor.tsx(+25 -19)📝
packages/client/src/lib/api-client.ts(+8 -3)📝
packages/client/src/lib/custom-tool-transfer.ts(+27 -0)📝
packages/server/src/services/mari-db/mari-db.service.ts(+18 -3)📝
scripts/regressions/custom-tool-import-security.regression.ts(+29 -0)📝
scripts/regressions/mari/db-execution-security.regression.ts(+59 -0)📝
scripts/regressions/persona-client-contract.regression.ts(+105 -26)📄 Description
Linked issue
Closes #8516
Why this change
->, any save, even a toggle, fails with "Tool name must be lowercase snake_case" although the name is valid.->,=>,&and quotes round-trips exactly, and a toggle-only save returns 200.details, which the client never read, so the editor showed a bare "Validation Error" and couldn't say which field failed.What changed
ToolEditor.tsx: an existing tool now saves only the fields that changed (buildCustomToolPatchinlib/custom-tool-transfer.ts), and only those are checked.lib/api-client.ts:formatFirstApiValidationIssuereads the error handler'sdetailsas well asissues. The editor uses it, so errors name the field, e.g.description: Too big: expected string to have <=500 characters. This also helps the persona editor and persona import, which already use the helper.mari-db.service.ts:validateCustomToolRowenforces the shared schema's name and description limits, so Mari can't store a tool the editor would refuse.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-side checks:
pnpm check(format, lint, types, localization, build).scripts/regressions/custom-tool-import-security.regression.ts: a tool stored with an invisible-character name and a 900-character description of->and=>produces a patch of only{includeHiddenContext: true}for a toggle. An unchanged or key-reordered schema produces nothing, and a name change sends only the name.scripts/regressions/persona-client-contract.regression.ts: adetailserror with a string path formats asdescription: Too big. Fails with the old formatter.scripts/regressions/mari/db-execution-security.regression.ts: Mari refuses a 501-character tool description and stores nothing. Fails without the limit.f62618cee): the limits apply only to values a change sets. A stored tool whose description is already over 500 characters accepts asortOrder-only Mari patch, and a patch that sets a new over-long description is still refused. The regression fails without the fix ("Blocking validation failed" on thesortOrderpatch).pnpm checkpasses, and a local CodeRabbit review of the commit found nothing.Please verify by hand:
->, that reopening it, toggling Include hidden context and saving succeeds.For the reporter: if their tool still won't save, its exported JSON (or a Support Diagnostic) would show whether the stored name contains a hidden character. With this PR, toggles save regardless, and a real error names its field.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Owner: @SpicyMarinara (made by Claude).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.