Skip to content

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Dec 8, 2025

Summary

Cherry-pick upstream PR sst/opencode#4515 by @spoons-and-mirrors to add plugin visibility to the /status dialog.

Changes

  • Add new plugins computed memo that parses plugin configuration
  • Handle both file:// local plugins and versioned npm packages
  • Display plugins section with green bullet, bold name, and muted version
  • Show "No Plugins" fallback when none configured
  • Sort plugins alphabetically for consistent display

Testing

  • Typecheck passes
  • Test with various plugin configurations (manual)

Closes #92

Summary by CodeRabbit

  • New Features
    • Added a "Plugins" section to the status dialog displaying installed plugins with their versions, sorted alphabetically. Shows "No Plugins" when none are installed.

✏️ Tip: You can customize this high-level summary in your review settings.

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
@coderabbitai
Copy link

coderabbitai bot commented Dec 8, 2025

Walkthrough

The change adds plugin visibility to the /status dialog by implementing a new computed memo that parses plugin configuration entries from sync.data.config.plugin, handles both file-based and npm package formats with optional versions, sorts them alphabetically, and renders a styled "Plugins" section in the UI.

Changes

Cohort / File(s) Summary
Plugin Display Logic
packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx
Adds computed memo to parse plugin configuration entries (file:// paths and npm packages with versions), sort alphabetically, and render a new "Plugins" UI section showing plugin names and versions, with fallback to "No Plugins" message.
Formatting Fixes
packages/plugin/package.json, packages/sdk/js/package.json
Minor newline adjustments to package.json files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • The primary logic is contained within a single component file with straightforward parsing for two distinct plugin formats
  • Edge case handling for file:// paths (index files, dirname extraction) is clear and localized
  • UI rendering follows existing component patterns; styling is consistent with other sections
  • Verify correct handling of edge cases: empty plugin arrays, index files, scoped packages with/without versions

Poem

🐰 Plugins now sparkle in the status view,
File paths and versions all sorted so true,
From npm to local, they dance in a row,
The dialog's more helpful—now plugins will show!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: show plugins in /status dialog' directly and concisely describes the main change—adding a plugins display section to the status dialog.
Linked Issues check ✅ Passed The code changes fully implement the objectives from issue #92: parsing plugins (both file:// and npm formats), displaying them alphabetically sorted with version info, and showing 'No Plugins' fallback.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue—plugin parsing and UI display logic in dialog-status.tsx, plus newline fixes in package.json files as specified.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-pr-4515

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.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between a908812 and 62fed9e.

📒 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 the index <= 0 condition 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.success for the bullet, bold plugin names, and muted version text provides a consistent user experience.


36-36: The toSorted() method is fully supported in this project's target environment. The TypeScript configuration explicitly targets Bun (via @tsconfig/bun preset) and uses ESNext as the library target, which includes ES2023 features. Bun's runtime uses JavaScriptCore and maintains support for modern JavaScript standards, including toSorted(). The code is compatible and requires no changes.

Comment on lines +17 to +29
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 }
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

@shuv1337 shuv1337 merged commit 3d011cc into integration Dec 8, 2025
5 of 6 checks passed
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.

Integrate upstream PR #4515: Show plugins in /status dialog

2 participants