🤖 feat: Agent Plugins install/update UX (managed installs, v1) - #3820
🤖 feat: Agent Plugins install/update UX (managed installs, v1)#3820ThomasK33 wants to merge 44 commits into
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b9d7245ce
ℹ️ 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".
|
Addressed all five Codex findings in b9c9a10:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9c9a1062a
ℹ️ 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".
|
Addressed all four round-2 findings in edcdfa0:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edcdfa05fe
ℹ️ 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".
|
Addressed all three round-3 findings:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6503d2fe4
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc68e771d7
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a2bd105f4
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0443e1af3e
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc141c4c7e
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6daf6aec0
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1fd47e8cd
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6965bc298
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e576538423
ℹ️ 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".
|
@codex review |
…-install-ux
Conflict resolution:
- discovery.ts: keep discoverAgentPluginAt + discovery gate; adopt main's
one-line discoverAgentPlugins doc (canonical shadowing)
- workspaceMcpOverridesService.ts: adopt main's canonical-first
getOverridesFilePaths array API (loadOverrides scan, canonical write
target, multi-path rm) while keeping this branch's exit-code-checked
removal, mode threading, cross-process runExclusive lock, CAS validation,
and prunePluginOverrideKeys (now pruning canonical AND legacy files)
- mcpConfig.ts: combine WorkspaceMCPOverrides type import with main's
normalizeProjectMetadataIdentityPath import
- installService.ts: loadPluginMcpServers ctx renamed muxHome -> xumHome
- tests: main's new legacy/canonical tests adapted to {overrides, revision}
return shape; CAS/publish tests read the canonical .xum file the save now
writes
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 918bcbf0f7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 918bcbf0f7
Only the user who started this review can view the report in Codex.
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
…e gate, cross-process server invalidation) 1. crossProcessLock: replace read-then-unlink reclamation with an atomic rename-to-quarantine + content verification. A delayed reclaimer that raced a concurrent reclaim-and-acquire now restores the new owner's lock instead of deleting it (a clobbered third-party wx-create is caught by its post-create ownership re-read). 2. Update capability gate now covers the full install-consented surface: skill advertisements (name + description, which interpolate into the model-visible skill index on every request) reject additions AND rewording; agent/workflow/slash-command additions reject (consent listed a specific component set). Removals still apply freely. 3. Cross-process MCP server invalidation: MCPServerManager reads the installer's on-disk mutation epoch before every serve and retires cached plugin-prefixed instances when a sibling process's install/update/uninstall bumped it; update() bumps explicitly on the journal-less no-old-tree path.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fac3179c6d
ℹ️ 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".
… init teardown ordering) 1. Staging clones/fetches/checkouts now run with GIT_NO_HOOKS_ENV: a user with a relative global core.hooksPath would otherwise execute an attacker-controlled repository's post-checkout hook during Preview, before any consent UI appears. 2. fork(): the sanitization-abort cleanup aborts background init and AWAITS its termination (runBackgroundInit now returns a settled promise) before deleting the fresh worktree, so the delete cannot race init's writes/open handles and orphan the worktree.
|
@codex review Round 54+55 fixes on 5c02797:
|
…ate detection, skill dir-name validation, canonical path in error) 1. crossProcessLock: stale reclamation no longer deletes or renames the lock file (a delayed rename could clobber a newly confirmed owner in a three-process race). Reclaimers now serialize through a short-lived mkdir mutex and take ownership by atomically REPLACING the lock content in place — the path is never absent during reclamation, so no third process can slip in a wx create, and no restore branch exists. Mutex ownership is re-verified immediately before the replacing rename. 2. parseRegistryEntries (strict): duplicate names are detected across RAW entries before schema filtering, so a valid entry colliding with a same-name newer-version row refuses the mutation instead of update() patching / uninstall() deleting both rows (upgrade-downgrade rule). 3. Preview collectSkills mirrors runtime discovery: invalid skill directory names are skipped with a warning, and frontmatter names are validated against the directory name — the consent preview no longer promises a skill that never loads, and the update capability surface cannot misclassify one as an addition. 4. Sanitization-failure message now names the canonical .xum/mcp.local.jsonc (and legacy .mux fallback) instead of only .mux.
|
@codex review Round 56 fixes on 84964a0:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84964a03be
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 84964a03be
Only the user who started this review can view the report in Codex.
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
…ity, serialized sweep, full skill fingerprint) 1. crossProcessLock publication is now atomic-with-content: the holder record is written to a temp file and hard-linked into place (exclusive EEXIST), so no observer can ever read a partially written lock and misjudge it corrupt mid-publication. Defense-in-depth for non-atomic writers from other builds: corrupt content younger than a 2s grace is retried, not reclaimed. 2. Release serializes through the same mkdir mutex as reclamation, making its verify-then-unlink atomic against a reclaimer replacing the file — a holder releasing at the stale ceiling can no longer delete the successor's confirmed lock. Bounded retries; on persistent contention the file is left for stale reclamation (never mis-deleted). 3. MCPServerManager cross-process invalidation: check+sweep runs inside a serialization queue and the observed token publishes only AFTER the sweep completes, so a concurrent serve cannot observe the token as handled while instances are still being retired; failed sweeps leave the token unpublished for retry. 4. Update capability fingerprint covers every model-visible skill field: description, when_to_use/when-to-use, and advertise (a hidden-to- visible flip or new steering guidance is re-consent territory).
Task worktrees materialize through TaskService's orchestrateFork flows — outside WorkspaceService.create/fork — and queued/reserved launches even register their workspace entry before the checkout exists, so an uninstall's override pruning enumerates a path with nothing to prune and the later materialization restores a committed stale plugin: enable. WorkspaceService.sanitizeMaterializedTaskWorkspace (public wrapper over the registration-time sanitizer, host-local runtimes only) now runs in both TaskService materialization sites after the checkout exists and BEFORE init/send; failures fail the launch (reserved: markTaskLaunchFailed via throw; create: rollbackFailedTaskCreate + Err). Shared-parent (isolation none) checkouts skip — the parent's consent context is alive.
|
@codex review Round 57 fixes on cdec127:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdec127f84
ℹ️ 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".
…tize ordering + cleanup, git transport whitelist, strict agent preview) 1. crossProcessLock release: last-instant mutex.owns() re-check before the rm, mirroring reclamation — a >15s stall between the token read and the unlink can no longer delete a successor published by a mutex-breaking reclaimer. 2. TaskService immediate create: sanitization moved BEFORE emitWorkspaceMetadata (pre-announcement invariant) so no subscriber can send to the running-status task while sanitization is still pending. 3. TaskService reserved launch: sanitization failure now reclaims the materialized worktree/session via cleanupMaterializedTaskWorkspace before throwing (markTaskLaunchFailed alone leaked the checkout). 4. Staging git invocations set GIT_ALLOW_PROTOCOL=file:git:http:https:ssh (remote helpers like ext:: execute arbitrary commands and are not restricted by hook disabling), and the source parser rejects transport::address syntax outright with a clear message (+ test). 5. Preview agent collection mirrors runtime discovery exactly: regular files only (no symlinks) with AgentIdSchema-valid basenames, so consent never promises an agent that cannot load and updates cannot be rejected over a nonexistent capability.
|
@codex review Round 58 fixes on d41f5f3:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d41f5f341c
ℹ️ 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".
collectAgentFiles now parses each candidate with parseAgentDefinitionMarkdown (size cap included), mirroring runtime discovery's readAgentDescriptorFromFile: a validly named agents/foo.md with malformed content never loads, so it must not enter the consent preview or the update capability fingerprint. An update that repairs such a file in place now reads as 'adds agent foo.md' and is gated for re-consent instead of passing with identical filename sets.
|
@codex review Round 59 fix on 5b1c874a3: agent preview/fingerprint collection now parses candidate definitions with the runtime's parseAgentDefinitionMarkdown (size cap included) — only runtime-valid agents are promised or fingerprinted, and an in-place repair of a malformed definition gates as an addition (+ test). |
This comment has been minimized.
This comment has been minimized.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 764b481daf
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 764b481daf
Only the user who started this review can view the report in Codex.
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
…rsist, sibling cache invalidation, post-startup token recheck, agent fingerprint) 1. crossProcessLock: acquiredAt is now a renewable lease — held locks re-stamp it every staleMs/4 inside the reclaim mutex, so a LIVE transaction legitimately exceeding staleMs (long uninstall pruning contended workspaces) can no longer be reclaimed on age alone; only holders that stopped renewing (crashed/wedged/pid-reused) age out. 2. Uninstall persists the post-commit workspace DELTA into the durable pendingOverridePrunes tombstone BEFORE pruning: a crash between the re-enumeration and a delta workspace's prune now leaves a retryable record; a failed persist skips the shrink (pessimistic record kept). 3. Cross-process sweep also clears the manager's latestWorkspaceOverrides cache: a sibling's on-disk prune was otherwise permanently shadowed by the stale cached enable, letting a same-name reinstall start without consent. Disk is authoritative after a cross-process mutation. 4. getToolsForWorkspace re-reads the mutation token AFTER publication: a sibling mutation beginning after the preflight read (invisible to the in-process epoch and the discovery bracket) now retires the just-published stale instances and rebuilds once from the new tree. 5. Agent capability fingerprint covers the whole parsed frontmatter (key-sorted): description (task-tool model-visible), subagent.runnable, base/ui/policy. Changed definitions behind unchanged filenames gate as re-consent; body-only (system prompt) changes ride the tree swap.
|
@codex review Round 60 fixes on d9f1a37:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9f1a374b1
ℹ️ 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".
| } catch (error) { | ||
| deltaEnumerated = false; | ||
| log.warn( | ||
| "Failed to persist post-commit workspace delta into the prune tombstone; keeping the pessimistic record", | ||
| { error: getErrorMessage(error) } |
There was a problem hiding this comment.
Preserve delta IDs when tombstone persistence fails
When post-commit enumeration finds new workspaces but this union write fails, setting deltaEnumerated to false only prevents the later shrink; the already-durable tombstone still lacks those new IDs. If the process then crashes during pruning, or pruning one of those workspaces fails, retryPendingOverridePrunes() revisits only the original IDs and can eventually remove the tombstone, allowing a same-name reinstall to reactivate the unpruned override. Retain a durable retry record for the delta instead of continuing without one.
Useful? React with 👍 / 👎.
| await this.retireCrossProcessPluginInstances(); | ||
| return this.ensureWorkspaceServers(options, true); |
There was a problem hiding this comment.
Repeat the post-publication token check after rebuilding
When two sibling plugin mutations overlap one slow serve, the first token change enters this branch, but the rebuilt call is returned directly and therefore bypasses getToolsForWorkspace()'s post-publication check. A second mutation that starts after the rebuild's preflight/discovery can consequently publish and return another stale plugin instance, which remains usable until a later serve. Fresh evidence beyond the prior single-mutation finding is this direct return path; loop the token check/rebuild until publication is bracketed by an unchanged token.
AGENTS.md reference: AGENTS.md:L150-L150
Useful? React with 👍 / 👎.
| // after a cross-process mutation (every override write persists before | ||
| // publishing), so drop the cache and let callers' fresh disk snapshots | ||
| // through. | ||
| this.latestWorkspaceOverrides.clear(); |
There was a problem hiding this comment.
Invalidate recorded override snapshots during sibling sweeps
When this sweep detects a sibling uninstall, clearing only latestWorkspaceOverrides does not make the current manager disk-authoritative: ensureWorkspaceServers() copies that cache into options and stores it in lastWorkspaceRequestOptions before awaiting the sweep. After pruning completes and the same plugin name is reinstalled, getPrompt() can refresh from that retained pre-prune enable and start the default-disabled replacement server. Fresh evidence beyond the earlier latest-cache finding is this separate recorded-options path and its pre-sweep publication ordering; refresh or invalidate those snapshots as part of the sweep.
AGENTS.md reference: AGENTS.md:L150-L150
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: d9f1a374b1
Only the user who started this review can view the report in Codex.
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| await this.retireCrossProcessPluginInstances(); | ||
| return this.ensureWorkspaceServers(options, true); |
There was a problem hiding this comment.
Security: Reload overrides before rebuilding after sibling mutations
Requires Agent Plugins, two Xum processes sharing one home, and a same-name reinstall. A caller can read the old enabledServers before a sibling prunes it; this rebuild then passes the same stale options back into startup. The replacement MCP server is default-disabled, but the stale key enables and spawns it. Fresh evidence beyond the earlier cache finding is that ensureWorkspaceServers captures per-call overrides before the new sweep clears the cache, so the clear cannot revoke that snapshot. Reload disk-authoritative overrides before rebuilding.
Useful? React with 👍 / 👎.
Summary
v1 of the Agent Plugins install/update UX ("Option B: managed installs"): paste a git URL or
owner/repo[@ref]into Settings → Plugins, get a consent preview of everything the plugin contributes (manifest, every skill, every MCP server command line), and install into~/.mux/pluginswith provenance recorded in a managed-install registry. Update badge + manual update, uninstall with override pruning, all behind the existingagent-pluginsexperiment.Background
PR #3815 shipped Agent Plugins 1.0.0 as discovery-only: users had to
git cloneinto container dirs by hand, with no provenance, no update signal, no uninstall, and no list surface. The design doc (docs/research/agent-plugin-integration-options.mdon branchresearch-agent-plugin-ux) compared five options; Thomas signed off on Option B (managed installs) with the §6 proposed decisions ratified.Approved decisions implemented here
~/.mux/plugins.jsonowned by the install service (atomic, throwing writes; in-process serialized mutations). Lenient-on-read: invalid entries are dropped with a warning, and plugin names are pattern-validated so a malformed entry can never resolve a path outside the container. (Deviation from §6-Q2's letter, following its own contingency: Codex review demonstrated that.passthrough()only affects schema validation — older builds rebuild config.json from known fields on save, so a downgrade would drop an embedded registry section. Q2 priced exactly this: "Cost if wrong: a one-time migration to a separate file." A file older builds never rewrite is the only mechanism that actually survives downgrade round-trips, and owning the write path also makes registry-persistence failures observable for rollback.)source.refis the tracking channel,lockedShais what runs. No ref given ⇒ record the remote default branch + pin its current SHA. Tag/SHA refs are pinned (moved tags surface atag movedwarning badge). Nothing auto-applies, ever.~/.mux/plugin-staging(never inside a discovery container), validated with the samevalidatePluginManifest+ discovery code the runtime uses, listing manifest metadata, every skill name+description, and every MCP command line (rendered against the final install path, incl.PLUGIN_DATAexpansion). Cancelling writes nothing — the preview is stateless; install re-fetches the exact consented SHA and fails loudly if the remote moved.git ls-remotevslockedSha, no fetch, no timers). Applying = temp clone at the new SHA → re-validate → wholesale directory swap (rename-old → promote-new → delete-old, with rollback) → bumplockedSha→ recycle that plugin's running MCP servers via the newMCPServerManager.stopServersWithKeyPrefix(content can change behind an unchanged stdio command line, so the config-signature check cannot notice). Local edits to a managed plugin dir are discarded on update (documented).plugin:<instanceId>:*keys from every local workspace's MCP overrides (reinstall re-attaches the same instanceId, so stale overrides would silently re-enable servers).~/.mux/plugin-data/<instanceId>is preserved behind an "also delete stored plugin data" checkbox, unchecked by default.Settings: Plugins,Install Agent Plugin…,Check for Plugin Updates,Update All Plugins— keyboard rule). No agent-facing installer tool.owner/repo/sub/path[@ref]parses and thesubpathfield is persisted in the source descriptor, but installs reject with "monorepo subpath installs land in v2". Claude Code plugin/marketplace repos fail with a clear message naming the limitation (source stays a discriminated union so an import adapter is additive).Implementation
src/common/config/schemas/agentPluginInstalls.ts(entry + tagged-union source +plugins.jsonfile schema); name grammar shared with the manifest validator viasrc/common/utils/agentPluginName.ts.discoverAgentPluginAt(public single-root wrapper over the existing per-entry discovery, so staged clones get the exact runtime validation);normalizeRepoUrlForCloneextracted tosrc/node/utils/gitUrls.ts(shared with the project clone flow);sourceInput.tsgrammar;AgentPluginInstallService(preview/install/list/uninstall/checkUpdates/update, mutations serialized on an internal queue, staging under~/.mux/plugin-stagingwith stale-dir reclamation,GIT_TERMINAL_PROMPT=0+ SSH BatchMode so private repos without auth fail fast instead of hanging);plugins.*oRPC namespace returningResultvalues;MCPServerManager.stopServersWithKeyPrefixrecycle hook. Backend gating mirrors the MCP provider: the service is constructed withisEnabled: () => experimentsService.isExperimentEnabled(AGENT_PLUGINS).PluginsSettingsSection(list withunmanaged/missing/update available/tag moved/pinnedbadges, two-phase add flow, inline uninstall confirm), experiment-gated section registration + redirect + palette entry.docs/config/mcp-servers.mdx+docs/agents/agent-skills.mdx; Storybook stories with play assertions (consent preview, update states, unchecked-by-default checkbox); unit tests for the input grammar, registry round-trip/self-heal, and the full service lifecycle against real local git remotes (hermetic — local-path remotes exercise the same clone/ls-remote plumbing).Validation
make static-checkgreen (typecheck, ESLint, prettier, docs links); targeted suites: 393 tests across the touched areas (agentPlugins, config, schemas, SettingsPage, palette sources, MCPServerManager, oRPC router, projectService) all pass;test-storybookpasses for the new stories.make dev-server-sandboxinstance (screenshots in the workspace transcript): enabled the experiment via Settings → Experiments (Plugins section appeared immediately), installed a local fixture repo through the full preview → consent → install flow, verified the on-disk registry entry + plugin tree (no.git), advanced the fixture remote →update availablebadge appeared on "Check for updates" → Update bumpedlockedSha/version/updatedAt, uninstall (checkbox unchecked) removed dir + registry but preservedplugin-data, and the reinstalled plugin's MCP server surfaced in Settings → MCP asplugin · …default-disabled/read-only.Risks
~/.mux/plugins.json;config.jsonload/save is untouched. Malformed registry entries degrade to "unmanaged dir" rather than errors; downgrade-safe because older builds never touch the file.stopServersWithKeyPrefixonly stops matching workspaces' server sets; they restart lazily on next use, same as the idle-timeout path. No behavior change for non-plugin servers.agent-pluginsoff, the service throws, the section/palette entry hide, and no new code paths run.Judgement calls
installre-fetches the exact consented SHA (direct SHA fetch, falling back to branch clone + HEAD verification) rather than keeping the preview clone on disk between preview and confirm — a stateless preview means cancel/crash cannot leave partial state, at the cost of a second shallow clone on confirm..git(plain content snapshot): the registry holds all provenance, updates replace the dir wholesale, and a live checkout would only invite in-place edits that updates discard.plugin.json#namechanged): container-entry names are identity (instanceId → PLUGIN_DATA, workspace overrides), so renames require uninstall/reinstall.Update All Pluginsapplies onlyupdate-availableentries; moved tags stay per-plugin manual (a mutated tag deserves the section's warning, not a bulk apply).Deferred (per §5/§6 of the design)
subpathinstalls (sparse checkout; grammar + schema already in place), content-addressed store + symlinked container entries, dev-mode/local-path installs, unmanaged-dir adoption ("convert to managed"),Pinrow action,bun run debug plugin …CLI +/pluginslash command.archive+sha256 / seed dirs for air-gap, restore-from-lock, catalogs/marketplace (Claude marketplace import adapter only on demonstrated demand).autoUpdateboolean reserved in the schema, unused), agent-facing install tool, Claude Code marketplace compatibility.Post-review hardening (Codex rounds 1–20)
20 review rounds of fixes folded into this diff
Highlights beyond the original plan (full round-by-round history in the PR review threads):
plugins.jsonwith lossless raw-document writes (unknown envelope/entry/tombstone fields from newer builds survive rewrites), strict-mode reads for mutations vs lenient reads for list, raw-entry collision checks, non-ENOENT read errors refuse mutations.pendingOverridePrunestombstones (pessimistic commit, retry on list, reconciliation against deleted workspaces, reinstall gate) so a temporarily unreachable checkout can never let a reinstall silently re-enable a pruned server.workspace.mcp.getreturns{ overrides, revision };setrequiresexpectedRevisionand rejects stale dialog snapshots (serialized check-and-set), and the uninstaller's prune retries on conflict — a stale open dialog can no longer resurrect prunedplugin:keys.closeInvalidatedInstancesThenPublishre-scans until the invalidation clock is stable and publishes synchronously in the same continuation, closing the microtask window where a mid-startup plugin swap could publish (and keep alive) a server from a deleted tree. Regression test interleaves the swap into the exact yield window.break-allon plugin name/location/source lines + pinned 390px story with a max-length-name overflow assertion.Two P2 follow-ups are documented (not in this PR) in this comment: stale workspace-switch modal loads, and prefix-stop retry-marker publish ordering.
Rebase + experimental label
main(squashed to one feature commit): merged this branch's install contract with main's independently-landedagentPlugins.tsoRPC schemas (slash commands/composition inspector), re-ported the stable-clock publication onto the MCP SDK v2mcpServerManager, and adopted main's SSH→HTTPS clone fallback into the extractedgitUrls.ts(installer records the primary URL only, documented).FlaskConicalnav icon + in-section warning banner.dev-server-sandbox(install → consent preview incl. a deliberately-invalidmcp.jsondiagnostic → update badge → atomic update → read-only MCP row → uninstall with data-preservation default); screenshots in the workspace transcript.Generated with
mux• Model:anthropic:claude-fable-5• Thinking:xhigh• Cost:$327.63