Skip to content

[3544 by Claude Opus 5.5] Plugins: apply declarative contributions (managed MCP servers, local package servers, skills, templates) and OAuth connections - #3565

Merged
propr-dev[bot] merged 5 commits into
3542-epic-plugin-system-xu8from
3544/claude-opus-5-5-plugins-apply-declarative-20261114-0605-5ta
Nov 14, 2026
Merged

propr-dev[bot] merged 5 commits into
3542-epic-plugin-system-xu8from
3544/claude-opus-5-5-plugins-apply-declarative-20261114-0605-5ta

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3544

Branch: 3544/claude-opus-5-5-plugins-apply-declarative-20261114-0605-5ta
Commits: ✅ Changes committed (7d4d979)


AI Processing Completed

Execution Details:

Summary:
I've implemented #3544. An enabled plugin now adds its MCP servers and skill to the extension library as managed items, and its template to the template catalog. Its OAuth connection signs in through the extension OAuth module. Runs pick these items up through the normal library resolution.

Tests: I ran the new Core test (5 cases), the updated plugin store and plugin API route tests, and the extension, OAuth, automation, MCP, OpenAPI and settings-UI suites that touch this code; all pass. gen:openapi:check, plugins:check, the typechecks and zero-warning lint for core and api also pass. I didn't run the full repository suite. Most suites need PROPR_DEMO_MODE=true locally. extensionServerMount, mcpObservableSurface and mcpOperatorSurface fail under that setting and pass with a placeholder GitHub relay configured.

How it works

  • Managed items: library items carry a managedBy marker (plugin id, manifest name, active). An item applies to runs only while its plugin is enabled and nothing awaits an acknowledgement. They default to automatic apply on, limited to the plugin's repository limit.
  • Edit guard: a library save may change only enabled, the repository and agent limits, and automatic apply on a managed item. Changing anything else, removing it, adding a forged one or replacing its credential is refused. For a package server that covers package, version, integrity value, arguments and variables.
  • Sync: every plugin change brings the library in line inside the same database transaction (new code in packages/core/src/plugins/pluginContributions.ts). Credentials come from the plugin's connections; nothing is written when nothing changed.
    • Disabling deactivates the items and keeps their settings and connections, so re-enabling restores them.
    • Uninstalling removes the items. It is refused while an automation adds one of them explicitly, and the message names the automation.
    • A name clash with an existing library item gets the <plugin id>-<name> prefix.
  • Package servers: they use the existing install path. The version and integrity value come from the manifest, the package is installed once without lifecycle scripts, verified at launch, mounted read-only and run through the stdio bridge. With its secret missing the server is skipped with secret_not_configured and the run continues. Without a current acknowledgement it is never installed or launched.
  • OAuth: three new routes start, complete and disconnect an OAuth connection: POST /api/instance/plugins/v1/<id>/connections/<name>/oauth/{start,complete,disconnect}. The extension callback also completes the sign-in. A plugin read now reports connected, not_connected or needs_sign_in.
  • Templates: GET /api/automation-definitions/templates and the list_automation_templates MCP tool include enabled plugins' templates, each with a plugin field naming it.
  • Read model: a plugin read now includes contributions, which links each server and skill to its library item. The OpenAPI spec and client types are regenerated.
  • UI: managed rows in Settings show a "Plugin: " badge and an "Inactive" badge when they don't apply, and have no Remove button.
  • Docs: plugins.md has a new "What an enabled plugin adds" section, and agent-extensions.md and docs/mcp.md are updated.

Choices the issue left open

  • Created at install: managed items exist from install, inactive, so the OAuth connection can be signed in before enabling. They still apply only while the plugin is enabled.
  • Repository limit: changing the plugin's limit resets its managed items' limit to it, overriding per-item edits.
  • Shared OAuth connection: when several servers use one connection, it shows connected only when all of them are signed in.
  • Changed skill files: after an upgrade, a changed skill becomes a new bundle. An automation that added the old bundle then reports it as not found.
  • Template ids: a template keeps its id unless a shipped template or another plugin uses it; then it gets the <plugin id>- prefix.

Decision for you: the new-automation form in the web UI still uses the template list built into the app, so plugin templates show up only through the API and MCP. Making them appear in the form means having the UI fetch the catalog; I left that out to keep this change focused.

Two preview images of the Settings extension list with managed items are attached; they use mocked API data.

Detailed Logs:

  • Conversation: 209 messages
  • Session: 39309e10-eba5-40f4-8144-d81cc2c5544d

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3544-2026-11-14T06-37-04-087Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3544-2026-11-14T06-37-04-087Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've implemented #3544. An enabled plugin now adds its MCP servers and skill to the extension library as managed items, and its template to the template catalog. Its OAuth connection signs in through ...


This PR was created automatically by ProPR after processing issue #3544.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

Managed MCP servers in the extension library

Managed MCP servers in the extension library

Settings → Skills & MCP servers with the example plugin enabled: its remote OAuth server and local package server carry a 'Plugin: example-pack' badge and have no Remove button; the administrator's own server is unchanged. Mocked API data.

Connect sign-in required. Original retained until 2027-02-12T06:37:08.481Z.

View the full-resolution original in ProPR Connect

Managed skill, inactive

Managed skill, inactive

A plugin skill whose plugin is disabled: Plugin badge, Inactive badge and the 'Skill from a plugin' source label. Mocked API data.

Connect sign-in required. Original retained until 2027-02-12T06:37:09.692Z.

View the full-resolution original in ProPR Connect

…d skill to the extension library as managed items, and its template to the template catalog. Its OAuth connection signs in through the extension OAuth module. Runs pick these items up through the normal library resolution.

Tests: I ran the new Core test (5 cases), the updated plugin store and plugin API route tests, and the extension, OAuth, automation, MCP, OpenAPI and settings-UI suites that touch this code; all pass. `gen:openapi:check`, `plugins:check`, the typechecks and zero-warning lint for core and api also pass. I didn't run the full repository suite. Most suites need `PROPR_DEMO_MODE=true` locally. `extensionServerMount`, `mcpObservableSurface` and `mcpOperatorSurface` fail under that setting and pass with a placeholder GitHub relay configured.

