Repository navigation
fix(plugins): tell the user when a plugin is quarantined - #396
Merged
Merged
Conversation
Quarantining a plugin only wrote an INFO line to red.log. Its open pickers stayed on screen without working handlers, and its commands answered "unknown command", so a stopped plugin looked like a crash or a missing command. Every quarantine now publishes an error notice from the plugin, with the stage, source and full diagnostic in its details, and closes the pickers and composers the plugin owned. Commands of a quarantined plugin, including lazily declared ones, explain that it was stopped and why. Metadata failures found while registering plugins are reported at startup, a repeated quarantine with the same cause is not announced twice, and the log line is now a WARN. Fixes #392
Collaborator
|
@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: 099136257f
ℹ️ 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".
Running a command of a quarantined plugin printed its explanation as a routine warning, which the plugin's retained error outranked on the bottom line, so the explanation only appeared in :messages. It now leads the bottom line as quiet foreground feedback, without adding another message that needs attention, and names the command without its arguments. Quarantine also dropped each command's scope, so a global command's key binding was rejected while a panel had focus and never reached the explanation. The registry now keeps the registered scope of quarantined commands, and declared activation commands keep the panel reach they had while pending.
This was referenced Oct 15, 2026
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.
When Red quarantined a plugin, the only record was an
INFOline inred.log. A picker the plugin had open stayed on screen with no working handlers. The plugin's commands answeredunknown command. A stopped plugin looked like a crash or a missing command, which is how #388 was reported.Fixes #392.
What changes
lsp_symbols: stopped for this session: error[HUSK-R0001]: Husk heap byte limit exceeded …. It needs attention until acknowledged and is recorded in:messages. The details include the stage, the plugin's source path, the full diagnostic, and how to recover: restart Red, or save a fix if you're developing the plugin.PluginRequest::PluginQuarantined.onCommand:activation commands, each with its scope. Invoking one, from a key binding or typed as:Command, shows`LspWorkspaceSymbols` is unavailable because plugin `lsp_symbols` was stopped: …. The message leads the bottom line without adding to the messages that need attention. A global command's key binding still reaches it while a panel has focus.WARN, through a newlog_warn!macro. The logger already supported levels, butlog!always wroteINFO.Not in this PR
red plugin list. That command runs in its own process and can't see the editor session's state. It needs a separate design, such as an in-editor plugin view.quarantinepath, so the notice and the command explanation should apply. But I haven't checked how the first:Silentbehaves while activation is still waiting for its 5-second timeout.How to Test
Save this plugin as
crashy.hk. Typing in its picker divides by zero:Add it to the
[plugins]table of yourconfig.toml, ascrashy = "/absolute/path/to/crashy.hk", and start Red.Run
:CrashDemo, then type any character in the empty picker. The picker closes, and the bottom line shows× crashy: stopped for this session: error[HUSK-R0001]: integer division by zerowith1 needs attention.Open
:messagesand select the notice. Its details showStage: runtime, the plugin's source path, the diagnostic pointing at line 12 ofcrashy.hk, and the recovery text.red.login the config directory has a[WARN] Plugincrashyquarantined during runtimeline.Run
:CrashDemoagain. The bottom line shows`CrashDemo` is unavailable because plugin `crashy` was stopped: …, and the badge still reads1 needs attention.Run
:BufferPicker. Other plugins are unaffected, so the buffer picker opens normally.These automated tests cover the same cases:
quarantine_notice_names_the_dialogs_its_plugin_left_open,lazy_command_keeps_explaining_its_failed_activation,quarantined_commands_keep_their_registered_scope,metadata_quarantine_from_registration_is_reported_once_at_startup,plugin_quarantine_closes_only_its_dialog_and_reports_the_plugin, androutine_foreground_warning_leads_without_needing_attention.