Repository navigation
fix(core): log skipped plugin discovery - #59707
Hamza-Abili wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
This works as described. I ran serve from both checkouts on a project with a symlinked-out entrypoint (the NixOS case) and an empty plugin directory. On the base, both plugins are dropped with nothing logged. With this PR, each one gets its new warning, with the target, resolved root and entrypoint. The new tests pass on the PR, and the supervisor tests still pass.
The public API is unchanged. The only change is that ConfigPluginSource.scan is now exported inside core, for the tests.
One point is worth a look (inline): the no-entrypoint warning also fires for subdirectories found automatically in .opencode/plugin(s)/, not only for configured paths.
The issue's second part (a plugin import failure is not logged) is not addressed here, so Closes #58647 may close that issue before that part is fixed.
Related: #52300
56f08ef to
bf875c7
Compare
There was a problem hiding this comment.
The new commit addresses the earlier point: the no-entrypoint warning now fires only for explicit plugins entries, not for helper folders found automatically in .opencode/plugins/. I checked this by running serve on a project with a symlinked-out plugin, an empty configured plugin directory and an auto-discovered plugins/lib/ helper folder. The first two each log their warning, and the helper folder logs nothing. The tests pass. The public API is unchanged. No new concerns.
bf875c7 to
89aa254
Compare
|
Hi @Hona, could you take a look at this small diagnostics PR when you have a moment? It only adds warnings in ConfigPluginSource; the automatic review has no open concerns. Thanks! |
|
Hi @kitlangton, this is a small diagnostics change in The required checks ( |
89aa254 to
022c46a
Compare
There was a problem hiding this comment.
This push is a rebase onto a newer dev. The PR's change is the same as in the commit reviewed before. The only upstream change to source.ts (#61176) is in the watch and change-feed code, not scan, so there is nothing to reconcile. The focused tests still pass on the new head. The public API is unchanged. No new concerns.
A plugin directory with no server, GUI, or TUI entrypoint, or whose entrypoint resolves outside the directory (for example a NixOS/home-manager symlink into /nix/store), was dropped without any log line. Log a warning with the configured target and, for containment, the resolved root and entrypoint. The containment and loading behavior is unchanged. The no-entrypoint warning is limited to explicit plugin entries; helper directories discovered under .opencode/plugin(s)/ stay silent. Add focused tests for both skip paths, the GUI-only and TUI-only semantics, a valid plugin, and an auto-discovered helper directory. Based on the reference patch by @Dante-dan in the issue. Refs anomalyco#58647
022c46a to
bf7b09c
Compare
There was a problem hiding this comment.
This push is a rebase onto a newer dev. The PR's change is the same as in the commit reviewed before, and source.ts has not changed upstream since the last review. The focused tests still pass on the new head. The public API is unchanged. No new concerns.
Issue for this PR
Refs #58647
Type of change
What does this PR do?
Plugin discovery silently dropped a configured plugin directory when it had no server/GUI/TUI entrypoint, or when its entrypoint resolved outside the directory (the NixOS/home-manager symlink case). The plugin never loaded and nothing was logged.
This adds two warnings in
ConfigPluginSource.scan:Behavior is unchanged: GUI-only directories still list for their GUI part, TUI-only directories remain the TUI's own, and the containment rule still skips the directory. The only difference is that the skip is visible. Auto-discovered helper directories such as
.opencode/plugins/lib/do not warn when they have no entrypoint; only explicitpluginsentries are treated as misconfigured.The new test calls
scandirectly (exported likeSkillScan.scan) and covers both skip paths plus a valid plugin, a GUI-only directory, a TUI-only directory, and an auto-discovered helper directory. The symlink case is skipped on Windows.This addresses the discovery half of #58647. The report's second half (a plugin import failure producing no log) is already covered by the loader's
WARN failed to load pluginonce a plugin reaches it; I am leaving the issue open withRefsso the reporter can confirm rather than closing it here.Thanks to @Dante-dan for the reference patch in the issue.
How did you verify your code works?
cd packages/core && bun test test/config/plugin-source.test.ts --rerun-each 10— 60 passcd packages/core && bun run typecheck— cleancd packages/core && bun test test/plugin/supervisor.test.ts test/config/plugin-source.test.ts— 14 passprettier --checkon both changed files — cleangit diff --check— cleanVisual
Not applicable: logging only.
Screenshots / recordings
Not applicable.
Checklist
Added by the opencode bot (AI-generated).
Related: #58647, #52300