Repository navigation
feat(plugins): show each plugin's session state and report RPC startup - #400
Merged
Merged
Conversation
Add :plugin-status, a picker listing every configured plugin as active, starting, loading on first use, disabled, or quarantined, with the stage and full reason for each quarantine. A command that starts a lazy RPC plugin now says the plugin is starting, and a second command during the handshake says it is still starting instead of busy. RPC spawn failures keep the OS error in the quarantine reason. Fixes #397
Contributor
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 488003ba83
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rtup Disabled plugins were removed from the config before registration, so :plugin-status never listed them. Keep their paths and list them as disabled. A command sent while an event is starting an RPC plugin now says so instead of claiming a command is already waiting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #397.
Why
#396 made a quarantine visible when it happens: an error notice, closed dialogs, and commands that explain why they're unavailable. Two gaps from #392 remained:
red plugin listcan't tell you either: it runs as its own process and only reads the config.initializeshowed nothing for 5 seconds. Running it again saidRPC plugin silent is busy, which is wrong: the plugin hadn't started yet.While reproducing this I found a third problem. When an RPC plugin's executable couldn't be started, the quarantine reason was only
failed to start RPC plugin, with no cause in the notice or inred.log.What changed
:plugin-status(also in the command palette as "Plugin status") opens a picker that lists every configured plugin as quarantined, active with a rejected reload, starting, active, loads on first use, or disabled. Problems are listed first. Plugins turned off withdisabled_plugins(oragentunderdisable_ai) are listed last as disabled. The config now keeps their paths, because they used to be dropped before the registry saw them. Each row shows the plugin's source, or for a problem the stage and first line of the reason. The preview shows the full diagnostic and what to do about it, wrapped to fit the narrowest side-by-side preview pane. The quarantine notice now points to:plugin-status.plugin silent is starting; Silent runs once it is ready. A second command during the handshake saysplugin silent is still starting and already has a command waiting, instead ofbusy. If an event started the plugin, it says the plugin is handling that event. When the 5-second deadline passes, the existing quarantine notice appears.failed to start RPC plugin red-missing-plugin-binary: No such file or directory (os error 2). Quarantine reasons show only the outermost error message, so the cause is now part of that message instead of being dropped.red plugin list. It would need state saved from a previous session, with the stale-state problems that brings, so the in-editor view replaces it.docs/PLUGIN_API.mddescribes:plugin-status.docs/RPC_PLUGIN_PROTOCOL.mdnow documents the 5-secondinitializedeadline and what a user sees while a lazy plugin starts.tests/rpc_connection/editor.rschecked thatplugin-was absent from the whole screen. The status line shows the Git branch, so they failed on any branch withplugin-in its name, including this one. They now check only the document area.How to Test
Make a JSON-RPC plugin that never answers. In an empty directory
silent/, createsilent.sh:and
red-plugin.toml:Add
silent = "/absolute/path/to/silent/red-plugin.toml"to[plugins]in yourconfig.toml, and start Red.Run
:Silent. The bottom line showsplugin silent is starting; Silent runs once it is ready. Before this change it stayed blank.Within 5 seconds, run
:Silentagain. It warnsplugin silent is still starting and already has a command waiting…. Before this change it saidRPC plugin silent is busy.After 5 seconds the notice
silent: stopped for this session: RPC request initialize timed out after 5000 msappears.Run
:plugin-status.silentis listed first asquarantined, withactivation: RPC request initialize timed out after 5000 ms, and the preview shows the full reason. The bundled plugins are listed asactive.Regression check, a bad executable: change
command = "sh"tocommand = "red-missing-plugin-binary", restart Red and run:Silent. The notice and the:plugin-statuspreview sayNo such file or directory. Before, they said onlyfailed to start RPC plugin.Tests:
lazy_initialization_keeps_input_responsiveintests/rpc_connectionnow checks the starting message, the still-starting warning, and that:plugin-statusshowsstartingwhileinitializeis blocked.status_rows_describe_each_plugin_in_configuration_ordercovers active, loads-on-first-use, quarantined and disabled plugins.starting_rpc_conflict_names_what_the_plugin_is_waiting_oncovers both still-starting warnings.quarantined_plugin_shows_its_stage_and_full_reason,healthy_plugins_show_their_sourceandwrapped_preview_lines_keep_their_indentationcover the picker rows and preview.