Skip to content

feat(tui): confirm before installing third-party plugins - #1088

Merged
wbxl2000 merged 4 commits into
mainfrom
third-plugin-two-check
Jun 25, 2026
Merged

feat(tui): confirm before installing third-party plugins#1088
wbxl2000 merged 4 commits into
mainfrom
third-plugin-two-check

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

No prior issue — see Problem below.

Problem

Installing a plugin from the Third-party marketplace tab, the Custom URL tab, or /plugins install <source> happens immediately on Enter / command submit, with no chance to reconsider. Third-party plugins can bundle MCP servers, skills, and files that run code, so there should be an explicit opt-in before they are installed. Official plugins are unaffected.

What changed

  • Before installing any plugin whose source is not the official address, the TUI now shows a confirmation prompt that warns about the risk, defaults to "Exit", and only continues when the user switches to "Trust and install". Official plugins (the marketplace Official tab, or the official Kimi CDN URL) still install without a prompt.
  • "Official" is decided by the marketplace entry tier for marketplace installs, and by the source URL for Custom / /plugins install sources (only the official Kimi CDN path qualifies).
  • The prompt reuses the existing single-select dialog component, extended with a warning-toned notice, and is wired at the three install entry points. Marketplace installs keep the inline "installing" panel state for official entries, and fall back to transcript status for third-party entries (where the prompt has replaced the panel).
  • Added component, unit, and end-to-end tests, plus a short note in the plugin docs (en + zh).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: abd226e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@abd226e
npx https://pkg.pr.new/@moonshot-ai/kimi-code@abd226e

commit: abd226e

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

1 similar comment
@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@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: b4a9598e8e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

panel,
selection.entry.source,
selection.entry.displayName,
selection.entry.tier === 'official',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Verify marketplace install sources before trusting them

When the marketplace comes from /plugins marketplace <file-or-url> or KIMI_CODE_PLUGIN_MARKETPLACE_URL, the catalog is user-controlled; an entry can set tier: "official" while pointing source at a local path or arbitrary URL, and this line then skips the new trust prompt and installs code directly. The Custom and /plugins install paths already use isOfficialPluginSource(source), so marketplace installs should also verify the resolved source (or at least restrict tier-based trust to the default Kimi catalog).

Useful? React with 👍 / 👎.

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

Thanks for the review — both points addressed in abd226e.

P1 (tier spoofing): Marketplace installs now judge trust by the resolved source instead of the catalog tier. installFromPanel is called with isOfficialPluginSource(selection.entry.source), so a custom marketplace can no longer skip the prompt by labeling an entry "official" — only the official Kimi CDN source bypasses it. This matches the Custom / /plugins install paths, which already used source provenance.

P2 (panel not restored on failure): When a third-party install fails, the error branch now re-mounts the marketplace panel (host.mountEditorReplacement(panel)) instead of leaving the user at the editor, restoring the "return to the list to retry" behavior. Official installs still use panel.clearInstalling() as before.

Added/updated e2e coverage: official marketplace installs (local-file + default catalog) now use the official CDN source so they stay on the no-prompt path, and a new test verifies the panel is restored after a third-party install fails. Full suite is green (1956 passed).

@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: abd226eab4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@wbxl2000
wbxl2000 merged commit 0030f76 into main Jun 25, 2026
8 checks passed
@wbxl2000
wbxl2000 deleted the third-plugin-two-check branch June 25, 2026 05:48
@github-actions github-actions Bot mentioned this pull request Jun 25, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Jul 11, 2026
…1088)

* feat(tui): confirm before installing third-party plugins

* chore: add changeset for third-party plugin install confirmation

* docs: note third-party plugin install confirmation prompt

* fix: harden third-party plugin install confirmation

(cherry picked from commit 0030f76)
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