Skip to content

Fix tagged sidebar extension discovery - #5267

Merged
azooz2003-bit merged 4 commits into
mainfrom
fix-extension-host-enabled-identity
Jun 3, 2026
Merged

azooz2003-bit merged 4 commits into
mainfrom
fix-extension-host-enabled-identity

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jun 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • keep sidebar extension points on the macOS 14-compatible .appextensionpoint path
  • scope tagged host extension points to the tagged host bundle id and pass the same id to sample extension builds
  • restore the 14-era public extension point attributes needed for ExtensionFoundation discovery

Verification

  • ./scripts/check-pbxproj.sh
  • ./scripts/reload.sh --tag extfix --swift-frontend-workaround
  • ./scripts/reload-extension.sh --tag extfix --example sample
  • pluginkit -m -v -p com.cmuxterm.app.debug.extfix.cmux.sidebar showed co.manaflow.CMUXExtKitSampleSidebarApp.extfix.Extension registered
  • visually verified the tagged app sees the installed extension and shows the extension approval/rendering path

Notes

  • no macOS 26-only ExtensionFoundation APIs are used; the SDK/host remain macOS 14+ compatible

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Fixes sidebar extension discovery for tagged builds. The host now uses a host-scoped extension point id and restores macOS 14-era attributes so ExtensionFoundation/pluginkit reliably finds extensions.

  • Bug Fixes
    • Host point id now derives from $(PRODUCT_BUNDLE_IDENTIFIER).cmux.sidebar; debug tags resolve to com.cmuxterm.app.debug.<tag>.cmux.sidebar.
    • Restores macOS 14-era public attributes in the .appextensionpoint bundle and keeps the legacy path; adds _EXScopeRestriction=none for discovery.
    • CmuxExtensionKit resolves the id via CMUXSidebarExtensionPointIdentifier in Info.plist, overridable by CMUX_SIDEBAR_EXTENSION_POINT_ID.
    • reload.sh scopes the point to ${BUNDLE_ID}.cmux.sidebar; reload-extension.sh now supports --host-bundle-id|--bundle-id to match custom hosts (default com.cmuxterm.app.debug.<tag>), and passes the same id to sample builds; per-tag bundle ids avoid collisions.
    • Sample projects and docs now use the base id com.cmuxterm.app.cmux.sidebar.

Written for commit c4e99c4. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation

    • Updated setup and README instructions for sidebar extension development, including tag-ready authoring and host-scoped extension-point guidance.
  • Chores

    • Updated build settings and sample projects to use the new default sidebar extension point.
    • Enhanced tooling and scripts to derive extension-point IDs from the host/runtime for tagged builds and to adjust generated extension plist output accordingly.

@vercel

vercel Bot commented Jun 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 3, 2026 3:52am
cmux-staging Building Building Preview, Comment Jun 3, 2026 3:52am

@azooz2003-bit

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Change the base sidebar ExtensionKit identifier to com.cmuxterm.app.cmux.sidebar, update the associated Info.plist key name and docs, propagate the new identifier into Xcode build settings, and revise helper scripts to derive tagged extension-point IDs from host/debug bundle IDs; also remove an unused import and a nearby doc comment.

Changes

Sidebar Extension Point Identifier Restructuring

Layer / File(s) Summary
Extension Point Identifier Constant and Documentation
Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CMUXSidebarExtensionPoint.swift, CLAUDE.md, Packages/CmuxExtensionKit/README.md, Examples/SampleSidebarExtensionApp/README.md
Base identifier and Info.plist key updated to com.cmuxterm.app.cmux.sidebar / CMUXSidebarExtensionPointIdentifier with matching documentation and README edits.
Xcode build settings updates
Examples/SampleSidebarExtensionApp/SampleSidebarExtensionApp.xcodeproj/project.pbxproj, Examples/TabsVisibleSidebar/TabsVisibleSidebar.xcodeproj/project.pbxproj, cmux.xcodeproj/project.pbxproj
All CMUX_SIDEBAR_EXTENSION_POINT_ID build settings changed from com.manaflow.cmux.sidebar to com.cmuxterm.app.cmux.sidebar.
Tagged-build scoping & scripts
scripts/reload-extension.sh, scripts/reload.sh, scripts/write-sidebar-extension-point.sh
Scripts updated to compute tagged extension point IDs from host/debug bundle IDs (introducing SIDEBAR_POINT_NAME and --host-bundle-id), update header comments/defaults, and add _EXScopeRestriction = none to generated .appextensionpoint plist.
Remove unused import and documentation
Sources/CMUXInstalledExtensionSidebarHostView.swift
Remove import Observation and delete a preceding comment-only documentation block before observeIdentitySequence(extensionPointIdentifier:).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • manaflow-ai/cmux#5063: Related updates touching sidebar ExtensionKit extension-point identifier wiring and tagged-build scoping logic.