How it works
- Managed items: library items carry a `managedBy` marker (plugin id, manifest name, `active`). An item applies to runs only while its plugin is enabled and nothing awaits an acknowledgement. They default to automatic apply on, limited to the plugin's repository limit.
- Edit guard: a library save may change only enabled, the repository and agent limits, and automatic apply on a managed item. Changing anything else, removing it, adding a forged one or replacing its credential is refused. For a package server that covers package, version, integrity value, arguments and variables.
- Sync: every plugin change brings the library in line inside the same database transaction (new code in `packages/core/src/plugins/pluginContributions.ts`). Credentials come from the plugin's connections; nothing is written when nothing changed.
  - Disabling deactivates the items and keeps their settings and connections, so re-enabling restores them.
  - Uninstalling removes the items. It is refused while an automation adds one of them explicitly, and the message names the automation.
  - A name clash with an existing library item gets the `<plugin id>-<name>` prefix.
- Package servers: they use the existing install path. The version and integrity value come from the manifest, the package is installed once without lifecycle scripts, verified at launch, mounted read-only and run through the stdio bridge. With its secret missing the server is skipped with `secret_not_configured` and the run continues. Without a current acknowledgement it is never installed or launched.
- OAuth: three new routes start, complete and disconnect an OAuth connection: `POST /api/instance/plugins/v1/<id>/connections/<name>/oauth/{start,complete,disconnect}`. The extension callback also completes the sign-in. A plugin read now reports `connected`, `not_connected` or `needs_sign_in`.
- Templates: `GET /api/automation-definitions/templates` and the `list_automation_templates` MCP tool include enabled plugins' templates, each with a `plugin` field naming it.
- Read model: a plugin read now includes `contributions`, which links each server and skill to its library item. The OpenAPI spec and client types are regenerated.
- UI: managed rows in Settings show a "Plugin: <id>" badge and an "Inactive" badge when they don't apply, and have no Remove button.
- Docs: `plugins.md` has a new "What an enabled plugin adds" section, and `agent-extensions.md` and `docs/mcp.md` are updated.

Choices the issue left open
- Created at install: managed items exist from install, inactive, so the OAuth connection can be signed in before enabling. They still apply only while the plugin is enabled.
- Repository limit: changing the plugin's limit resets its managed items' limit to it, overriding per-item edits.
- Shared OAuth connection: when several servers use one connection, it shows connected only when all of them are signed in.
- Changed skill files: after an upgrade, a changed skill becomes a new bundle. An automation that added the old bundle then reports it as not found.
- Template ids: a template keeps its id unless a shipped template or another plugin uses it; then it gets the `<plugin id>-` prefix.

Decision for you: the new-automation form in the web UI still uses the template list built into the app, so plugin templates show up only through the API and MCP. Making them appear in the form means having the UI fetch the catalog; I left that out to keep this change focused.

Two preview images of the Settings extension list with managed items are attached; they use mocked API data.
@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 14, 2026
@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR integrates plugin contributions into the existing extension library, OAuth flow, and template catalog. It needs changes before merge because disabling can fail after an upgrade, skill upgrades break explicit automation references, and OAuth registration restrictions are lost.

✅ Managed-item protection — Library saves reject forged managed items, definition changes, removals, and credential replacements.

✅ Runtime reuse — Managed contributions use existing extension resolution and package verification, with tests covering activation, missing credentials, and secret redaction.

This review used static tracing only; no commands were run. The supplied current checks show 29 passed, five pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Manifest updates can prevent disabling

  • Required behavior: Disabling a plugin must deactivate its managed items and stop their application to subsequent runs.

  • Evidence: packages/core/src/plugins/pluginContributions.ts, sync, desired, and refuseReferencedRemoval; packages/core/src/plugins/pluginStore.ts, write.

    1. An enabled plugin contributes a server that an automation explicitly adds.
    2. A ProPR upgrade removes that server from the plugin manifest.
    3. An administrator disables the plugin. The new unconditional contribution synchronization constructs items from the upgraded manifest.
    4. refuseReferencedRemoval finds the automation reference and throws, rolling back the entire transaction, including the disable.

    The plugin remains enabled and its previous managed server remains active. The removal guard protects references, but incorrectly makes deactivation depend on successfully applying an upgrade. The same synchronization also reads and validates skill assets, so unavailable assets can likewise prevent disabling.

    static trace: The refusal occurs inside PluginStore.write’s transaction, before its commit. Existing disable tests keep the manifest and assets unchanged.

  • Minimum fix: Make disabling deactivate the existing managed items without requiring manifest replacement, asset loading, or removal of referenced items. Keep upgrade/removal validation on operations that actually apply those changes.

F2: 🔴 Skill upgrades orphan automation references

  • Required behavior: Updating a managed skill must preserve existing automation references or refuse the replacement; it must not silently remove a configured extension from subsequent runs.

  • Evidence: packages/core/src/plugins/pluginContributions.ts, bundleFor and refuseReferencedRemoval.

    1. An automation explicitly adds a plugin skill’s bundle ID, with that skill’s autoApply disabled.
    2. An upgrade changes the skill files while retaining its manifest name.
    3. A plugin settings change invokes synchronization. bundleFor creates a new UUID and replaces the library skill reference.
    4. refuseReferencedRemoval deliberately excludes this replacement because the manifest item name matches.
    5. The automation still requests the old UUID, which is absent from the library, so its next run skips the skill as not_found.

    Retaining the old bundle’s database row does not preserve its library reference. Automatic application cannot compensate in this supported configuration.

    static trace: The new replacement exception bypasses the existing reference-removal invariant; the supplied resolution tests establish that missing explicit bundle IDs are skipped.

  • Minimum fix: Treat a changed bundle ID as a removal for reference validation and refuse the update while referenced, or migrate affected automation references to the replacement in the same transaction.

F3: 🔴 OAuth registration restrictions are discarded

  • Required behavior: A plugin OAuth connection’s declared registrations must limit the client registration methods used for its sign-in.

  • Evidence: packages/core/src/plugins/pluginContributions.ts, libraryServer; packages/core/src/plugins/pluginStore.ts, startOAuth.

    1. A plugin declares an OAuth connection permitting only metadata_document.
    2. Its provider advertises dynamic registration but does not support client metadata documents.
    3. libraryServer transfers the connection’s scopes into the managed server but discards its registration restrictions.
    4. startOAuth delegates to ordinary extension sign-in without passing or checking the permitted methods.
    5. The ordinary flow falls back to dynamic registration, creating a client through a method the plugin excludes.

    Manifest validation cannot prevent this because the restriction is valid input and is lost during conversion. The immutable managed-item guard preserves the resulting descriptor but does not restore the missing policy.

    static trace: The supplied connection contract defines registrations as a restriction, while the conversion and delegation carry no such restriction.

  • Minimum fix: Carry and enforce the allowed registration methods during managed-server OAuth discovery and registration, including sign-ins initiated through the ordinary extension routes. Refuse sign-in when no permitted method is available.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Update the introductory status note

The opening work-in-progress note in docs/docs/features/plugins.md still says contributions and OAuth are future work and installed plugins have no effect on runs. Updating it would make the introduction consistent with the new detailed documentation. This is documentation cleanup, not a runtime blocker.

Score

The implementation has useful integration coverage and reuses established runtime protections, but the lifecycle and OAuth contract defects require correction. Pending checks do not independently lower the score.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 3s
  • Tokens: 91,991 (90,376 in / 1,615 out)
  • Cost: $0.88

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 F3 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 09f03e2

Addressed 1 AI review comment (IDs: 6873406730)

Addressed findings F1, F2, F3

Summary of Changes

I've fixed all three findings, and each has a regression test in packages/core/test/pluginContributions.test.ts. I ran the new tests against the old code: all three fail there, and so does the first existing test, because I updated its assertion for the new marker field. With the fix, all 8 tests in that file pass. The OAuth, plugin store, extension library usage, OAuth route and plugin route suites also pass (31 tests). The core and shared typechecks, zero-warning lint on the changed source, and gen:openapi:check all pass.

F1: Disabling no longer depends on applying an upgrade.

  • A disable now only sets the plugin's existing managed items to inactive. It doesn't apply the new manifest, read skill files, or add or remove anything. The change is in pluginContributions.ts sync and pluginStore.ts setEnabled.
  • Other plugin changes still apply the upgrade with its checks. Changing settings, enabling, setting repositories or approving still fails on missing skill files or on a removed item that an automation adds.
  • Test: an upgrade drops a server an automation adds, and the skill files can't be read. The disable succeeds, the items stay as they were but inactive, and runs get none of them. A settings change is refused with each error in turn, then goes through once the automation no longer adds the server.

F2: A changed skill no longer silently breaks an automation that adds it.

  • Automations refer to skills by bundle ID, so the removal check now compares bundle IDs instead of manifest names. If an upgrade changes a skill's files while an automation adds the old bundle, the plugin change is refused with the automation's name, and the new bundle isn't stored.
  • Test: with automatic apply off, the change is refused and the automation's run keeps the skill. Disabling still works. Once the automation stops adding the skill, re-enabling stores the new bundle.
  • This means an administrator can't apply such an upgrade until they remove the skill from the automation. Afterwards they have to add the new bundle themselves.

F3: OAuth sign-in only uses the registration methods the plugin allows.

  • A managed OAuth server now carries the connection's allowed methods on its plugin marker (managedBy.registrations). An administrator can't change or remove it through the library.
  • Sign-in tries only those methods, in the listed order, and is refused with HTTP 409 when the provider supports none of them. This check lives in startSignIn, so it applies to both the plugin sign-in route and the ordinary extension route.
  • Servers that aren't managed by a plugin choose a method exactly as before.
  • Test: the plugin allows only metadata_document and the provider offers only dynamic registration. Both routes refuse, no client is registered and no sign-in record is left behind. When the provider supports metadata documents, sign-in uses one.

I also updated the docs (plugins.md, agent-extensions.md) and the OpenAPI description, and regenerated the spec and client types.

Two things I noticed but didn't change:

  • If an upgrade narrows a plugin's allowed methods, an existing connection signed in with a method no longer allowed stays connected and keeps refreshing. The restriction only applies to new sign-ins.
  • If an upgrade lands while a sign-in is already in progress, the sign-in completes with the method chosen when it started.

There's no visual change, so I made no previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 9m 4s
  • Tokens: 4,477,557 (4,454,588 in / 22,969 out)
  • Cost: $1.95

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…st in `packages/core/test/pluginContributions.test.ts`. I ran the new tests against the old code: all three fail there, and so does the first existing test, because I updated its assertion for the new marker field. With the fix, all 8 tests in that file pass. The OAuth, plugin store, extension library usage, OAuth route and plugin route suites also pass (31 tests). The core and shared typechecks, zero-warning lint on the changed source, and `gen:openapi:check` all pass.

I've fixed all three findings, and each has a regression test in `packages/core/test/pluginContributions.test.ts`. I ran the new tests against the old code: all three fail there, and so does the first existing test, because I updated its assertion for the new marker field. With the fix, all 8 tests in that file pass. The OAuth, plugin store, extension library usage, OAuth route and plugin route suites also pass (31 tests). The core and shared typechecks, zero-warning lint on the changed source, and `gen:openapi:check` all pass.

**F1: Disabling no longer depends on applying an upgrade.**
- A disable now only sets the plugin's existing managed items to inactive. It doesn't apply the new manifest, read skill files, or add or remove anything. The change is in `pluginContributions.ts` `sync` and `pluginStore.ts` `setEnabled`.
- Other plugin changes still apply the upgrade with its checks. Changing settings, enabling, setting repositories or approving still fails on missing skill files or on a removed item that an automation adds.
- Test: an upgrade drops a server an automation adds, and the skill files can't be read. The disable succeeds, the items stay as they were but inactive, and runs get none of them. A settings change is refused with each error in turn, then goes through once the automation no longer adds the server.

**F2: A changed skill no longer silently breaks an automation that adds it.**
- Automations refer to skills by bundle ID, so the removal check now compares bundle IDs instead of manifest names. If an upgrade changes a skill's files while an automation adds the old bundle, the plugin change is refused with the automation's name, and the new bundle isn't stored.
- Test: with automatic apply off, the change is refused and the automation's run keeps the skill. Disabling still works. Once the automation stops adding the skill, re-enabling stores the new bundle.
- This means an administrator can't apply such an upgrade until they remove the skill from the automation. Afterwards they have to add the new bundle themselves.

**F3: OAuth sign-in only uses the registration methods the plugin allows.**
- A managed OAuth server now carries the connection's allowed methods on its plugin marker (`managedBy.registrations`). An administrator can't change or remove it through the library.
- Sign-in tries only those methods, in the listed order, and is refused with HTTP 409 when the provider supports none of them. This check lives in `startSignIn`, so it applies to both the plugin sign-in route and the ordinary extension route.
- Servers that aren't managed by a plugin choose a method exactly as before.
- Test: the plugin allows only `metadata_document` and the provider offers only dynamic registration. Both routes refuse, no client is registered and no sign-in record is left behind. When the provider supports metadata documents, sign-in uses one.

I also updated the docs (`plugins.md`, `agent-extensions.md`) and the OpenAPI description, and regenerated the spec and client types.

Two things I noticed but didn't change:
- If an upgrade narrows a plugin's allowed methods, an existing connection signed in with a method no longer allowed stays connected and keeps refreshing. The restriction only applies to new sign-ins.
- If an upgrade lands while a sign-in is already in progress, the sign-in completes with the method chosen when it started.

There's no visual change, so I made no previews.

PR: #3565
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 09f03e2 are holding the loop back:

  • Classify changed surfaces — not finished
  • Validate Changes — not finished
  • Full Test Suite Shard 4/4 — not finished
  • Full Test Suite Shard 3/4 — not finished
  • Full Test Suite Shard 2/4 — not finished
  • Full Test Suite Shard 1/4 — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR integrates plugin contributions into the existing extension library, OAuth flow, and template catalog. It needs changes before merge to address three reachable correctness failures.

✅ Transactional contributions — Plugin mutations and library synchronization share a database transaction, including refusal of referenced-item removal.

✅ Managed-item protection — Library saves reject definition changes, forged ownership markers, removal, and credential replacement.

✅ Runtime coverage — Added tests exercise package installation, missing credentials, OAuth, disabling, and referenced skill upgrades.

This is a static review of the supplied code; no commands were run. Current checks show 29 passed, five pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F4: 🔴 Disabling depends on decrypting credentials

  • Required behavior: Disabling must deactivate existing managed items while retaining their credentials, including recovery when the credential encryption root is unavailable or mismatched.

  • Evidence: packages/core/src/plugins/pluginStore.ts, applyContributions; packages/core/src/plugins/pluginContributions.ts, sync.

    1. Restore a database containing an enabled plugin and encrypted credentials under a different encryption root.
    2. Call setEnabled(..., false). The mutation requests deactivateOnly, but applyContributions still decrypts the plugin’s token connections.
    3. Decryption fails and rolls back the disable. Even without token connections, sync unconditionally calls library.unseal(head), so encrypted library credentials can cause the same failure.
    4. The plugin and its managed items remain enabled; the administrator cannot deactivate them through the plugin endpoint.

    The transaction preserves consistency but also rolls back the requested recovery action. deactivateOnly avoids asset loading, not credential decryption. static trace: both unconditional decryption paths are present in the diff; the supplied extension documentation explicitly supports disabling under a mismatched root.

  • Minimum fix: Skip connection decryption for deactivation and carry the existing sealed library credentials through the deactivation revision using the library’s unchanged-credentials mechanism.

F5: 🔴 Pre-registered OAuth cannot be configured

  • Required behavior: A supported plugin OAuth registration method must have a usable configuration and sign-in path.

  • Evidence: packages/core/src/plugins/pluginContributions.ts, libraryServer; packages/core/src/extensions/extensionOAuth.ts, chooseRegistration; packages/core/src/extensions/extensionManagedItems.ts, assertManagedItemsUnchanged.

    1. Install a valid plugin whose OAuth connection permits only preregistered.
    2. Its managed server receives the permitted registration methods, but libraryServer supplies no clientId. The supplied manifest schema also explicitly omits clientId.
    3. Start OAuth. chooseRegistration considers pre-registration unavailable because server.clientId is absent, and sign-in returns 409.
    4. Attempting to configure the client through the library is rejected as a managed-definition edit; replacing its client credential is also prohibited. The plugin cannot connect.

    Validation accepts this registration configuration, while the managed-item protections close the existing configuration route. static trace: verified against the supplied manifest contract, server conversion, registration selection, and edit guards.

  • Minimum fix: Provide a plugin-owned configuration path for the pre-registered client ID and optional sealed client secret, and project them into the managed OAuth server.

F6: 🔴 Template prefixes can create duplicate IDs

  • Required behavior: Template catalog IDs must uniquely identify templates after collision resolution.

  • Evidence: packages/core/src/plugins/pluginTemplates.ts, pluginTemplateIds and automationTemplateCatalog.

    1. Enable plugins alpha and beta, each contributing template digest, and plugin gamma, contributing template alpha-digest.
    2. The raw-name count detects the two digest entries and assigns them alpha-digest and beta-digest.
    3. The original alpha-digest occurs only once, so gamma’s template retains that ID.
    4. The catalog now contains two distinct templates identified as alpha-digest; contribution views also publish the ambiguous identifier.

    Counting original IDs does not check collisions introduced by prefixing. static trace: the single-pass mapping produces these duplicate outputs directly; no subsequent uniqueness check exists in the catalog assembly.

  • Minimum fix: Allocate IDs deterministically against both original and generated IDs, resolving secondary collisions and preserving uniqueness against shipped templates.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Refresh the introductory status note

The existing “Work in progress” note in docs/docs/features/plugins.md still says contributions and OAuth are future work and installed plugins have no effect on runs. Updating it would align the introduction with the new documentation. This is documentation cleanup, not a runtime blocker.

Score

The implementation has useful integration coverage and reuses established runtime protections, but credential recovery, pre-registered OAuth, and template identity need localized corrections. Pending checks have not been treated as failures.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 16s
  • Tokens: 93,955 (92,383 in / 1,572 out)
  • Cost: $0.89

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F4 F5 F6 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit d05386b

Addressed 1 AI review comment (IDs: 6873721499)

Addressed findings F4, F5, F6

Summary of Changes

