Repository navigation
fix(mcp): degrade gracefully when the connector feature probe fails - #1249
Conversation
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1790299397-feature-probe-degrade' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1790299397-feature-probe-degrade'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit b8230d6 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit b8230d6 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit b8230d6 in the Show a line coverage summary of the most covered files.
Updated |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
limit=0 and negative limits bypass existing validation when feature_filter is set.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR makes MCP Cloud connector discovery resilient to failed feature probes and improves 5xx error guidance.
Changes:
- Adds unknown-feature results, warnings, and probe short-circuiting.
- Makes connector descriptions degrade gracefully.
- Adds HTTP status phrases and upstream-service guidance.
| File | Summary |
|---|---|
tests/unit_tests/test_mcp_cloud.py |
Tests probe failures, unknown features, filtering, limits, and descriptions. |
tests/unit_tests/test_cloud_direct_execute.py |
Tests 5xx guidance and status phrases. |
airbyte/mcp/cloud.py |
Handles failed probes and unknown feature states; non-positive filtered limits require validation correction. |
airbyte/_direct_connectors/api_util.py |
Improves HTTP error messages and upstream failure guidance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…lures per-connector Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
5cc2f5d
into
release-candidate/v1

Summary
Client-side mitigation for AGENTIC-2274 (Cloud
GET /workspaces/{id}/skills/docsand/executeroutes returning 422/502/504 on the Fusion workspace). This PR does not make those calls succeed; it stops one failing docs probe from taking out unrelated MCP tools, gives callers a typed exception to branch on, and makes the 5xx errors self-explanatory.Before: a single non-403/404 error from the docs probe raised out of
list_cloud_connectors feature_filter=…anddescribe_cloud_connector, and each connector's probe could sit on the 300s request timeout.After (MCP layer only;
CloudWorkspace.list_connectors/CloudConnector.enabled_featuressemantics unchanged — 403/404 still mean "not enabled", other errors still raise from the library):AirbyteCloudApiError(AirbyteError)withstatus_code: int | None.make_cloud_agent_requestraises it for any non-2xx Config API response (malformed/non-JSON bodies still raise plainAirbyteError).is_not_enabled_errorchecksisinstance(..., AirbyteCloudApiError) and status_code in {403, 404}._error_messageno longer appends a generic HTTP reason phrase (401/403 lines unchanged) — callers usestatus_code, not the message.list_cloud_connectors(feature_filter=…)validateslimit > 0up front (same contract asCloudWorkspace.list_connectors), then lists without the filter and probes per connector:describe/try them.limitcounts unknowns.CloudConnectorResultgainswarnings: list[str]andenabled_featuresaccepts"unknown"(alongside"not_checked")._describe_cloud_connector: feature lookup + context-layer block wrapped; on failureenabled_features="unknown"+ warning instead of raising._error_guidance: 502/503/504 carry "Cloud accepted the request but its upstream direct-access service failed or timed out … not a credentials or permissions problem".Tests: typed exception + status code + no phrase, 5xx guidance, workspace-wide 502 short-circuit (probe called exactly twice for 3 connectors), connector-specific 422 (all 3 probed), 404 still excluded,
limitwith unknowns,limit=0rejected, describe marks unknown.Related: #1248 (envelope normalization), AGENTIC-2274.
Link to Devin session: https://app.devin.ai/sessions/131e8cb1f5b547b8b99d66ddfd4b0bda
Open in Devin Desktop: https://app.devin.ai/desktop/session/131e8cb1f5b547b8b99d66ddfd4b0bda?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)