Poem

🐰 In burrows of code a sidebar gleams,

old name exchanged for brighter schemes,
host bundles whisper a tagged ID fine,
docs and scripts now read the new line,
rabbit hops, extensions align.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error PR deletes localization entry "fileExplorer.error.sshFailed" from Localizable.xcstrings (had en, ja, ko) but changes code error message to include dynamic detail parameter. Restore "fileExplorer.error.sshFailed" in Localizable.xcstrings with translations for en, ja, ko supporting the new "\(detail)" parameter format.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (16 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PR only modifies string constants in CMUXSidebarExtensionPoint enum and removes unused Observation import from a SwiftUI View; no actor isolation issues introduced or worsened.
Cmux Swift Blocking Runtime ✅ Passed No blocking synchronization patterns introduced. Swift changes are constant/documentation updates only; removes Observation import without adding blocking code like semaphores, Task.sleep, or NSLock.
Cmux No Hacky Sleeps ✅ Passed No new sleep patterns or fixed delays introduced; existing sleep statements in reload.sh predate PR and remain unchanged by sidebar extension point configuration updates.
Cmux Algorithmic Complexity ✅ Passed PR updates only string constants and build scripts. No nested collection scans, per-target rescans, or unbounded operations on scalable user data found. Complies with algorithmic complexity rules.
Cmux Swift Concurrency ✅ Passed No legacy async patterns introduced. Tasks only use NSXPCConnection and XPC callback boundaries, which are allowed by guidelines.
Cmux Swift @Concurrent ✅ Passed Async methods in @MainActor SwiftUI View intentionally stay on MainActor to coordinate UI work and access @State properties, which is permitted per the rules.
Cmux Swift File And Package Boundaries ✅ Passed CMUXSidebarExtensionPoint.swift (40 lines, +3/-3) correctly placed in package. CMUXInstalledExtensionSidebarHostView.swift gets -5 line cleanup only. No new oversized files or responsibility mixing.
Cmux Swift Logging ✅ Passed Two Swift files changed: CMUXSidebarExtensionPoint.swift (constant updates only) and CMUXInstalledExtensionSidebarHostView.swift (removed import and comment). No logging violations detected.
Cmux User-Facing Error Privacy ✅ Passed Changes are documentation and developer scripts with no user-facing errors exposing sensitive information, vendor names, or credentials.
Cmux Swiftui State Layout ✅ Passed New SwiftUI file uses @State only without @Published. ForEach rows pass value snapshots, not store refs. State mutations in event handlers, not render-time. Proper lifecycle patterns throughout.
Cmux Architecture Rethink ✅ Passed Changes are configuration updates and code cleanups. No timing/polling, locks, observers, or split UI lifecycle ownership patterns introduced.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR adds CMUXInstalledExtensionSidebarHostView.swift which uses only .sheet() and .popover() views, both explicitly allowed as non-standalone key windows by the rule.
Title check ✅ Passed The title 'Fix tagged sidebar extension discovery' clearly summarizes the main change: resolving a bug where tagged sidebar extensions were not being discovered properly.
Description check ✅ Passed The description provides a summary of changes and verification steps, but is missing the 'Testing' and 'Demo Video' sections from the template, and the checklist items are not marked.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-extension-host-enabled-identity

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.

@greptile-apps

greptile-apps Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes sidebar extension discovery for tagged dev builds by deriving the host extension point ID from the host bundle ID (<bundle-id>.cmux.sidebar) rather than a static tag-suffixed string, and restores the macOS 14-era .appextensionpoint attributes (EXExtensionPointIsPublic, EXPresentsUserInterface, _EXScopeRestriction) needed for ExtensionFoundation to discover the point.

  • Renames the production extension point identifier from com.manaflow.cmux.sidebar to com.cmuxterm.app.cmux.sidebar across project files, scripts, docs, and the Swift SDK constant — a domain rename that requires any externally shipped extensions to update their EXExtensionPointIdentifier entry.
  • Moves PRODUCT_BUNDLE_IDENTIFIER out of the non-tagged conditional in reload.sh so tagged builds bake the correct per-tag bundle ID at xcodebuild time rather than relying solely on post-build PlistBuddy patching.
  • Adds --host-bundle-id / --bundle-id to reload-extension.sh and renames identifierInfoPlistKey from CmuxSidebarExtensionPointIdentifier to CMUXSidebarExtensionPointIdentifier (aligned with the updated Resources/Info.plist key).

Confidence Score: 5/5

The extension point ID rename and tagged-build mechanics are consistent across all touched files — host project, sample projects, scripts, Swift SDK constant, Info.plist, and docs all agree on com.cmuxterm.app.cmux.sidebar.

The changes are self-consistent configuration and script updates with no new logic bugs. The two flagged items — a dropped explanatory comment and an undocumented migration path for external extension developers — are non-blocking and do not affect runtime correctness for the tested tagged-build workflow.

scripts/write-sidebar-extension-point.sh uses _EXScopeRestriction=none, a private undocumented ExtensionKit key already called out in a previous review thread.

Important Files Changed

Filename Overview
scripts/write-sidebar-extension-point.sh Adds _EXScopeRestriction=none (a private, undocumented ExtensionKit attribute) alongside the public EXExtensionPointIsPublic/EXPresentsUserInterface keys; updates default point ID to com.cmuxterm.app.cmux.sidebar. The private key is flagged in a previous review thread.
scripts/reload.sh Moves PRODUCT_BUNDLE_IDENTIFIER assignment outside the non-tagged conditional so tagged builds bake the correct bundle ID at xcodebuild time; updates CMUX_SIDEBAR_EXTENSION_POINT_ID formula from com.manaflow.cmux.sidebar.<TAG_ID> to ${BUNDLE_ID}.cmux.sidebar.
scripts/reload-extension.sh Adds --host-bundle-id/--bundle-id flag; derives tagged point ID as <host-bundle-id>.cmux.sidebar from the host bundle rather than a static base. Default for host bundle ID correctly mirrors reload.sh's default.
Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CMUXSidebarExtensionPoint.swift Renames baseIdentifier to com.cmuxterm.app.cmux.sidebar and identifierInfoPlistKey to CMUXSidebarExtensionPointIdentifier; identifier(in:) now reads exclusively from the bundle's Info.plist (no env-var override path).
Sources/CMUXInstalledExtensionSidebarHostView.swift Removes import Observation (unused) and drops the explanatory comment for why AppExtensionIdentity (macOS 13+) is preferred over AppExtensionPoint.Monitor; functional code is unchanged.
cmux.xcodeproj/project.pbxproj Updates CMUX_SIDEBAR_EXTENSION_POINT_ID to com.cmuxterm.app.cmux.sidebar in both Debug and Release configs; both host and sample extension projects now share the same static base ID for untagged builds.
Examples/SampleSidebarExtensionApp/SampleSidebarExtensionApp.xcodeproj/project.pbxproj Updates CMUX_SIDEBAR_EXTENSION_POINT_ID default to com.cmuxterm.app.cmux.sidebar in all four build configurations (Debug/Release x app/appex).
Examples/TabsVisibleSidebar/TabsVisibleSidebar.xcodeproj/project.pbxproj Updates CMUX_SIDEBAR_EXTENSION_POINT_ID default to com.cmuxterm.app.cmux.sidebar in both Debug and Release configs.
CLAUDE.md Updates tagged-build documentation to reflect the new <bundle-id>.cmux.sidebar formula, the new default base ID, and the --host-bundle-id flag in reload-extension.sh.
Packages/CmuxExtensionKit/README.md Updates the documented extension point identifier from com.manaflow.cmux.sidebar to com.cmuxterm.app.cmux.sidebar in setup instructions and the Info.plist sample.
Examples/SampleSidebarExtensionApp/README.md Updates the documented extension point identifier in setup step 5 from com.manaflow.cmux.sidebar to com.cmuxterm.app.cmux.sidebar.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant reload as reload.sh --tag extfix
    participant xcode as xcodebuild
    participant reloadExt as reload-extension.sh --tag extfix
    participant pluginkit as pluginkit / pkd

    Dev->>reload: --tag extfix
    reload->>reload: "BUNDLE_ID = com.cmuxterm.app.debug.extfix"
    reload->>xcode: "PRODUCT_BUNDLE_IDENTIFIER=com.cmuxterm.app.debug.extfix"
    xcode->>xcode: write-sidebar-extension-point.sh writes .appextensionpoint
    xcode->>xcode: Info.plist bakes CMUXSidebarExtensionPointIdentifier
    reload->>Dev: tagged app at ~/Applications

    Dev->>reloadExt: --tag extfix
    reloadExt->>reloadExt: "TAGGED_POINT_ID = com.cmuxterm.app.debug.extfix.cmux.sidebar"
    reloadExt->>xcode: "CMUX_SIDEBAR_EXTENSION_POINT_ID=TAGGED_POINT_ID"
    reloadExt->>pluginkit: pluginkit -a appex
    pluginkit->>Dev: extension registered against TAGGED_POINT_ID

    Dev->>Dev: CmuxSidebarExtensionPoint.identifier reads Info.plist key
Loading

Reviews (3): Last reviewed commit: "Support custom sidebar extension host bu..." | Re-trigger Greptile

Comment on lines 2914 to 2916
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Debug";
CMUX_AUTH_CALLBACK_SCHEME = "cmux-dev";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Debug extension point ID mismatch breaks non-tagged Xcode builds

$(PRODUCT_BUNDLE_IDENTIFIER).cmux.sidebar in the Debug config evaluates to com.cmuxterm.app.debug.cmux.sidebar when PRODUCT_BUNDLE_IDENTIFIER is its default com.cmuxterm.app.debug. The sample extension projects (SampleSidebarExtensionApp, TabsVisibleSidebar) still default their CMUX_SIDEBAR_EXTENSION_POINT_ID to com.cmuxterm.app.cmux.sidebar. Any developer who builds cmux in Debug from Xcode directly — without the tagged reload workflow — will get a host extension point that has no match for extensions built with the sample project defaults, so no extensions will appear at all. Before this PR, both the debug host and sample extensions shared the static base identifier.

Comment on lines +31 to +34
if let environmentOverride = ProcessInfo.processInfo.environment["CMUX_SIDEBAR_EXTENSION_POINT_ID"],
!environmentOverride.isEmpty {
return environmentOverride
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Environment variable shadowing Info.plist key for production binaries

ProcessInfo.processInfo.environment includes all inherited env vars, not only those injected by LaunchServices via LSEnvironment. If a developer has CMUX_SIDEBAR_EXTENSION_POINT_ID in their shell (e.g., a leftover export from earlier tagged work) and then directly execs the production binary (e.g., via .app/Contents/MacOS/cmux), the env var silently overrides the correctly baked CmuxSidebarExtensionPointIdentifier Info.plist key, redirecting extension discovery to a stale dev point. The Info.plist key is already correctly baked at build time for every configuration — the LSEnvironment injection in reload.sh is belt-and-suspenders for tagged builds and does not need this explicit env var check to precede it in production code.

Comment on lines +24 to +25
<key>_EXScopeRestriction</key>
<string>none</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Using a private, undocumented _EXScopeRestriction key

The previous version of this script included an explicit comment noting it "intentionally avoids private underscored keys." _EXScopeRestriction is an undocumented ExtensionKit attribute not exposed by any public Apple API or header. While it may currently enable discovery on macOS 14, Apple can change or remove private keys without notice. A future OS update silently ignoring or misinterpreting this key could break extension point registration with no warning.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Line 258: The documentation uses the wrong symbol casing; replace the
incorrect `CMUXSidebarExtensionPoint.identifier(in:)` with the exact package
symbol `CmuxSidebarExtensionPoint.identifier(in:)` wherever it appears in the
text so the docs match the actual API name and avoid confusion when searching or
linking to the type.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ff680bec-0fa1-46bf-be3e-b4537b713e9b

📥 Commits

Reviewing files that changed from the base of the PR and between 7890258 and bdb7af3.

📒 Files selected for processing (11)
  • CLAUDE.md
  • Examples/SampleSidebarExtensionApp/README.md
  • Examples/SampleSidebarExtensionApp/SampleSidebarExtensionApp.xcodeproj/project.pbxproj
  • Examples/TabsVisibleSidebar/TabsVisibleSidebar.xcodeproj/project.pbxproj
  • Packages/CmuxExtensionKit/README.md
  • Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CMUXSidebarExtensionPoint.swift
  • Sources/CMUXInstalledExtensionSidebarHostView.swift
  • cmux.xcodeproj/project.pbxproj
  • scripts/reload-extension.sh
  • scripts/reload.sh
  • scripts/write-sidebar-extension-point.sh
💤 Files with no reviewable changes (1)
  • Sources/CMUXInstalledExtensionSidebarHostView.swift

Comment thread CLAUDE.md Outdated

@cubic-dev-ai cubic-dev-ai 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.

5 issues found across 11 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/reload-extension.sh Outdated
Comment thread cmux.xcodeproj/project.pbxproj Outdated
Comment thread CLAUDE.md Outdated
@azooz2003-bit
azooz2003-bit merged commit c544fa9 into main Jun 3, 2026
18 of 21 checks passed
@azooz2003-bit
azooz2003-bit deleted the fix-extension-host-enabled-identity branch June 3, 2026 03:46

This branch was successfully deployed

1 active deployment
Preview – cmux — c4e99c4b Deployed Jun 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant