Repository navigation
Fix tagged sidebar extension discovery - #5267
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
📝 WalkthroughWalkthroughChange the base sidebar ExtensionKit identifier to ChangesSidebar Extension Point Identifier Restructuring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (16 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR fixes sidebar extension discovery for tagged dev builds by deriving the host extension point ID from the host bundle ID (
Confidence Score: 5/5The 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 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 Important Files Changed
Sequence DiagramsequenceDiagram
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
Reviews (3): Last reviewed commit: "Support custom sidebar extension host bu..." | Re-trigger Greptile |
| buildSettings = { | ||
| ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Debug"; | ||
| CMUX_AUTH_CALLBACK_SCHEME = "cmux-dev"; |
There was a problem hiding this comment.
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.
| if let environmentOverride = ProcessInfo.processInfo.environment["CMUX_SIDEBAR_EXTENSION_POINT_ID"], | ||
| !environmentOverride.isEmpty { | ||
| return environmentOverride | ||
| } |
There was a problem hiding this comment.
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.
| <key>_EXScopeRestriction</key> | ||
| <string>none</string> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (11)
CLAUDE.mdExamples/SampleSidebarExtensionApp/README.mdExamples/SampleSidebarExtensionApp/SampleSidebarExtensionApp.xcodeproj/project.pbxprojExamples/TabsVisibleSidebar/TabsVisibleSidebar.xcodeproj/project.pbxprojPackages/CmuxExtensionKit/README.mdPackages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CMUXSidebarExtensionPoint.swiftSources/CMUXInstalledExtensionSidebarHostView.swiftcmux.xcodeproj/project.pbxprojscripts/reload-extension.shscripts/reload.shscripts/write-sidebar-extension-point.sh
💤 Files with no reviewable changes (1)
- Sources/CMUXInstalledExtensionSidebarHostView.swift
There was a problem hiding this comment.
5 issues found across 11 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
.appextensionpointpathVerification
./scripts/check-pbxproj.sh./scripts/reload.sh --tag extfix --swift-frontend-workaround./scripts/reload-extension.sh --tag extfix --example samplepluginkit -m -v -p com.cmuxterm.app.debug.extfix.cmux.sidebarshowedco.manaflow.CMUXExtKitSampleSidebarApp.extfix.ExtensionregisteredNotes
Need help on this PR? Tag
/codesmithwith 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.
$(PRODUCT_BUNDLE_IDENTIFIER).cmux.sidebar; debug tags resolve tocom.cmuxterm.app.debug.<tag>.cmux.sidebar..appextensionpointbundle and keeps the legacy path; adds_EXScopeRestriction=nonefor discovery.CmuxExtensionKitresolves the id viaCMUXSidebarExtensionPointIdentifierin Info.plist, overridable byCMUX_SIDEBAR_EXTENSION_POINT_ID.reload.shscopes the point to${BUNDLE_ID}.cmux.sidebar;reload-extension.shnow supports--host-bundle-id|--bundle-idto match custom hosts (defaultcom.cmuxterm.app.debug.<tag>), and passes the same id to sample builds; per-tag bundle ids avoid collisions.com.cmuxterm.app.cmux.sidebar.Written for commit c4e99c4. Summary will update on new commits.
Summary by CodeRabbit
Documentation
Chores