aitools: recover from a removed built-in marketplace on plugin install#6066
Open
dustinvannoy-db wants to merge 2 commits into
Open
Conversation
The proactive `plugin marketplace update` handles a stale local copy of Claude's built-in claude-plugins-official marketplace, but a user who removed it entirely still hits "Plugin not found in marketplace" at install time. Detect that specific failure (marketplaceMissing) and, only then, offer to re-add and refresh the marketplace and retry the install once. Auth and network failures are left untouched so we never prompt to re-add a marketplace that is present. In a non-interactive session (or when the user declines or the retry fails), surface a BlockedError naming the exact repair commands, rendered from a single repairCommands() helper shared with the prompt so the two can't drift apart. Co-authored-by: Isaac
Verified against the real Claude CLI: a plugin install against a missing built-in marketplace fails with `Plugin "<id>" not found in marketplace "<name>"`. The `marketplace not found` phrase only comes from `plugin marketplace update` (which the recovery gate never inspects) and puts the name mid-string, so the substring never matched anything. Drop it and keep only the verified `not found in marketplace` match. Co-authored-by: Isaac
Contributor
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
Author
|
@renaudhartert-db would you be able to review this when you have a chance? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When
databricks aitools installinstalls the databricks plugin for Claude Code, the plugin is served from Claude's built-inclaude-plugins-officialmarketplace. #5771 added a proactiveplugin marketplace updatebefore install to fix a stale local copy, but a user who has removed that marketplace entirely still hits an opaque failure at install time:What
marketplaceMissing(err)(Claude reportsPlugin "<id>" not found in marketplace "<name>"), gated bybuiltinMarketplaceRepairableso only that failure triggers recovery — auth and network errors are left untouched, and we never prompt to re-add a marketplace that is present.BlockedErrornaming the exact repair commands, rendered from a singlerepairCommands()helper shared with the prompt so the two can't drift.Notes for reviewers
marketplaceMissingmatches on the agent CLI's stderr string rather than a sentinel. This is a deliberate exception to the "don't branch on error strings" rule: theclaudeCLI exposes no error code for this, the same file already does this inclaudeAlreadyDisabled, and the match is only used to decide whether to attempt a re-add — the retried install is always the real verdict. The matched string was verified against the live Claude CLI.Testing
go test ./libs/aitools/... ./cmd/aitools/...,go vet, and./task lint-qall pass.This pull request and its description were written by Isaac.