Skip to content

fix(cloud): preserve guidance warnings and tolerate malformed docs - #1240

Closed
Piotr Kozikowski (pkozikow) wants to merge 10 commits into
release-candidate/v1from
piotr/fusion-mcp-api
Closed

Piotr Kozikowski (pkozikow) wants to merge 10 commits into
release-candidate/v1from
piotr/fusion-mcp-api

Conversation

@pkozikow

@pkozikow Piotr Kozikowski (pkozikow) commented Sep 24, 2026 •

Copy link
Copy Markdown

AGENTIC-2244

Malformed optional skill docs can fail an otherwise valid connector description, and local destination guidance warnings are lost from structured MCP results. Catch validation failures when describing connectors, preserve independently confirmed enabled features, and store local notices in metadata.warnings so both MCP renderers retain them. Docs failure warnings avoid embedding raw error details.

Destination fallback guidance keeps the existing not-enabled notice, with a code comment documenting the rare missing-docs 404 ambiguity. Regression tests cover malformed docs, unavailable docs, structured warnings on fresh and cached reads, and warning preservation through both renderers.

Rebased onto release-candidate/v1 at b256ec9f. The base now provides authoritative connector enablement, confirmed-disabled versus failed-lookup error handling, search, typed execution results, and the hidden MCP write tool. Those implementations are preserved; superseded docs-based feature inference has been removed from this PR. The existing Python write execution path is unchanged.

Validation:

  • Full unit suite: 1,401 passed, 1 skipped (existing PokeAPI test).
  • Focused rebase tests: 390 passed.
  • After the final neutral-warning correction: all 42 description tests passed, including two new 403/404 regressions.
  • Ruff, Pyrefly, formatting, and test collection passed; dependencies synced from the base's lockfile, including FastMCP 4.
  • Rebase reconciliation reviewed. No live cross-service end-to-end test was run.

@linear-code

linear-code Bot commented Sep 24, 2026

Copy link
Copy Markdown

AGENTIC-2244

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@piotr/fusion-mcp-api' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@piotr/fusion-mcp-api'

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

@github-code-quality

github-code-quality Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest-no-creds

The overall line coverage in commit 97996d9 in the piotr/fusion-mcp-api branch is 77%. The line coverage in commit d9f652f in the release-candidate/v1 branch is 65%.

Show a line coverage summary of the most impacted files.
File release-candidate/v1 d9f652f piotr/fusion-mcp-api 97996d9 +/-
airbyte/_util/api_util.py 36% 58% +22%
airbyte/mcp/cloud.py 52% 77% +25%
airbyte/cloud/connectors.py 34% 68% +34%
airbyte/mcp/_otel.py 0% 90% +90%
airbyte/_direct...nnector_docs.py 0% 91% +91%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/_direct...ctors/models.py 0% 94% +94%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 96% +96%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest

The overall line coverage in commit 97996d9 in the piotr/fusion-mcp-api branch is 80%. The line coverage in commit d9f652f in the release-candidate/v1 branch is 71%.

Show a line coverage summary of the most impacted files.
File release-candidate/v1 d9f652f piotr/fusion-mcp-api 97996d9 +/-
airbyte/cloud/connectors.py 51% 75% +24%
airbyte/mcp/cloud.py 52% 77% +25%
airbyte/_direct...ors/api_util.py 0% 84% +84%
airbyte/mcp/_otel.py 0% 90% +90%
airbyte/_direct...nnector_docs.py 0% 91% +91%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/_direct...ctors/models.py 0% 94% +94%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 96% +96%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest-unit

The overall line coverage in commit 97996d9 in the piotr/fusion-mcp-api branch is 73%. Line coverage data for the release-candidate/v1 branch is not yet available.

Show a line coverage summary of the most covered files.
File release-candidate/v1 piotr/fusion-mcp-api 97996d9 +/-
airbyte/mcp/_sso_auth.py — 96% —
airbyte/cloud/models.py — 96% —
airbyte/_direct...ctors/models.py — 94% —
airbyte/cloud/client.py — 91% —
airbyte/mcp/_otel.py — 90% —
airbyte/progress.py — 80% —
airbyte/mcp/cloud.py — 77% —
airbyte/cloud/connectors.py — 68% —
airbyte/shared/...ql_processor.py — 68% —
airbyte/_util/api_util.py — 58% —

Updated September 29, 2026 00:05 UTC

@pkozikow
Piotr Kozikowski (pkozikow) marked this pull request as ready for review September 24, 2026 23:49
Copilot AI lite review requested due to automatic review settings September 24, 2026 23:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T23:53:15.753768Z a0449d4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Four moderate issues remain in capability state handling, workspace lookup, warning duplication, and warning type safety.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR normalizes Cloud execution results and improves connector capability guidance and unsupported-write handling.

Changes:

  • Maps Cloud data/meta responses to ExternalApiExecuteResult.
  • Preserves warnings and supports recoverable capability checks.
  • Rejects unsupported Cloud writes with actionable guidance.
