Skip to content

Hide defunct/renamed native providers from the create-agent prompt#126

Open
ryw wants to merge 1 commit into
mainfrom
hide-defunct-native-providers
Open

Hide defunct/renamed native providers from the create-agent prompt#126
ryw wants to merge 1 commit into
mainfrom
hide-defunct-native-providers

Conversation

@ryw

@ryw ryw commented Jun 14, 2026

Copy link
Copy Markdown
Member

Problem

CAP was being handed a defunct tembo native connection. The tembotembo-agent-studio slug rename (#119) was code-only, so old workspace_connection rows with type='tembo' linger. The Connections UI doesn't render them (no matching catalog provider), but buildNativeSlots still listed them — so the create/edit prompt told CAP to declare a tembo slot and fetch …/for-agents/tembo.md, which 404s with "Unknown provider."

Fix

buildNativeSlots now skips any active native connection whose provider slug is no longer in the catalog (getMcpProvider(c.type) === null). Renamed/removed providers' orphaned rows stay out of CAP's prompt; the live tembo-agent-studio connection is unaffected. General guard, not a one-off for tembo.

tsc / eslint clean.

Loose end (separate)

The orphaned tembo row still exists in the DB and, since it's a self-key connection, its minted tas_ key is still valid — and it can't be disconnected from the UI (the page doesn't render non-catalog providers). Worth a one-time cleanup (delete the row + revoke the key), but this PR stops the CAP exposure, which was the ask. Happy to do that cleanup next if you want.

🤖 Generated with Claude Code

The `tembo` → `tembo-agent-studio` slug rename left orphaned `workspace_connection`
rows (`type='tembo'`) that the Connections UI no longer renders but that
buildNativeSlots still surfaced — so the create/edit prompt told CAP to use a
`tembo` slot and fetch `/for-agents/tembo.md`, which 404s ("Unknown provider").

buildNativeSlots now skips any native connection whose provider slug isn't in
the catalog (getMcpProvider === null), so a renamed/removed provider's leftover
rows stay out of CAP's prompt. The live `tembo-agent-studio` connection is
unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ryw added a commit that referenced this pull request Jun 14, 2026
A native connection to a provider that left the catalog (e.g. the old `tembo`
self-key connection after the `tembo-agent-studio` rename) lingers as an
orphaned row: it doesn't render on the Connections page, can't be disconnected,
keeps a minted tas_ key alive, and (before #126) leaked into CAP's prompt.

- The Connections → Native MCP page now shows a "removed provider" banner with a
  one-click Remove when you hold such connections; removeDefunctNativeConnectionsAction
  deletes the rows, revokes any self-key key, and drops their cached tools.
- Generalized the disconnect key-revocation to fire on any self-key connection
  (metadata.api_key_id present) instead of matching the current slug, so a
  renamed provider's leftover key is revoked too.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant