Skip to content

Degrade transient optional list failures in Modern enumeration - #6348

Open
lorenzozanee wants to merge 1 commit into
stacklok:mainfrom
lorenzozanee:fix/vmcp-health-optional-list-429
Open

Degrade transient optional list failures in Modern enumeration#6348
lorenzozanee wants to merge 1 commit into
stacklok:mainfrom
lorenzozanee:fix/vmcp-health-optional-list-429

Conversation

@lorenzozanee

Copy link
Copy Markdown

Summary

A reachable Modern backend can be marked unavailable when an optional capability enumeration (resources/templates/list, resources/list or prompts/list) returns a transient HTTP 429. The 429 is classified as transient in the Modern layer, but the enumeration treated every error other than -32601 as fatal, so the transient failure surfaced as ErrBackendUnavailable and flipped the backend to unhealthy/degraded even though initialize and tools/list had succeeded. With several VirtualMCPServers probing the same rate-limited backend, aggregate Ready flips to False (BackendsDegraded).

A transient failure on an optional list now degrades to an empty result (with a WARN) instead of failing the whole enumeration. tools/list stays fatal: a backend that cannot list its tools is genuinely unavailable. The existing -32601 not-implemented degradation is unchanged.

Fixes #6347

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

The regression tests fail on the base commit with the exact error from the report ("backend unavailable: failed to list resource templates ... modern backend returned a transient error: HTTP 429") and pass with the fix; the affected vmcp packages are green.

Special notes for reviewers

This fix targets the Modern path reported in #6347. The Legacy path still treats a 429 on optional enumeration as fatal; detecting the transient class there would require reaching into go-sdk internals and is left for a follow-up. This is orthogonal to #6246 (partialFailureMode wiring), which does not touch error classification.

A rate-limited Modern backend that answers an optional capability
enumeration (resources/list, resources/templates/list or prompts/list)
with a transient HTTP 429 was misclassified as ErrBackendUnavailable,
flipping a reachable backend to unhealthy/degraded and aggregate
Ready=false even though initialize and tools/list succeeded.

Degrade a transient failure on an optional list to an empty result
instead of failing the whole enumeration. tools/list stays fatal; the
-32601 not-implemented degradation is unchanged.

Fixes stacklok#6347

Signed-off-by: lorenzozanee <wyz0707@proton.me>
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.01%. Comparing base (8343851) to head (e1c1051).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/vmcp/client/client.go 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6348      +/-   ##
==========================================
+ Coverage   72.96%   73.01%   +0.05%     
==========================================
  Files         742      742              
  Lines       78236    78250      +14     
==========================================
+ Hits        57085    57138      +53     
+ Misses      17172    17117      -55     
- Partials     3979     3995      +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

bug(vmcp): HTTP 429 listing resource templates marks a backend unavailable

2 participants