File Summary
tests/​unit_tests/​test_mcp_cloud.py Tests MCP write-action errors and structured warnings.
tests/​unit_tests/​test_cloud_direct_execute.py Tests execution normalization and error propagation.
tests/​unit_tests/​test_cloud_describe.py Tests capability recovery and documentation warnings.
airbyte/​mcp/​cloud.py Reports unknown capabilities and unsupported writes. Two moderate issues remain around unavailable probe state and pre-rejection workspace resolution.
airbyte/​cloud/​workspaces.py Adjusts connector feature resolution and warning propagation.
airbyte/​cloud/​connectors.py Updates feature caching, warning handling, and write rejection. Two moderate warning-handling issues remain.
airbyte/​_direct_connectors/​connector_docs.py Stores fallback notices in metadata.
airbyte/​_direct_connectors/​api_util.py Normalizes Cloud execution envelopes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread airbyte/cloud/connectors.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0449d48b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread airbyte/mcp/cloud.py Outdated
Comment thread airbyte/cloud/connectors.py Outdated
Comment thread airbyte/_direct_connectors/api_util.py
Comment thread airbyte/_direct_connectors/connector_docs.py Outdated
@aaronsteers

Aaron ("AJ") Steers (aaronsteers) commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Piotr Kozikowski (@pkozikow) - I've cherry-picked the data shape fix here #1248, and added strong typing:

But it looks like we're blocked by:

Before we can confirm the fix in 1248, I think we need to resolve that upstream issue.

@pkozikow Piotr Kozikowski (pkozikow) changed the title fix(cloud): correct execution results and connector guidance fix(cloud): preserve probe uncertainty and clarify connector errors Sep 25, 2026
@pkozikow

Piotr Kozikowski (pkozikow) commented Sep 25, 2026 •

Copy link
Copy Markdown
Author

Agreed—the unit tests validate response handling, but don’t establish that execution works end to end. #1248 is now included in release-candidate/v1 and not redone here; live validation remains outstanding pending the upstream issue.

Comment thread airbyte/cloud/connectors.py Outdated


class CloudConnector:
class CloudConnector: # noqa: PLR0904 - public connector management and execution API

@aaronsteers Aaron ("AJ") Steers (aaronsteers) Sep 25, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - Normally would expect text after the noqa to briefly hint at the rule being ignored and/or reason to ignore. Can we update for clarity? The post-noqa comment doesn't explain what is being ignored.

@aaronsteers Aaron ("AJ") Steers (aaronsteers) Sep 25, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked it up: PLR0904 - too many public methods

Suggested change
class CloudConnector: # noqa: PLR0904 - public connector management and execution API
class CloudConnector: # noqa: PLR0904 # too many public methods

But this probably goes away if we revert _get_enabled_features to private, so maybe not needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making _get_enabled_features private removes the need for the PLR0904 suppression, so I removed it. Ruff passes without it.

Comment thread airbyte/cloud/connectors.py Outdated
"""Return the enabled features, resolving them through the workspace on first use."""
if self._enabled_features is None:
self._enabled_features = self.workspace._get_connector_features(self) # noqa: SLF001
def get_enabled_features(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should remain private since we already have the same as a public property.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed—restored the private helper and kept enabled_features as the public property. Internal callers retain the warning and unknown-state handling.

Comment thread airbyte/cloud/connectors.py Outdated
Comment on lines 398 to 419
@@ -396,15 +409,13 @@ def execute_api_action(
context={"entity_type": entity_type, "action": action},
) from None

return self._execute_direct_action(
entity_type=entity_type,
action=resolved_action.value,
api_args=api_args,
select_fields=select_fields,
exclude_fields=exclude_fields,
skip_truncation=skip_truncation,
intent=intent,
read_only=False,
_ = api_args, select_fields, exclude_fields, skip_truncation, intent
raise exc.PyAirbyteInputError(
message="Cloud connector write actions are not supported yet.",
guidance=(
"Use execute_api_query (Python) or execute_external_api_query (MCP) for reads."
),
context={"entity_type": entity_type, "action": resolved_action.value},
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not break the implementation please. Better to just hide it by suppressing/disabling the tool.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best for this to be in a dedicated PR, so it doesn't slow other needed changes. As-is today, I think this is working as designed. It properly advertises itself as not supported/enabled and is basically inert, while still being ready to handle workloads when enabled/unblocked.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed. This fails gracefully as designed.

Tested against live mcp.airbyte.com (RC4) with the airbyte-support-bot creds:

execute_external_api_action(action="create", entity_type="issues") on the Jira source in Devin's Sandbox → "AirbyteExternalAccessNotEnabledError: The connector is not enabled for external access… Check enabled_features on the connector and organization."

Clean, accurate, agent-friendly — no write was attempted (backend 403/404 → the base branch's relabel path fired, and it was correct here). So for non-enabled connectors the status quo degrades gracefully...

My preference is to just let it stay. I'm happy to hide it in a separate PR if that helps, but let's not break the current implementation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed—removed the write-rejection changes and restored the existing implementation. Any change to tool visibility can go in a separate PR.

@pkozikow Piotr Kozikowski (pkozikow) changed the title fix(cloud): preserve probe uncertainty and clarify connector errors fix(cloud): preserve guidance warnings and tolerate malformed docs Sep 28, 2026
@aaronsteers

Copy link
Copy Markdown
Member

Closing.

Resolved by:

Piotr Kozikowski (@pkozikow) - In future, please:

  1. Log an issue for observed concerns so we can align on the problem before addressing the fix.
  2. Keep PRs atomic to the issue they attempt to resolve. I know we both lost at least 5+ hours on this PR and it was a bad experience (I presume) for both of us. A few of these things could have merged directly with minimal fanfare, but the composite was unmergeable and created churn for us on both sides.

Thanks.

  • AJ

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