I fixed all three findings, and each has a regression test in packages/core/test/pluginContributions.test.ts. I ran the three new tests against the previous code and all three fail there. With the fix, all 11 tests in that file pass. The plugin routes, plugin store, extension OAuth, database export, OpenAPI coverage and conformance, route authorization and template catalog suites also pass (167 tests). Typecheck, zero-warning lint on the changed files and gen:openapi:check pass for core, shared and api.

F4: disabling no longer decrypts anything

  • A disable now skips unsealing the plugin's connections in pluginStore.ts, and the sync no longer unseals the library credentials. It writes the next revision with the library's existing "credentials unchanged" option, so the sealed bytes carry over as they are. I had to export that option (UNCHANGED_CREDENTIALS) from extensionProfileStore.ts.
  • Same defect, same fix: an installed plugin that an upgrade removed from the registry also only keeps its items as they are, so it now takes this path too.
  • Test: enable, sign in, then disable through a store using a different encryption root. All managed items become inactive and the credential statuses are kept. The new revision holds the previous sealed bytes, carried over without being decrypted. Re-enabling under the original root brings the token and the OAuth connection back.

F5: a pre-registered OAuth client can now be configured

  • New route PUT /api/instance/plugins/v1/<id>/connections/<name>/oauth/client, with { "client": { "clientId", "clientSecret"? } } to set it or { "client": null } to clear it.
  • The client is sealed in plugin_secrets under the connection's name and is never returned. A plugin read shows who configured it in setBy/setAt.
  • It is only accepted when the connection's registrations include preregistered; otherwise the route returns 409.
  • The sync puts the client id on the managed server's clientId and the secret into the library's sealed client secret. The library still can't replace that secret, and changing or clearing the client drops the existing sign-in.
  • Two new audit actions: set_oauth_client and clear_oauth_client. The OpenAPI spec and client types are regenerated.
  • Test: a provider that offers only pre-registration, against a connection limited to preregistered. Sign-in returns 409 until a client is configured, then connects using it. The secret appears in no response, revision or audit row. Clearing the client removes it and drops the connection.

F6: template IDs are now unique

  • Every original template ID, shipped or from a plugin, is reserved first. A prefixed ID that is already taken by an original or by an earlier prefixed ID gets -2, -3, and so on, in registry order.
  • Template views in the plugin read use the same mapping.
  • Test: several overlapping collisions, including the one in the finding, and a check that the result is the same on every call.

plugins.md documents all three changes.

One related problem I left alone: uninstalling still needs to decrypt the library credentials, because it deletes the plugin's credentials. So an uninstall under a mismatched encryption root still fails, but a disable now works there. That's outside these three findings.

There's no preview: none of these changes shows up in the UI.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 10m 47s
  • Tokens: 5,179,960 (5,150,134 in / 29,826 out)
  • Cost: $2.31

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…in `packages/core/test/pluginContributions.test.ts`. I ran the three new tests against the previous code and all three fail there. With the fix, all 11 tests in that file pass. The plugin routes, plugin store, extension OAuth, database export, OpenAPI coverage and conformance, route authorization and template catalog suites also pass (167 tests). Typecheck, zero-warning lint on the changed files and `gen:openapi:check` pass for core, shared and api.

I fixed all three findings, and each has a regression test in `packages/core/test/pluginContributions.test.ts`. I ran the three new tests against the previous code and all three fail there. With the fix, all 11 tests in that file pass. The plugin routes, plugin store, extension OAuth, database export, OpenAPI coverage and conformance, route authorization and template catalog suites also pass (167 tests). Typecheck, zero-warning lint on the changed files and `gen:openapi:check` pass for core, shared and api.

**F4: disabling no longer decrypts anything**
- A disable now skips unsealing the plugin's connections in `pluginStore.ts`, and the sync no longer unseals the library credentials. It writes the next revision with the library's existing "credentials unchanged" option, so the sealed bytes carry over as they are. I had to export that option (`UNCHANGED_CREDENTIALS`) from `extensionProfileStore.ts`.
- Same defect, same fix: an installed plugin that an upgrade removed from the registry also only keeps its items as they are, so it now takes this path too.
- Test: enable, sign in, then disable through a store using a different encryption root. All managed items become inactive and the credential statuses are kept. The new revision holds the previous sealed bytes, carried over without being decrypted. Re-enabling under the original root brings the token and the OAuth connection back.

**F5: a pre-registered OAuth client can now be configured**
- New route `PUT /api/instance/plugins/v1/<id>/connections/<name>/oauth/client`, with `{ "client": { "clientId", "clientSecret"? } }` to set it or `{ "client": null }` to clear it.
- The client is sealed in `plugin_secrets` under the connection's name and is never returned. A plugin read shows who configured it in `setBy`/`setAt`.
- It is only accepted when the connection's `registrations` include `preregistered`; otherwise the route returns 409.
- The sync puts the client id on the managed server's `clientId` and the secret into the library's sealed client secret. The library still can't replace that secret, and changing or clearing the client drops the existing sign-in.
- Two new audit actions: `set_oauth_client` and `clear_oauth_client`. The OpenAPI spec and client types are regenerated.
- Test: a provider that offers only pre-registration, against a connection limited to `preregistered`. Sign-in returns 409 until a client is configured, then connects using it. The secret appears in no response, revision or audit row. Clearing the client removes it and drops the connection.

**F6: template IDs are now unique**
- Every original template ID, shipped or from a plugin, is reserved first. A prefixed ID that is already taken by an original or by an earlier prefixed ID gets `-2`, `-3`, and so on, in registry order.
- Template views in the plugin read use the same mapping.
- Test: several overlapping collisions, including the one in the finding, and a check that the result is the same on every call.

`plugins.md` documents all three changes.

**One related problem I left alone:** uninstalling still needs to decrypt the library credentials, because it deletes the plugin's credentials. So an uninstall under a mismatched encryption root still fails, but a disable now works there. That's outside these three findings.

There's no preview: none of these changes shows up in the UI.

PR: #3565
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR integrates plugin contributions into the existing extension library, OAuth flow, and template catalog. It needs changes before merge: configured OAuth clients can select an incompatible registration method, and plugin repository limits exceed the library contract they now feed.

✅ Transactional synchronization — Plugin mutations and managed library revisions share a transaction, including refusal of referenced-item removal.

✅ Managed-item protection — Library saves reject definition changes, forged ownership markers, removal, and credential replacement while allowing documented item settings.

✅ Lifecycle coverage — Added tests cover disable/re-enable, missing credentials, acknowledgement changes, referenced skill upgrades, and credential secrecy.

This review uses static tracing only. The supplied current checks report no failures, with five checks pending.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F7: 🔴 Configured OAuth clients can never connect

  • Required behavior: A plugin OAuth connection with a configured pre-registered client must select a registration method compatible with the library’s connection identity checks.

  • Evidence: packages/core/src/extensions/extensionOAuth.ts:chooseRegistration, packages/core/src/plugins/pluginContributions.ts:libraryServer

    1. Install a plugin whose OAuth connection permits the default order metadata_document, dynamic, preregistered, and configure its pre-registered client through setOAuthClient.
    2. Synchronization writes that client’s clientId into the managed library server.
    3. Start sign-in against a provider advertising metadata-document support or dynamic registration. The changed chooseRegistration selects that earlier method despite the configured clientId.
    4. The resulting connection cannot belong to the server: connectionBelongsTo explicitly requires registration === 'preregistered' whenever the server has a clientId. Consequently, a successful exchange still cannot produce a usable connected server; reads report it disconnected and runs omit it.

    static trace: The supplied registration selector and unchanged OAuth identity checks establish the mismatch. The new pre-registration test permits only preregistered, so it does not exercise this default multi-method configuration.

  • Minimum fix: When a configured client ID exists and pre-registration is permitted, select preregistered before automatic registration methods. Add coverage with a configured client and a provider advertising the earlier default methods.

F8: 🔴 Valid repository limits become unsavable

  • Required behavior: The existing plugin repository-limit contract must remain usable when its limits are projected into managed contributions.

  • Evidence: packages/core/src/plugins/pluginStore.ts:setRepositories, packages/core/src/plugins/pluginContributions.ts:desired, packages/core/src/plugins/pluginContributions.ts:composeItems

    1. Install a plugin contributing a server or skill.
    2. Set its repository limit to 65 distinct valid repositories, within the published plugin request maximum of 256.
    3. The changed setRepositories requests resetRepositories; desired copies all 65 repositories onto each managed item.
    4. composeItems validates those items against extensionLibraryInputSchema, whose repository maximum is 64. It throws 409 and rolls back the plugin update, incorrectly reporting a library server/skill capacity problem.

    static trace: The supplied plugin request schema permits 256 repositories, while the changed shared library contract and contribution projection enforce 64. Transactional rollback prevents partial state but does not prevent rejection of a previously valid plugin configuration.

  • Minimum fix: Reconcile the repository limits across plugin input and managed-library storage so supported plugin limits can be represented without truncation. Cover the 65-repository boundary and return an accurate validation message for genuinely unsupported limits.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Refresh the introductory documentation

The work-in-progress notice in docs/docs/features/plugins.md still says contributions and OAuth arrive later and installed plugins have no effect on runs. Updating that introductory text would prevent confusion with the new sections below it. This is documentation cleanup rather than a runtime merge blocker.

Score

The implementation has substantial lifecycle coverage and useful reuse of existing safeguards, but two reachable contract failures remain. Current checks show no failures, although five are pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 9s
  • Tokens: 99,577 (98,159 in / 1,418 out)
  • Cost: $0.94

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F7 F8 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 86d46ef

Addressed 1 AI review comment (IDs: 6874064981)

Addressed findings F7, F8

Summary of Changes

I fixed both findings, and each now has regression tests. The three new tests in packages/core/test/pluginContributions.test.ts all fail against the previous code, and with the fix all 14 tests in that file pass.

F7: a configured OAuth client can now connect. Before, a plugin connection that lists metadata_document, dynamic, preregistered (the default order) would pick an automatic method when the provider offered one. That happened even with a client configured, and the resulting connection could never count as the server's. Now chooseRegistration (packages/core/src/extensions/extensionOAuth.ts) always uses pre-registration when a client ID is configured. If the plugin's allowed methods don't include pre-registration, it returns nothing rather than a method that can't work. This matches the existing ownership check, connectionBelongsTo.

  • Callers checked: the plugin sign-in, the extension library sign-in and the library probe all go through this one function, so one fix covers them.
  • New tests: the full flow uses the default order against a provider offering both automatic methods. It checks that sign-in stores preregistered with the configured client, registers nothing dynamically, reads back as connected, includes the server in runs, and that a library sign-in also uses the configured client. A unit test covers the selection rules.
  • Docs: plugins.md now says a configured client always takes precedence.

F8: repository limits up to 256 can be saved again. The library's per-item repository limit is now the plugin limit of 256 (PLUGIN_REPOSITORY_LIMIT) instead of 64, so a plugin's limit copies onto its managed items without being cut short.

  • Error messages: limits over 256 are still refused by the plugin's own check, with "up to 256 owner/repo names". If the library rejects a plugin's items for an item-level reason, the error now names the field that failed rather than always claiming the library is full (pluginContributions.ts, libraryProblem).
  • New test: 65 repositories copy onto all three managed items, the library can still be saved and edited, and the edited limit applies to runs. 256 works, and 257 is refused with the library left unchanged.
  • Knock-on updates: the OpenAPI spec (regenerated, maxItems 64 → 256), agent-extensions.md, and the legacy-profile migration test. That test exceeded the old limit with 80 repositories, so it now uses seven profiles of 40 (280) and expects "at most 256".

Verification: these suites also pass:

  • core: extension library migration, extension OAuth, plugin store, extension library usage
  • API: plugin routes, extension OAuth routes, extension profile routes
  • the Settings extensions UI tests

Typecheck passes for shared, core and api. Lint with zero warnings passes on the changed core files; eslint skips the shared file, as it isn't covered by a lint config. gen:openapi:check passes.

No preview images this time, since neither fix changes anything on screen.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 9m 18s
  • Tokens: 3,539,971 (3,523,366 in / 16,605 out)
  • Cost: $1.50

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…he three new tests in `packages/core/test/pluginContributions.test.ts` all fail against the previous code, and with the fix all 14 tests in that file pass.

I fixed both findings, and each now has regression tests. The three new tests in `packages/core/test/pluginContributions.test.ts` all fail against the previous code, and with the fix all 14 tests in that file pass.

**F7: a configured OAuth client can now connect.** Before, a plugin connection that lists `metadata_document`, `dynamic`, `preregistered` (the default order) would pick an automatic method when the provider offered one. That happened even with a client configured, and the resulting connection could never count as the server's. Now `chooseRegistration` (`packages/core/src/extensions/extensionOAuth.ts`) always uses pre-registration when a client ID is configured. If the plugin's allowed methods don't include pre-registration, it returns nothing rather than a method that can't work. This matches the existing ownership check, `connectionBelongsTo`.
- **Callers checked:** the plugin sign-in, the extension library sign-in and the library probe all go through this one function, so one fix covers them.
- **New tests:** the full flow uses the default order against a provider offering both automatic methods. It checks that sign-in stores `preregistered` with the configured client, registers nothing dynamically, reads back as connected, includes the server in runs, and that a library sign-in also uses the configured client. A unit test covers the selection rules.
- **Docs:** `plugins.md` now says a configured client always takes precedence.

**F8: repository limits up to 256 can be saved again.** The library's per-item repository limit is now the plugin limit of 256 (`PLUGIN_REPOSITORY_LIMIT`) instead of 64, so a plugin's limit copies onto its managed items without being cut short.
- **Error messages:** limits over 256 are still refused by the plugin's own check, with "up to 256 owner/repo names". If the library rejects a plugin's items for an item-level reason, the error now names the field that failed rather than always claiming the library is full (`pluginContributions.ts`, `libraryProblem`).
- **New test:** 65 repositories copy onto all three managed items, the library can still be saved and edited, and the edited limit applies to runs. 256 works, and 257 is refused with the library left unchanged.
- **Knock-on updates:** the OpenAPI spec (regenerated, `maxItems` 64 → 256), `agent-extensions.md`, and the legacy-profile migration test. That test exceeded the old limit with 80 repositories, so it now uses seven profiles of 40 (280) and expects "at most 256".

**Verification:** these suites also pass:
- core: extension library migration, extension OAuth, plugin store, extension library usage
- API: plugin routes, extension OAuth routes, extension profile routes
- the Settings extensions UI tests

Typecheck passes for shared, core and api. Lint with zero warnings passes on the changed core files; eslint skips the shared file, as it isn't covered by a lint config. `gen:openapi:check` passes.

No preview images this time, since neither fix changes anything on screen.

PR: #3565
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR integrates plugin contributions with the existing extension library and OAuth infrastructure, with substantial lifecycle coverage. It needs a localized correction before merge.

✅ Transactional synchronization — Plugin mutations and managed library revisions share a transaction, including refusal of removals referenced by automations.

✅ Managed-item protection — Library saves reject definition changes, forged managed items and credential replacement while allowing the documented item settings.

✅ Runtime coverage — Added tests exercise package installation, missing credentials, disabled contributions, OAuth registration restrictions and skill upgrades.

The supplied current-head status has no failed checks, with four checks pending. This review used static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F9: 🔴 OAuth secret rotation preserves the old connection

  • Required behavior: Changing a plugin’s configured OAuth client must discard the connection established with the previous configuration, as promised by the new API contract and documentation.

  • Evidence: packages/core/src/plugins/pluginStore.ts, setOAuthClient; packages/core/src/plugins/pluginContributions.ts, sync.

    1. Configure a pre-registered client with client ID A and secret old, then complete OAuth sign-in.
    2. Call the new oauth/client endpoint with the same client ID A and a replacement secret new.
    3. setOAuthClient replaces the plugin configuration, and contribution synchronization writes the new library secret.
    4. Synchronization calls discardStaleOAuthConnections, whose supplied implementation checks only server existence, endpoint, authentication type, registration method and client ID. All those values remain unchanged, so the existing OAuth connection survives and the plugin continues reporting connected.

    The API therefore does not perform its promised invalidation on secret rotation. Pending sign-ins also survive this change because their binding checks only endpoint and client ID, allowing a flow started under the old configuration to complete afterward. The transaction protects consistency of the writes but does not add the missing invalidation condition. Existing tests cover clearing the client, which changes the client ID projection; they do not cover replacing only its secret.

    static trace: Verified against the changed setter and synchronization code and the supplied connectionBelongsTo, signInBelongsTo and discardStaleOAuthConnections implementations.

  • Minimum fix: When the configured client changes, including a secret-only replacement, invalidate OAuth connections and pending sign-ins for every managed server using that plugin connection inside the configuration transaction. Add a regression covering a connected server and a pending sign-in when the client ID stays unchanged.

Suggestions

These are optional follow-ups and are not sent to /fix.

S4: 🟢 Refresh the introductory documentation

The opening “Work in progress” note in docs/docs/features/plugins.md still says contributions and OAuth arrive in later releases and installed plugins have no effect on runs. Update it to match the functionality documented later in the same file. This is documentation cleanup rather than a runtime merge blocker.

S5: 🟢 Fetch templates in the automation form

The acknowledged static template list in the web UI prevents users from selecting plugin templates through the normal creation form. A follow-up that fetches the catalog would complete that experience. The API and MCP catalog integration can stand independently within this PR’s stated scope.

Score

The implementation has strong integration and lifecycle tests, but OAuth client replacement leaves stale credential state in place. A focused invalidation fix and regression test should resolve the verified blocker; the remaining checks are pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 4s
  • Tokens: 102,460 (101,187 in / 1,273 out)
  • Cost: $0.97

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F9 S4 S5

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 78d2773

Addressed 1 AI review comment (IDs: 6874382712)

Addressed finding F9

Summary of Changes

I fixed F9. When an administrator replaces a plugin's OAuth client secret but keeps the same client ID, the old OAuth connection and any sign-ins still in progress are now discarded.

What changed

  • setOAuthClient (packages/core/src/plugins/pluginStore.ts) now compares the new client with the stored one, ID and secret both, inside the configuration transaction. If they differ, it discards the OAuth connections and pending sign-ins of every managed server that uses that plugin connection. Setting the exact same client again changes nothing. A stored client that can't be decrypted counts as changed. A client stored on a connection that no longer permits pre-registration is never used by the servers, so clearing it discards nothing.

  • New helper discardOAuthConnectionsOf (packages/core/src/extensions/extensionOAuthState.ts) does the deleting and records a discarded audit entry for each removed connection. It deletes pending sign-ins first, then connections:

    • A sign-in that is still exchanging its code under the old secret finds its pending record gone and is refused.
    • A sign-in that already finished has its new connection deleted by the second step.

    A sign-in that starts while the change is being saved and finishes after it uses the new secret, so it needs no handling.

  • Docs: docs/docs/features/plugins.md now says that replacing only the secret also discards the connection and any sign-in in progress.

Regression test
I added a test to packages/core/test/pluginContributions.test.ts that:

  1. configures a client, signs in, and leaves a second sign-in pending.
  2. sets the identical client and checks that nothing changes.
  3. rotates only the secret, keeping the same client ID, and checks that the connection and pending sign-in are gone, reads report not_connected, the audit entry is written and runs no longer include the server.
  4. checks that the old pending sign-in can no longer complete.
  5. restores the original client and checks that signing in works again.

The test fails against the previous pluginStore.ts. With the fix, all 15 tests in that file pass. The plugin store, extension OAuth, plugin route and extension OAuth route suites also pass (30 tests). The core typecheck and zero-warning lint on the changed source files pass.

Separate issue, not fixed: the extension library has the same gap for servers an administrator added directly. Replacing only the client secret of a pre-registered OAuth server through replaceSecret or a library save keeps its existing connection. This is already the case on main and isn't part of the plugin code this PR changes, so I left it alone.

The change has no visible effect in the UI, so I didn't make a preview.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 6m 28s
  • Tokens: 2,386,638 (2,373,125 in / 13,513 out)
  • Cost: $1.18

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… client secret but keeps the same client ID, the old OAuth connection and any sign-ins still in progress are now discarded.

I fixed F9. When an administrator replaces a plugin's OAuth client secret but keeps the same client ID, the old OAuth connection and any sign-ins still in progress are now discarded.

**What changed**
- **`setOAuthClient`** (`packages/core/src/plugins/pluginStore.ts`) now compares the new client with the stored one, ID and secret both, inside the configuration transaction. If they differ, it discards the OAuth connections and pending sign-ins of every managed server that uses that plugin connection. Setting the exact same client again changes nothing. A stored client that can't be decrypted counts as changed. A client stored on a connection that no longer permits pre-registration is never used by the servers, so clearing it discards nothing.
- **New helper `discardOAuthConnectionsOf`** (`packages/core/src/extensions/extensionOAuthState.ts`) does the deleting and records a `discarded` audit entry for each removed connection. It deletes pending sign-ins first, then connections:
  - A sign-in that is still exchanging its code under the old secret finds its pending record gone and is refused.
  - A sign-in that already finished has its new connection deleted by the second step.

  A sign-in that starts while the change is being saved and finishes after it uses the new secret, so it needs no handling.
- **Docs:** `docs/docs/features/plugins.md` now says that replacing only the secret also discards the connection and any sign-in in progress.

**Regression test**
I added a test to `packages/core/test/pluginContributions.test.ts` that:
1. configures a client, signs in, and leaves a second sign-in pending.
2. sets the identical client and checks that nothing changes.
3. rotates only the secret, keeping the same client ID, and checks that the connection and pending sign-in are gone, reads report `not_connected`, the audit entry is written and runs no longer include the server.
4. checks that the old pending sign-in can no longer complete.
5. restores the original client and checks that signing in works again.

The test fails against the previous `pluginStore.ts`. With the fix, all 15 tests in that file pass. The plugin store, extension OAuth, plugin route and extension OAuth route suites also pass (30 tests). The core typecheck and zero-warning lint on the changed source files pass.

**Separate issue, not fixed:** the extension library has the same gap for servers an administrator added directly. Replacing only the client secret of a pre-registered OAuth server through `replaceSecret` or a library save keeps its existing connection. This is already the case on `main` and isn't part of the plugin code this PR changes, so I left it alone.

The change has no visible effect in the UI, so I didn't make a preview.

PR: #3565
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR integrates plugin contributions with the existing extension library and OAuth flows, with substantial coverage of lifecycle and credential handling. No merge-blocking defect was verified in the supplied code. Merge readiness is conditional on the remaining checks completing successfully.

✅ Transactional synchronization — Plugin mutations synchronize managed items within the same database transaction, including refusal of removals referenced by automations.

✅ Managed-item protection — Library saves reject definition changes, forged managed items, removals and credential replacements while preserving editable limits.

✅ Lifecycle coverage — Added tests cover activation, disabling, upgrades, missing secrets, OAuth registration restrictions and client-secret rotation.

This review used static tracing of the supplied diff and context; no commands or tests were run. Current checks report 30 passed, four pending and no failures.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S6: 🟢 Update the introductory status note

The “Work in progress” note in docs/docs/features/plugins.md still says contributions and OAuth are future work and installed plugins have no effect on runs. Update it to match the functionality documented later on the page. This is a documentation cleanup rather than a runtime blocker.

S7: 🟢 Expose templates in the UI

As acknowledged in the PR description, the new-automation form still uses the built-in template list. Fetching the catalog would make enabled plugins’ templates discoverable through the normal creation flow. This is an optional follow-up because the implemented API and MCP catalog surfaces satisfy the stated scope.

Score

The implementation has strong lifecycle coverage and reuses existing execution boundaries. Static review found no verified blocker; remaining CI checks are pending.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 48s
  • Tokens: 101,967 (101,100 in / 867 out)
  • Cost: $0.94

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S6 S7

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 14, 2026
@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ GitHub auto-merge is turned off for this repository, so ProPR merges this PR itself once it is ready (checks passed or no CI configured, and the review goal met).

To let GitHub merge it the moment required checks pass, enable Settings → General → Pull Requests → Allow auto-merge.

@propr-dev
propr-dev Bot merged commit 4e4052c into 3542-epic-plugin-system-xu8 Nov 14, 2026
50 checks passed
@propr-dev
propr-dev Bot deleted the 3544/claude-opus-5-5-plugins-apply-declarative-20261114-0605-5ta branch November 14, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants