Skip to content

fix: wire elicitation into platform config providers#787

Draft
Muizzkolapo wants to merge 5 commits into
dbt-labs:mainfrom
Muizzkolapo:fix/762-elicitation-provider
Draft

fix: wire elicitation into platform config providers#787
Muizzkolapo wants to merge 5 commits into
dbt-labs:mainfrom
Muizzkolapo:fix/762-elicitation-provider

Conversation

@Muizzkolapo
Copy link
Copy Markdown
Contributor

Summary

  • Introduce CredentialsProviderProtocol so platform config providers accept both CredentialsProvider and ElicitingCredentialsProvider
  • Make _is_multi_project() sync — reads settings.dbt_project_ids directly instead of calling get_credentials(), eliminating the 17-second hang in Cursor ([Bug]: Cursor - v1.17.1 No tools, prompts, or resources #759)
  • Wire ElicitingCredentialsProvider to platform config providers (discovery, semantic layer, admin API) gated on settings.any_platform_toolset_active, so elicitation fires when a platform tool is called without DBT_HOST
  • CLI-only users (DBT_MCP_ENABLE_DBT_CLI=true) are fully isolated from platform concerns

Test plan

  • list_tools() returns instantly with no credential fetch or OAuth
  • Calling a platform tool without DBT_HOST triggers elicitation wizard
  • CLI-only mode sees no wizard and no platform errors
  • Proxied tools stay on raw credentials (no elicitation at lifespan time)
  • Cached credentials on second call (no re-elicitation, no re-OAuth)
  • 660 unit tests pass

Fixes #762
Root-causes #759

test(config): add tests for any_platform_toolset_active and provider wiring

test(config): add tests for any_platform_toolset_active and provider wiring
@Muizzkolapo Muizzkolapo requested review from a team, b-per, jairus-m and jasnonaz as code owners May 23, 2026 01:19
Copy link
Copy Markdown

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

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: 8b479410f0

ℹ️ 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 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 address that feedback".

Comment on lines +191 to +195
return any((
self.enable_semantic_layer,
self.enable_discovery,
self.enable_admin_api,
self.enable_sql,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Detect platform tools enabled via DBT_MCP_ENABLE_TOOLS

In allowlist mode, any_platform_toolset_active is entered when enable_tools is set, but this branch only checks enable_* toolset flags and ignores individually enabled tools from DBT_MCP_ENABLE_TOOLS. That means configs that enable a platform tool by name (without setting DBT_MCP_ENABLE_DISCOVERY/_SEMANTIC_LAYER/etc.) are misclassified as “no platform toolsets active”, so load_config() injects raw CredentialsProvider into platform providers and platform calls fail with MissingHostError instead of triggering elicitation.

Useful? React with 👍 / 👎.

@Muizzkolapo Muizzkolapo marked this pull request as draft May 23, 2026 01:51
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.

fix: elicitation fires for wrong users — DBT_HOST=None can't serve as both 'no platform' and 'please elicit host'

1 participant