Normalize proxyMode to always reflect effective HTTP protocol#4468
Open
ChrisJBurns wants to merge 2 commits intomainfrom
Open
Normalize proxyMode to always reflect effective HTTP protocol#4468ChrisJBurns wants to merge 2 commits intomainfrom
ChrisJBurns wants to merge 2 commits intomainfrom
Conversation
proxyMode was only meaningful for stdio transports but could be set on any transport, returning empty or misleading values to clients. This caused confusion and required every client to implement conditional logic via GetEffectiveProxyMode() to determine the actual protocol. Add EffectiveProxyMode() to pkg/transport/types as the canonical typed implementation, and NormalizeProxyMode() on RunConfig to apply it at creation and load time. This ensures proxyMode is always the effective value in persisted configs and API responses. Also fixes the conflicting default in StdioTransport (SSE vs streamable-http everywhere else). Fixes #3296 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4468 +/- ##
=======================================
Coverage 69.64% 69.65%
=======================================
Files 491 491
Lines 50304 50310 +6
=======================================
+ Hits 35036 35043 +7
Misses 12580 12580
+ Partials 2688 2687 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
proxyModewas only meaningful for stdio transports but could be set on any transport type, returning empty or misleading values to API consumers, vMCP, Optimizer, and the UI. Every client had to implement conditional logic viaGetEffectiveProxyMode()to determine the actual protocol in use.proxyModeat write boundaries (config builder and config load) so it always reflects the effective HTTP protocol. Also fixes the conflicting default inStdioTransport(defaulted to SSE while everything else defaulted to streamable-http).Fixes #3296
Type of change
Test plan
task test)task lint-fix)Changes
pkg/transport/types/transport.goEffectiveProxyMode()— canonical typed function that computes the actual HTTP protocolpkg/transport/stdio.gopkg/runner/config.goNormalizeProxyMode()method; call inReadJSONfor migration of existing configspkg/runner/config_builder.goNormalizeProxyMode()at end of builder so all new configs are normalizedpkg/workloads/types/types.goGetEffectiveProxyMode()now delegates to the canonical typed functionpkg/export/k8s.gopkg/transport/types/transport_test.goEffectiveProxyModepkg/runner/config_test.goNormalizeProxyModeDoes this introduce a user-facing change?
proxyModein API responses andthv statusoutput will now always be populated with the effective HTTP protocol, even for non-stdio transports. Previously it could be empty or misleading for sse/streamable-http transports.Special notes for reviewers
GetEffectiveProxyMode()are now idempotent (normalizing an already-normalized value is a no-op). A follow-up PR can clean these up, but they are harmless to keep.StdioTransporthas no runtime impact — the factory always callsSetProxyMode()immediately after construction, overriding the default. The fix is for correctness and to prevent future bugs.ReadJSONnormalization, requiring no explicit data migration.Generated with Claude Code