Repository navigation
fix(platform): tell the model which wrapper a tool argument goes in - #1106
Open
Walternater wants to merge 2 commits into
Open
Walternater wants to merge 2 commits into
Walternater wants to merge 2 commits into
Conversation
The validate and release-local workflows never installed ripgrep, and validate.sh reads a missing rg (exit 127) as "no match" inside if-rg, so every forbidden-content scan skipped silently while the job printed "Validation passed." (issue Tencent#1044). - validate.sh now fails loudly when rg is not on PATH. - Both workflows install ripgrep before running validate.sh. Merge after Tencent#909: apt ships rg 15.1.0 on resolute (ubuntu-latest) and 14.1.0 on noble; with rg present, 15.x glob handling self-matches scripts/validate.sh in scan 1 (the known bug Tencent#909 fixes, noble unaffected). Until Tencent#909 merges, validate (3.12) shows that known failure on this branch. Co-Authored-By: Claude Code <noreply@anthropic.com>
Read-only tools described their arguments as "Query: projectId" while their input schema accepts only path/query/body at the top level, so the model passed a top-level projectId and got "unknown field" on its first call, then retried with the right shape (issue Tencent#1084). - /api/workflows GET now declares its projectId and q query parameters; the handler already read them but the contract omitted them, so the generated schema had an empty query object. - Tool descriptions now name the wrapper objects the schema actually accepts and show one example, for read-only and write tools alike. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Read-only platform tools described their arguments as
Query: projectIdwhile the input schema accepts onlypath/query/bodyat the top level (additionalProperties: false). The model followed the description, passed a top-levelprojectId, and gotunknown fieldon its first call before retrying with the wrapped shape. #1084 shows two such failures out of twelve in one 13-second span.Closes #1084:
docs/api/openapi.yaml—GET /api/workflowsnow declaresprojectIdandq. The handler (internal/httpapi/catalog.go:1012) already read both; the contract omitted them, soToolInputSchemaemitted an empty query object and the model had to guess.internal/httpapi/agent_tool_catalog.go— descriptions now end with the wrapper objects the schema actually accepts, e.g.Arguments go inside query, for example {"query": {...}}., for read-only and write tools alike. Only wrappers that can carry a field are named: an empty query or an absent body is left out, so a no-argument tool grows no hint.Scope
Verification
go test ./internal/httpapi/ ./internal/mcpserver/ ./docs/api/ -count=1→ all pass (httpapi 229s, full package).TestPlatformToolArgumentHintNamesTheWrapper(query for GET, body for PUT, path for path-parameterised tools, no body on a GET),TestPlatformToolArgumentHintIsEmptyWithoutWrappers(a tool with no arguments gets no hint — this case caught the first version, which named the always-present empty query).TestOpenAPICoversEveryPublicOperationguards the contract edit.npm --prefix chatbot test(built viascripts/build-chatbot.sh) → 401 tests, 56 files pass.smoke-install.sh/e2e.shlocally; this change does not touch install or runtime paths, and CI runs them.Note on wording
The hint is English because it appends to the English
op.Description. The draft-protocol prompt already tells the model to wrap arguments bybody/path/query(assistant.go:1083); this makes the per-tool description say the same thing where the model reads it at call time.🤖 Generated with Claude Code