Skip to content

feat(server): add opt-in per-upstream argument-error redaction - #1798

Merged
Dumbris merged 3 commits into
smart-mcp-proxy:mainfrom
antongulin:codex/upstream-argument-error-redaction
Oct 30, 2026
Merged

Dumbris merged 3 commits into
smart-mcp-proxy:mainfrom
antongulin:codex/upstream-argument-error-redaction

Conversation

@antongulin

@antongulin antongulin commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Some error messages repeat private information. This adds an optional privacy setting to hide those details while still helping the AI fix its request.

Description

Adds optional per-upstream tool_argument_error_mode: "redacted" to hide recognized argument-error details while keeping the schema and retry hint. Default behavior stays unchanged. Configurable through REST/MCP; covers call_tool_*, legacy call_tool, and direct routing.

Generic SDK Invalid params errors, upstream isError results, logs, and sandbox errors remain outside this policy. No dependency or UI/CLI changes.

Testing

  • I have tested these changes locally
  • I have added/updated tests that prove my fix is effective or my feature works
  • All existing tests pass

CI: 42 passed, 8 skipped. Focused race tests, builds, and API E2E (70/70) pass. The unrestricted local server suite had remaining failures.

Add a per-server tool_argument_error_mode policy (detailed|redacted) persisted through config, storage, REST and MCP management, and consulted at dispatch by the call_tool_* variants, the legacy call_tool handler and direct routing mode.

Redacted renders eligible argument errors as the existing self-healing invalid_params envelope with the message "Invalid tool arguments." while every other failure and the default/detailed policies stay byte-identical. Add regression coverage and regenerate the tools/list goldens and OpenAPI artifacts.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 89.83957% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/httpapi/server.go 55.00% 6 Missing and 3 partials ⚠️
internal/runtime/runtime.go 0.00% 3 Missing and 1 partial ⚠️
internal/management/service.go 0.00% 1 Missing and 1 partial ⚠️
internal/server/server.go 66.66% 2 Missing ⚠️
internal/storage/bbolt.go 50.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@antongulin
antongulin marked this pull request as ready for review October 28, 2026 09:11
@Dumbris
Dumbris merged commit 5a116b7 into smart-mcp-proxy:main Oct 30, 2026
53 checks passed
@Dumbris

Dumbris commented Oct 30, 2026

Copy link
Copy Markdown
Member

Merged — thank you @antongulin! The opt-in tool_argument_error_mode: "redacted" is a careful piece of work: default behaviour untouched, every call surface (variants, legacy call_tool, direct routing) covered, and the tool-list goldens pinned field by field.

One note from review, not a blocker: activity records still keep the unredacted error (as your docs say, logs are out of scope). If you're interested, extending the policy to the activity ErrorMessage would make a nice follow-up.

If you feel like sharing what you built (a post, a tweet, anywhere), we'd love to boost it — no pressure at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants