Skip to content

Add top-level plugin switcher tabs - #3516

Open
harjothkhara wants to merge 21 commits into
steipete:mainfrom
harjothkhara:codex/fix-2988-plugin-switcher-tabs
Open

Add top-level plugin switcher tabs#3516
harjothkhara wants to merge 21 commits into
steipete:mainfrom
harjothkhara:codex/fix-2988-plugin-switcher-tabs

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an opt-in topLevel: true provider-plugin manifest field
  • show enabled top-level plugins as stable provider switcher tabs using their manifest name and icon
  • keep singleton plugin content and legacy appended cards reachable in plugin-only configurations
  • route persistent Refresh and Cmd-R to the selected plugin while preserving provider-scoped in-flight state

Product boundary

This changes placement only. Plugins keep the existing sandbox, first-network approval, generic snapshot/details rendering, settings enablement, and provider-data isolation. Plugins without topLevel: true retain appended-card behavior, including when a top-level plugin tab is selected.

Edge-case behavior

Configuration/action Result and production-path coverage
one top-level plugin, no built-ins the visible status item uses its attached plugin menu without an unnecessary switcher; persisted selection and plugin-scoped Refresh remain intact
two top-level plugins + one legacy plugin, no built-ins each top-level tab renders its selected card followed by the reachable legacy card
persistent Refresh / Cmd-R on a plugin tab selected dynamic provider ID enters a plugin-scoped task and dispatches through refreshUserPlugin, not Codex/global refresh
existing enabled/selected plugin settings fixtures initialize persisted settings before controller construction and retain the selection
stale persisted Overview selection with one built-in + plugin tabs no hidden Overview state leaks into Refresh busy-state or viewport selection

Validation

Exact head: b4cd88a019da01001895caf622123c6c8925ad3d

  • swift build --skip-update --target CodexBarCore — passed
  • .build/lint-tools/bin/swiftformat <changed Swift files> — 0 files formatted
  • git diff --check — passed
  • follow-up regressions cover plugin-only width measurement, collision-resistant plugin cache signatures, and plugin-owned menu-open behavior that avoids scheduling a Codex dashboard refresh
  • portable make check phases through repository Python tests — passed
  • architecture gate anchors manually matched to production lines 401, 471, 492, 565, 634, and 731
  • implementation review — READY: exact-head dual review completed and all concrete findings were repaired (ad77955ad8f48b30a7617d1ac5bb08bac99420c51b44a96bfa7ecfd1035401df); one advisory plugin-only status-bar styling enhancement was deferred because it broadens the provider-instance icon pipeline and is not a regression

The focused regressions now exercise the visible attached singleton menu, real selected-plugin refresh dispatch, plugin-only width measurement, cache-signature collisions, and plugin-owned menu-open behavior. The refresh test produces the selected plugin snapshot through an explicitly approved temporary binding and approval store. The local Command Line Tools-only environment lacks Swift Testing, SwiftUI macro implementations, sourcekitdInProc.framework, and Python waitid(WNOWAIT), so the focused Swift test target, full app build, SwiftLint, and sharded suite could not complete locally; GitHub macOS CI is authoritative. No user approval file, Keychain/cookie import, or live account probe was used.

Native app proof was explicitly approved and attempted with ./Scripts/compile_and_run.sh. Release compilation reached the widget target, but this host has no full Xcode installation and cannot load SwiftUIMacros.EntryMacro, so it could not package or launch a fresh bundle. The failure was toolchain-only; no provider probes, browser-cookie imports, Keychain reads, or Keychain changes occurred.

AI assistance: Codex implemented and tested the change. Independent review findings covering singleton status-item reachability, attached-menu identity, stale Overview state, and architecture-gate anchors were reconciled and fixed; the final exact head has a READY receipt.

Fixes #2988

@clawsweeper

clawsweeper Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed September 9, 2026, 3:59 PM ET / 19:59 UTC (Revision 10).

ClawSweeper review

What this changes

Adds opt-in provider-plugin tabs to the merged menu switcher, preserves legacy plugin cards, and routes standard Refresh controls to the selected plugin.

Merge readiness

Blocked before merge - 3 items remain

This remains a useful, owner-approved enhancement absent from current main and the latest release. Earlier concrete findings are addressed, but real native behavior and upgrade compatibility remain unproven.

Priority: P2
Reviewed head: b4cd88a019da01001895caf622123c6c8925ad3d

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and addresses prior defects, but fixture evidence cannot satisfy the native behavior proof gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The menu and Refresh changes have synthetic fixture coverage, but the captured native build stopped before launch, so visible tabs, after-refresh output, and upgraded preferences remain unobserved. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The menu and Refresh changes have synthetic fixture coverage, but the captured native build stopped before launch, so visible tabs, after-refresh output, and upgraded preferences remain unobserved. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 9 items Applicable repository policy: Read the full root AGENTS.md and checked Sources, Tests, docs, and .agents for nested policies and maintainer notes; none were found. Applied provider isolation, isolated approval-store testing, and fresh-bundle UI proof guidance. No builds, tests, or repository mutations were performed.
Owner approval resolves product direction: The OWNER comment explicitly endorses topLevel: true, stable plugin tab identity and icons, settings parity, and unchanged sandbox and approval boundaries: #2988 (comment).
Verified introduced scope: Inspected the complete local merge-base-to-head diff across all 19 changed files. The branch adds 690 lines and removes 112; the supplied truncated patches were supplemented with local source reads.
Findings None None.
Security None None.

How this fits together

CodexBar loads local provider plugins and displays their usage snapshots in its menu bar interface. The switcher combines enabled providers and plugin metadata to select which cards appear and which provider receives Refresh actions.

flowchart TD
  A[Plugin manifests and settings] --> B[Enabled provider identities]
  B --> C[Menu switcher selection]
  C --> D[Selected plugin and legacy cards]
  C --> E[Refresh action]
  E --> F[Existing plugin approval and runtime]
  F --> G[Provider usage snapshot]
  G --> D
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The menu and Refresh changes have synthetic fixture coverage, but the captured native build stopped before launch, so visible tabs, after-refresh output, and upgraded preferences remain unobserved. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The new plugin manifest API changes menu placement and selection; fixture coverage supports compatibility, but preservation of existing preferences and legacy-card reachability has not been observed in a freshly built app after upgrade.
  • Complete next step (P2) - Add real behavior proof from a freshly built app, including selected-plugin Refresh and preserved upgrade settings. Screenshots or recordings are preferred for visible behavior; redacted logs or live output also count. Remove private information before posting. Updating the PR body should trigger another review; otherwise ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production +304/-85 lines; tests +385/-27 lines; docs +1 line Production growth implements the approved tab and refresh integration, while most added lines exercise compatibility and prior edge cases.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #2988
Summary: This PR implements the linked open request for first-class plugin switcher entries; the issue should remain open until implementation lands.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Demonstrate preserved plugin setups (recommended)
    Provide fresh-bundle evidence that existing selections and legacy cards survive upgrade while opted-in plugins remain reachable and refresh correctly.

Technical review

Best possible solution:

Keep the approved opt-in design, with unchanged legacy placement and preferences demonstrated on fresh and upgraded installations.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction: this adds an approved capability, and current-main and release source confirm that plugin tabs are absent.

Is this the best way to solve the issue?

Yes: the opt-in flag reuses existing provider identities, settings, rendering, and approval checks; native compatibility validation is still needed.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5e5a9003efb2.

Labels

Label justifications:

  • P2: This is a bounded, approved navigation improvement for users of local provider plugins.
  • merge-risk: 🚨 compatibility: The manifest API and merged-menu selection behavior expand without observed fresh-install and upgrade compatibility proof.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The menu and Refresh changes have synthetic fixture coverage, but the captured native build stopped before launch, so visible tabs, after-refresh output, and upgraded preferences remain unobserved. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Applicable repository policy: Read the full root AGENTS.md and checked Sources, Tests, docs, and .agents for nested policies and maintainer notes; none were found. Applied provider isolation, isolated approval-store testing, and fresh-bundle UI proof guidance. No builds, tests, or repository mutations were performed. (AGENTS.md:1, b4cd88a019da)
  • Owner approval resolves product direction: The OWNER comment explicitly endorses topLevel: true, stable plugin tab identity and icons, settings parity, and unchanged sandbox and approval boundaries: Feature request: Allow user-installed provider plugins to appear as first-class entries in the provider switcher #2988 (comment).
  • Verified introduced scope: Inspected the complete local merge-base-to-head diff across all 19 changed files. The branch adds 690 lines and removes 112; the supplied truncated patches were supplemented with local source reads. (b4cd88a019da)
  • Current main retains appended plugin cards: Current main enumerates enabled plugins as appended cards and its manifest parser has no topLevel field. This is a distinct missing presentation capability, not a duplicate of supported configuration. (Sources/CodexBar/StatusItemController+UserPlugins.swift:7, 5e5a9003efb2)
  • Latest release lacks dynamic plugin tabs: The v0.57.0 switcher initializer accepts built-in UsageProvider entries only; it has no plugin-provider input. (Sources/CodexBar/StatusItemController+SwitcherViews.swift:48, 45cda6084d64)
  • Previous concrete findings addressed: Singleton selection no longer requires multiple switcher entries, selected plugin content includes legacy cards, and Refresh retains the dynamic provider ID and calls refreshUserPlugin. The refresh fixture records approval and injects its isolated approval store. The earlier review's native-proof request remains outstanding. (Sources/CodexBar/StatusItemController+Actions.swift:245, b4cd88a019da)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add fresh-bundle screenshots or a recording with observable Refresh results and fresh-install/upgrade evidence for singleton, mixed, and plugin-only configurations.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-08T20:09:08.454Z sha 60ce671 :: needs real behavior proof before merge. :: [P1] Keep legacy plugin cards reachable without built-in tabs | [P2] Resolve a sole top-level plugin independently of switcher count | [P2] Route standard Refresh controls to the selected plugin
  • reviewed 2026-09-08T21:13:52.221Z sha 9dc6be9 :: needs real behavior proof before merge. :: [P1] Keep legacy plugin cards reachable without built-in tabs | [P2] Resolve a sole top-level plugin independently of switcher count | [P2] Route standard Refresh controls to the selected plugin
  • reviewed 2026-09-08T21:32:33.696Z sha 7454ac9 :: needs real behavior proof before merge. :: [P1] Keep legacy plugin cards reachable without built-in tabs | [P2] Resolve a sole top-level plugin independently of switcher count | [P2] Route standard Refresh controls to the selected plugin
  • reviewed 2026-09-08T22:58:30.540Z sha 933f47a :: needs real behavior proof before merge. :: [P2] Resolve singleton plugins without the multiple-provider merge gate
  • reviewed 2026-09-08T23:55:51.212Z sha 657bf0a :: needs real behavior proof before merge. :: [P2] Approve the fixture plugin through an isolated approval store
  • reviewed 2026-09-09T00:06:30.241Z sha 4c9575a :: needs real behavior proof before merge. :: [P2] Pass the isolated approval store to the remaining fixture call
  • reviewed 2026-09-09T00:09:51.320Z sha 4c9575a :: needs real behavior proof before merge. :: [P2] Pass the isolated approval store to the remaining fixture call
  • reviewed 2026-09-09T00:29:26.951Z sha 024fb34 :: needs real behavior proof before merge. :: none

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 681c63098f

ℹ️ 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".

Comment on lines +826 to +832
if case let .provider(instanceID) = switcherSelection,
UserProviderPluginRegistry.plugin(for: instanceID) != nil
{
self.addUserPluginMenuCards(
to: menu,
width: context.menuWidth,
selectedPluginID: instanceID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route the menu Refresh action to the selected plugin

When a top-level plugin tab is selected, this branch renders only that plugin's card, but the persistent Refresh row and ⌘R remain in the actionable sections. manualRefreshProvider(for:) resolves merged menus through resolvedMenuProvider(), which discards plugin IDs and returns a first-party provider, so those refresh controls refresh Codex or another fallback rather than the visible plugin. Preserve the selected plugin ID and route this action through refreshUserPlugin(_:) so the tab's standard refresh controls target the content being shown.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T20:00:38.427269Z 681c630 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@harjothkhara

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@harjothkhara

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 9, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Allow user-installed provider plugins to appear as first-class entries in the provider switcher

1 participant