mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #302] [CLOSED] fix: anchor tool schema messages to English #307
Reference in New Issue
Block a user
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/vxcontrol/pentagi/pull/302
Author: @mason5052
Created: 5/6/2026
Status: ❌ Closed
Base:
main← Head:codex/issue-285-english-only-tool-schema📝 Commits (2)
e9c06d8fix: anchor tool schema messages to English7437520fix(tools): broaden English-anchor regression guard for #285📊 Changes
2 files changed (+118 additions, -32 deletions)
View changed files
📝
backend/pkg/tools/args.go(+32 -32)📝
backend/pkg/tools/args_test.go(+86 -0)📄 Description
Summary
Hard-codes the user-facing description text in the tool JSON schema to English so the LLM never sees the legacy "in user's language only" hint. This stops Russian/mixed-language
messageandresultfields from leaking into traces and the UI when a flow is created in English.Problem
backend/pkg/tools/args.godeclaredjsonschema_descriptiontags that told the model to answer "in user's language only" / "in the user's language only" / "in the user's language". Because the schema is reflected once at startup and shared across flows, a flow in English would still receive the Russian-leaning hint baked into the tool definitions, producing the mixed-language tool-call output reported in #285.Solution
Replace every
in user's language only,in the user's language only, andin the user's languageoccurrence within Englishin the struct tags acrossbackend/pkg/tools/args.go. The follow-up commit also removed the remainingin the user's language(without "only") schema hints on the search actionMessagefields, so no schema description still instructs the model to answer in the user's language. No runtime locale logic, no schema re-shape, no API/DB/UI change.User Impact
message/result/ clarification fields render in English regardless of UI locale.Flow.languageis unchanged; if multilingual support is added later, this is a one-line edit per field.Test Plan
TestToolSchemasDoNotInstructUsersLanguagesweeps every tool returned byGetRegistryDefinitions()and fails if any of the broader forbidden patterns (user's language,the user's language) reappear in any tool schema, not just the old exactuser's language onlyphrase.TestUserFacingMessageDescriptionsAreEnglishAnchoredasserts the eight user-facingmessage/resultproperties carry the "in English" anchor, going through the samereflector.Reflectpath the LLM sees.go test ./pkg/tools/...passes locally.rg "user's language|the user's language" backend/pkg/tools/args.goreturns no matches (verified).Closes #285
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.