-
Notifications
You must be signed in to change notification settings - Fork 0
feat: show plugins in /status dialog #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cherry-pick upstream PR sst#4515 by @spoons-and-mirrors - Add plugins section to /status dialog in TUI - Display configured plugins alongside MCP servers, LSP servers, and formatters - Handle both file:// local plugins and versioned npm packages - Sort plugins alphabetically for consistent display Closes #92
WalkthroughThe change adds plugin visibility to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10–15 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
packages/opencode/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx,js,jsx}: Use relative imports for local modules, with named imports preferred
Use camelCase for variable and function names
Use PascalCase for classes and namespaces
Files:
packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx
packages/opencode/**/*.{ts,tsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx}: Use Zod schemas for validation and TypeScript interfaces for structure
Use Result patterns for error handling; avoid throwing exceptions in tools
Files:
packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx
🔇 Additional comments (3)
packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx (3)
30-34: LGTM! Correctly handles scoped packages.The use of
lastIndexOf("@")with theindex <= 0condition properly handles scoped npm packages (e.g.,@scope/package) by treating the leading@as part of the package name, not a version separator.
127-149: LGTM! Consistent with existing sections.The Plugins section matches the styling and structure of the existing MCP Servers, LSP Servers, and Formatters sections. The use of
theme.successfor the bullet, bold plugin names, and muted version text provides a consistent user experience.
36-36: ThetoSorted()method is fully supported in this project's target environment. The TypeScript configuration explicitly targets Bun (via@tsconfig/bunpreset) and usesESNextas the library target, which includes ES2023 features. Bun's runtime uses JavaScriptCore and maintains support for modern JavaScript standards, includingtoSorted(). The code is compatible and requires no changes.
| if (value.startsWith("file://")) { | ||
| const path = value.substring("file://".length) | ||
| const parts = path.split("/") | ||
| const filename = parts.pop() || path | ||
| if (!filename.includes(".")) return { name: filename } | ||
| const basename = filename.split(".")[0] | ||
| if (basename === "index") { | ||
| const dirname = parts.pop() | ||
| const name = dirname || basename | ||
| return { name } | ||
| } | ||
| return { name: basename } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edge case: hidden files would produce empty plugin names.
The basename extraction logic filename.split(".")[0] would return an empty string for files starting with a dot (e.g., file:///path/.config would result in name: ""). While this is an unlikely scenario for plugin paths, it could cause display issues.
Consider adding a guard:
const basename = filename.split(".")[0]
+ if (!basename) return { name: filename }
if (basename === "index") {🤖 Prompt for AI Agents
In packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx around lines 17
to 29, the basename extraction for file:// paths uses filename.split(".")[0]
which yields an empty string for hidden files (e.g., ".config"); update the
logic to guard against an empty basename by falling back to the full filename
(or the dirname when index handling applies) so the returned name is never an
empty string — i.e., after computing basename, if basename is falsy use filename
(or existing dirname fallback) before returning.
Summary
Cherry-pick upstream PR sst/opencode#4515 by @spoons-and-mirrors to add plugin visibility to the
/statusdialog.Changes
pluginscomputed memo that parses plugin configurationfile://local plugins and versioned npm packagesTesting
Closes #92
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.