Repository navigation
fix: Redact config error details in HTTP transport - #783
Merged
Merged
Conversation
ConfigurationError, LLMProviderError, and APICallError 4xx now route differently based on transport. In STDIO mode, detailed messages are preserved so users can fix their own config. In HTTP mode (Cloudflare), errors are logged to Sentry via logIssue() and a generic "Feature Unavailable" message is returned—users can't fix server-side config, but operators get visibility through Sentry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… helper The `redactForHttpTransport() ??` pattern obscured control flow by returning undefined to trigger fallthrough. Replace with a single `formatServerConfigError()` helper that takes the detailed message parts and returns the correct response directly for both transports. Co-Authored-By: Claude Opus 4.6 <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.
ConfigurationError,LLMProviderError, andAPICallError4xx currently showdetailed config guidance to all users and are never reported to Sentry. This is
correct for STDIO (the user can fix their own config), but wrong for the hosted
Cloudflare deployment where users can't fix server-side config and operators get
no visibility into these failures.
This adds a
transportfield toServerContext("stdio" | "http") and makesformatErrorForUsertransport-aware. In HTTP mode, config/provider errors arenow logged to Sentry via
logIssue()and a generic "Feature Unavailable"message is returned. In STDIO mode (and when transport is unset), the existing
detailed messages are preserved unchanged.
The transport branching uses a single
formatServerConfigError()helper thattakes the detailed message parts and returns the correct response directly for
both transports.
UserInputErroralways shows details regardless of transport since the user canfix their own input in both modes.
Fixes #781