Skip to content
Source
Sign inSign up
pingdotgg/t3code

provider update advisories #2312

Mergedjustsomelegs(GitHub profile, opens in a new tab)merged 36 commits intomain fromrefs/pull/2312/headmerged by juliusmarminge View on GitHub

What Changed

Compared to main, this PR adds provider update advisories and update-state UI for installed providers.

Server-side:

  • adds provider version lifecycle/update state tracking
  • adds provider updater logic and related contract/RPC plumbing so the UI can know when a provider has an update available, is updating, succeeded, or failed

Web-side:

  • adds provider update toasts with a one-click Update action
  • adds a sidebar provider update pill for in-progress, success, and failure states
  • adds provider-specific success/failure copy
  • updates provider settings status copy to Up to date.
  • smooth-scrolls to the providers section when opening settings from update UI entry points

Also includes tests covering the update lifecycle, updater behavior, notification logic, and the rebased provider registry fixture change.

Why

main does not have provider update advisories or a dedicated way to surface provider update state in the UI.

This PR adds that missing flow so users can:

  • see when an installed provider has an update available
  • trigger the update directly from the UI
  • see update progress and result state in a persistent place
  • get clearer provider status after the update completes

The toast handles the action. The sidebar pill handles ongoing state and final status.

UI Changes

Compared to main:

Before:

  • no provider update advisory UI
  • no provider update progress/status pill
  • provider settings did not show post-update status

After:

  • outdated providers can surface update toasts with an Update action
  • the sidebar shows provider update progress/result state
  • success auto-dismisses after a short timeout
  • failure remains visible until dismissed
  • provider settings show Up to date. after a successful update
TOASTS Screenshot 2026-04-23 140501 SETTINGS Screenshot 2026-04-23 122852

https://github.com/user-attachments/assets/b92b92e7-1c46-436b-9718-09f1c2e72f58

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add provider update advisories, one-click updates, and version tracking across AI provider drivers

  • Adds version advisory support to Claude, Codex, Cursor, and OpenCode drivers: each driver now queries npm/Homebrew/native CLI for the latest version and attaches a versionAdvisory (status, versions, update command) to provider snapshots.
  • Introduces ProviderMaintenanceRunner and providerMaintenance modules to resolve per-driver update capabilities, coordinate serialized update command execution, and capture bounded stdout/stderr with timeout control.
  • Exposes a new server.updateProvider RPC/IPC method (WebSocket + LocalApi) that triggers provider updates and returns updated provider snapshots.
  • Adds a dedicated Providers settings panel with per-card update UI: an 'Update available' popover with a one-click 'Update now' button or clipboard copy for the update command.
  • Adds ProviderUpdateLaunchNotification (app-shell toast) and SidebarProviderUpdatePill (sidebar footer) to surface update prompts at launch with auto-dismiss, progress tracking, and navigation to provider settings.
  • Persists dismissed notification keys in client settings and localStorage via providerUpdateDismissal utilities.
  • Risk: makeManagedServerProvider now requires a maintenanceCapabilities field (breaking change for callers); driver environments must provide HttpClient.
Macroscope summarized 55f46fa.

Open in Devin Review

Note

High Risk Adds a new server-side update runner that executes provider update commands and threads volatile update state through the provider registry and WebSocket RPC, which is security- and stability-sensitive. Also changes provider snapshot construction/enrichment and persistence behavior, increasing risk of regressions in provider status caching and UI state.

Overview Adds provider update advisories and one-click updates. Provider drivers now compute maintenanceCapabilities and enrich snapshots with a versionAdvisory fetched via HTTP (npm latest) so the UI can detect “behind latest” providers.

Introduces an update execution flow. A new ProviderMaintenanceRunner runs allowlisted update commands (with locking, timeouts, and truncated output capture), exposes it via serverUpdateProvider WebSocket RPC, and projects per-instance updateState into provider snapshots without persisting it.

Refactors snapshot/caching plumbing to support this state. makeManagedServerProvider now requires maintenanceCapabilities; ProviderRegistry adds helpers to merge snapshots while preserving model capabilities on empty refreshes and only persists refreshed instances; and stream text collection is centralized via collectUint8StreamText (also reused by VCS output collection).

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 55f46fac19bb660cc57939957e800e1c369b6495. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 343c17c5-6351-43e2-9829-63a3c893691d

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Tip

      💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

      Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

      • Generate code and open pull requests
      • Plan features and break down work
      • Investigate incidents and troubleshoot customer tickets together
      • Automate recurring tasks and respond to alerts with triggers
      • Summarize progress and report instantly

      Built for teams:

      • Shared memory across your entire org—no repeating context
      • Per-thread sandboxes to safely plan and execute work
      • Governance built-in—scoped access, auditability, and budget controls

      One agent for your entire SDLC. Right inside Slack.

      👉 Get started


      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. just merged a large refactor on how drivers work and is registerred so this will need to be updated, i can review it when it is

    5. @juliusmarminge this has been rebased now :)

    6. github-actions[bot](GitHub profile, opens in a new tab) removed labelsvouch:unvouched

    7. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    8. where is the update button?

      CleanShot 2026-05-02 at 00 04 20@2x
    9. and there should be some "dismiss until next update" or something so it doesn't reprompt every load:

      https://github.com/user-attachments/assets/0c405d34-ae2a-4627-9e9a-2a516512bdea

    10. @justsomelegs is attempting to deploy a commit to the Ping Labs Team on Vercel.

      A member of the Team first needs to authorize it.

    11. @@ -320,0 +383,21 @@
      383+ next.delete(provider);
      384+ } else {
      385+ next.set(provider, state);
      386+ }
      387+ return next;
      388+ });
      389+
      390+ const existingProviders = yield* Ref.get(providersRef);
      391+ const matchingProviders = existingProviders.filter(
      392+ (candidate) => candidate.driver === provider,
      393+ );
      394+ if (matchingProviders.length === 0) {
      395+ return existingProviders;
      396+ }
      397+
      398+ const nextProviders = yield* Effect.forEach(matchingProviders, applyProviderUpdateState, {
      399+ concurrency: "unbounded",
      400+ });
      401+ return yield* upsertProviders(nextProviders, {
      402+ persist: false,
      403+ });

      Redundant double-application of update state in upsertProviders

      Low Severity

      setProviderUpdateState applies applyProviderUpdateState to the matching providers at line 398, then passes the result into upsertProviders which immediately applies applyProviderUpdateState again at line 323-329. Both reads resolve the same updateStatesRef value (already updated in step one), producing identical results. The first application in setProviderUpdateState is unnecessary since upsertProviders unconditionally re-applies it.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c6ed36f3313032a92c26cbe6ef682459c7e33fd2. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -488,3 +515,11 @@
      488515 const availableEditors = useServerAvailableEditors();
      489516 const observability = useServerObservability();
      490517 const serverProviders = useServerProviders();
      518+ const providerUpdateCandidates = useMemo(
      519+ () => collectProviderUpdateCandidates(serverProviders),
      520+ [serverProviders],
      521+ );
      522+ const providerUpdateCandidateByInstanceId = useMemo(
      523+ () => new Map(providerUpdateCandidates.map((candidate) => [candidate.instanceId, candidate])),
      524+ [providerUpdateCandidates],
      525+ );

      Multi-instance providers only show update button on one card

      Medium Severity

      providerUpdateCandidateByInstanceId is built from providerUpdateCandidates, which is deduped by driver (one representative per driver). The map is keyed by the representative's instanceId. When rendering each row, providerUpdateCandidateByInstanceId.get(liveProvider.instanceId) will return undefined for any non-representative instance of the same driver. Users with multiple instances of the same provider (e.g. codex_personal and codex) will only see the Update button on one card, making the feature invisible for the other instances.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c6ed36f3313032a92c26cbe6ef682459c7e33fd2. Configure [here](https://www.cursor.com/dashboard/bugbot).
    12. @juliusmarminge do you want me to fix these issue presented by Bugbot? don't mess with anything if your mid doing something or have already done it

    13. @@ -0,0 +28,21 @@
      28+
      29+function writeProviderUpdateDismissals(document: ProviderUpdateDismissals): void {
      30+ try {
      31+ setLocalStorageItem(
      32+ PROVIDER_UPDATE_DISMISSALS_STORAGE_KEY,
      33+ document,
      34+ ProviderUpdateDismissalsSchema,
      35+ );
      36+ } catch {
      37+ // Dismissal state is best-effort UI state; a storage failure should not block the toast.
      38+ }
      39+}
      40+
      41+export function isProviderUpdateNotificationDismissed(
      42+ dismissalKey: string | null | undefined,
      43+): boolean {
      44+ if (!dismissalKey) {
      45+ return false;
      46+ }
      47+ return readProviderUpdateDismissals().keys.includes(dismissalKey);
      48+}
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low src/providerUpdateDismissal.ts:41

      isProviderUpdateNotificationDismissed checks dismissalKey against stored keys without trimming, but dismissProviderUpdateNotification trims before storing. If a caller dismisses " key " and later checks " key ", the check returns false because the stored key is "key".

       export function isProviderUpdateNotificationDismissed(
         dismissalKey: string | null | undefined,
       ): boolean {
         if (!dismissalKey) {
           return false;
         }
      -  return readProviderUpdateDismissals().keys.includes(dismissalKey);
      +  return readProviderUpdateDismissals().keys.includes(dismissalKey.trim());
       }
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/providerUpdateDismissal.ts around lines 41-48:
      
      `isProviderUpdateNotificationDismissed` checks `dismissalKey` against stored keys without trimming, but `dismissProviderUpdateNotification` trims before storing. If a caller dismisses `"  key  "` and later checks `"  key  "`, the check returns `false` because the stored key is `"key"`.
      
      Evidence trail:
      apps/web/src/providerUpdateDismissal.ts lines 43-48 (isProviderUpdateNotificationDismissed - no trim), lines 50-59 (dismissProviderUpdateNotification - trims at line 51), lines 78-80 (useDismissedProviderUpdateNotificationKeys also trims). Test file at apps/web/src/providerUpdateDismissal.test.ts shows callers use clean strings like 'opencode:1.14.33'.
    14. @@ -206,3 +215,4 @@
      206215 models: input.models,
      207216 slashCommands: [...(input.slashCommands ?? [])],
      208217 skills: [...(input.skills ?? [])],
      218+ ...(versionAdvisory ? { versionAdvisory } : {}),

      Dead code: driver parameter never passed by callers

      Low Severity

      The new optional driver parameter on buildServerProvider and its associated versionAdvisory computation are never used. All callers in ClaudeProvider.ts, CodexProvider.ts, CursorProvider.ts, and OpenCodeProvider.ts continue to call buildServerProvider without passing driver. The createProviderVersionAdvisory branch is unreachable dead code that adds confusion about where version advisories are sourced (they actually come exclusively from the enrichSnapshot callbacks).

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1589e67aa0c11b2ad88c16a5e08b72b8f4ce195d. Configure [here](https://www.cursor.com/dashboard/bugbot).
    15. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low

      https://github.com/pingdotgg/t3code/blob/544cddd94ccfb47e11bce286cbc71e0d93a223a7/apps/server/src/ws.ts#L143

      Each WebSocket connection instantiates its own providerUpdater with isolated runningTargetsRef and updateLocks semaphores. This allows two different clients to trigger simultaneous updates to the same provider, bypassing the intended cross-connection locking. For example, concurrent npm install -g commands from different clients will race instead of being serialized. Consider moving the providerUpdater (and its mutable state) outside makeWsRpcLayer so a single instance is shared across all connections.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/server/src/ws.ts around line 143:
      
      Each WebSocket connection instantiates its own `providerUpdater` with isolated `runningTargetsRef` and `updateLocks` semaphores. This allows two different clients to trigger simultaneous updates to the same provider, bypassing the intended cross-connection locking. For example, concurrent `npm install -g` commands from different clients will race instead of being serialized. Consider moving the `providerUpdater` (and its mutable state) outside `makeWsRpcLayer` so a single instance is shared across all connections.
      
      Evidence trail:
      apps/server/src/ws.ts lines 143-156 (makeWsRpcLayer creates providerUpdater per call), apps/server/src/ws.ts lines 1140-1162 (makeWsRpcLayer called per WebSocket connection inside request handler), apps/server/src/provider/providerUpdater.ts lines 112-117 (runningTargetsRef and updateLocks created inside makeProviderUpdater), apps/server/src/provider/providerUpdater.ts lines 22-29 (SHARED_UPDATE_LOCK_KEYS showing intent to share locks), apps/server/src/ws.ts line 791 (providerUpdater.updateProvider used in RPC handler)
    16. juliusmarmingecommented

      @justsomelegs mind trying it out now? made some changers

    17. @juliusmarminge LGTM, the only things i changed were the toast to track the providers exact provider instanceId instead of collapsing by driver, so it stays aligned with the new instance-scoped update state and updated the tests to accomofate the popover changes you made

    18. yea made some architectural changes since i think this flow will eventually be extended to support installing drivers from and adding a proper onboarding etc

    19. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High

      https://github.com/pingdotgg/t3code/blob/9cf70c0b033411cb73c271feb95166a1d04d7f15/apps/server/src/provider/Layers/CursorProvider.ts#L1217

      enrichCursorSnapshot calls enrichProviderSnapshotWithVersionAdvisory(snapshot) without passing maintenanceCapabilities, so the version advisory uses fallback "manual-only" capabilities with update: null. This causes versionAdvisory.canUpdate to be false and versionAdvisory.updateCommand to be null, even though Cursor supports agent update. The maintenanceCapabilities resolved in CursorDriver should be passed through to enrichProviderSnapshotWithVersionAdvisory.

      ✅ Resolved in 0950b793ad9021d7056201319fdba412a81c42cc

    20. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      There are 4 total unresolved issues (including 3 from previous reviews).

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 55f46fac19bb660cc57939957e800e1c369b6495. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +52,21 @@
      52+ });
      53+ });
      54+
      55+ const withCommandLock: ProviderMaintenanceCommandCoordinatorShape<E>["withCommandLock"] = ({
      56+ targetKey,
      57+ lockKey,
      58+ onQueued,
      59+ run,
      60+ }) =>
      61+ Effect.gen(function* () {
      62+ const acquired = yield* acquireTarget(targetKey);
      63+ if (!acquired) {
      64+ return yield* Effect.fail(input.makeAlreadyRunningError(targetKey));
      65+ }
      66+
      67+ return yield* Effect.gen(function* () {
      68+ const lock = yield* getLock(lockKey);
      69+ if (onQueued) {
      70+ yield* onQueued;
      71+ }
      72+ return yield* lock.withPermits(1)(run);
      cursor[bot](GitHub profile, opens in a new tab)commented

      Queued state always published even without contention

      Low Severity

      onQueued fires unconditionally before acquiring the semaphore permit, meaning every provider update transitions through a "queued" state with message "Waiting for another provider update to finish." even when the semaphore is immediately available and no other update is running. This results in a briefly misleading sidebar pill and state history for single-provider updates with no contention.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 55f46fac19bb660cc57939957e800e1c369b6495. Configure [here](https://www.cursor.com/dashboard/bugbot).
    21. juliusmarminge merged this9b604bc

    22. juliusmarminge closed this

Sign in to join this conversation.