Repository navigation
feat(cloud): return a link to enable direct access when it's disabled - #1363
Conversation
|
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/1791846541-direct-access-enable-link' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791846541-direct-access-enable-link'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. |
There was a problem hiding this comment.
🟡 Changes recommended
Agent-facing guidance interpolates an untrusted Cloud response value, and the fallback behavior lacks coverage.
2 open findings
What changed in this PR
Adds direct-access enablement guidance with a connector settings link when direct actions are disabled.
Changes:
- Builds connector-specific disabled-access guidance.
- Passes the guidance through direct-action errors.
- Tests the generated message and link.
| File | Description |
|---|---|
airbyte/cloud/connectors.py |
Generates and attaches settings guidance. |
tests/unit_tests/test_cloud_direct_execute.py |
Verifies the guidance text. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit cbf371d in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit cbf371d in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit cbf371d in the Show a line coverage summary of the most covered files.
Updated |
305bcbd to
c536be0
Compare
…access is disabled Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
0873ddf to
cbf371d
Compare
8b63058
into
release-candidate/v1


Overview
👉 TL;DR: When an agent calls a direct-action MCP tool on a Cloud connector that has direct access disabled, the tool now returns a normal result with
status="error"and one entry inerrors, which the agent is told to show the user as-is:Show the user this message as-is: Direct access is currently disabled for {name}. [Click here]({url}) to enable it.The link comes back in the tool result rather than in exception text, so
AgentErrorTextMiddlewaredoesn't rewrite it.#1364 is stacked on this PR. Builds on the merged #1366. Part of AGENTIC-2340.
Changes
AirbyteExternalAccessNotEnabledError.enablement_url: str | None. The defaultguidanceis unchanged.CloudConnector._direct_access_enablement_url: a thin property overconnector_url._execute_direct_actionpasses it to_raise_if_feature_not_enabled(..., enablement_url=...).ExternalApiExecuteResult.errors: list[str], following the existingerrors/warningspattern in other MCP results.execute_external_api_query,execute_external_sql_query, and the unregistered_execute_external_api_actioncatch the error and return_direct_access_disabled_result(error, connector). The label is the cached connector name, or{connector_type} {connector_id}when there isn't one. If the error has noenablement_url, it is re-raised unchanged.enablement_url == connector_url. In MCP, the exacterrors[0]text for both the cached-name and fallback-label cases, and the re-raise when there's no URL.Review Spotlight
airbyte/mcp/cloud.py:_direct_access_disabled_resultand the threetry/exceptblocks.Evidence
{workspace_url}/source/{id}opens the connector's Settings tab with the Agent Access toggle visible (screenshots are in the PR comments).Risks
ExternalApiExecuteResultgets a newerrorsfield. It's additive and defaults to empty.status="error"instead of raising a tool error. A caller that only checksisErrorwill see success; agents act on theerrorstext.Link to Devin session: https://app.devin.ai/sessions/bb884d35f6d24ad993d7f494e660acbc
Open in Devin Desktop: https://app.devin.ai/desktop/session/bb884d35f6d24ad993d7f494e660acbc?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)