This repository was archived by the owner on Dec 3, 2026. It is now read-only.
Repository navigation
fix: plugins and hooks exchange data without deadlocking; plugin discovery and plugin update report what they couldn't do [[tasks/harmony-2988]] - #152
Merged
Conversation
…nd plugin update report what they couldn't do [[tasks/harmony-2988]] - meta_core::children::Owned::exchange writes stdin while reading stdout and stderr, closes stdin, and reaps the child on every path; plugin execution, worktree hooks and children::output use it. A plugin that writes 256 KiB before reading a 100 KiB request no longer deadlocks. - a hook's payload write error (other than a hook not reading it) fails the hook, a warning or an error under --strict - in .meta/plugins and ~/.meta/plugins, a file that can't start, isn't executable, fails or answers with something but plugin info is warned about, naming why; meta-* on PATH stays silent - meta plugin update checks every plugin in its manifest, names each one it can't check or update, and exits non-zero; never "up to date" for a plugin it couldn't check (U70) Implements [[tasks/harmony-2988]]
|
Warning Review limit reached
This review includes 16 billable files and costs up to $4.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 56 minutes for your next included review. View limit details
|
…e starts threads only for piped streams [[tasks/harmony-2988]] Review round 1 (R1, R2, R4): - update-all goes through the manifest entries whose plugin file is still there, so a plugin deleted by hand can't make it fail on every run - exchange starts the writer and stderr threads only for piped streams (children::output has no stdin) - the umask bats fixture's plugins answer --meta-plugin-info, as the new discovery warning expects - docs: what a meta-* program on PATH that isn't a plugin gets Implements [[tasks/harmony-2988]]
…update never prints a source [[tasks/harmony-2988]] Review round 2 (R3, R5): the no-read test sends 100 KiB under --strict, so the broken-pipe path runs every time; the update test checks the source (which may hold a credential) isn't printed. Implements [[tasks/harmony-2988]]
…/harmony-2988]] Review round 2 (R6): the plugin's skills changed. Implements [[tasks/harmony-2988]]
Contributor
Author
|
@coderabbitai review |
Action not completed
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Audit items W8.1-W8.3 and fuzz finding U70 (
meta-improve-2026-10-31). W8.4 (the clone queue) is in #151.What changes for users
--strict(fix!: worktrees resolve one plan, read one record, and say what they did [[tasks/harmony-2973]] #149's rule). A hook that doesn't read its payload is still no failure (fix!: worktrees resolve one plan, read one record, and say what they did [[tasks/harmony-2973]] #149 decided that)..meta/pluginsand~/.meta/plugins, a file namedmeta-*that can't be started, isn't executable, exits with an error, or answers--meta-plugin-infowith something that isn't plugin info now gets a warning naming it and saying why, as a timeout already did. Before, it silently wasn't a plugin. Ameta-*program on PATH that isn't a plugin stays silent, since it may be any program; a timeout there is still warned about, as before. When you call a plugin by name (meta foo), the error now says why it isn't a plugin.meta plugin updateno longer says "up to date" for plugins it couldn't check (U70). It goes through the plugins meta installed (its manifest) whose file is still there, and checks each one. A hand-copied plugin, or a manifest entry whose file was deleted, can't make it fail. A plugin installed from a URL or a registry name, or with no recorded version, now printsCannot check meta-<name> for updates: <why>. So does a failed GitHub lookup. A failed update is reported too. The other plugins are still checked and updated, then the command exits non-zero withPlugins not updated: <names>(not checkedwith--check). "All plugins are up to date" is printed only when every plugin was checked.meta plugin update <name>fails the same way for that plugin.Before:
After:
Code
meta_core::children::Owned::exchange(input) -> io::Result<Output>is the one exchange. It writes stdin on one thread and reads stderr on another (each only when piped), reads stdout itself, then waits throughOwned::wait, so fix!: a meta run owns its children and the worktree sets it was making [[tasks/harmony-2972]] #147's stop path is unchanged. A broken pipe counts as success, because the exit status decides. Threads start throughBuilder::spawn_scoped, so a thread that can't start is an error, not a panic. If a pipe can't be served, the child is killed before it is waited for.children::outputuses it, andOwned::stdin()andOwned::wait_with_outputare deleted.SubprocessPlugin::executeandfire_worktree_hookeach callexchangeinstead of writing and waiting by hand.probe_plugin_inforeturnsResult<PluginInfo, NoInfo>, withNoInfo::NotAPlugin(couldn't start, failed, not plugin info) andNoInfo::NoAnswer(timeout, wait failure). Each carries the reason.SubprocessPluginManager::allleaves out aNotAPluginon PATH silently and warns about everything else.files()keeps whether each file came from PATH, and warns about a non-executablemeta-*file in a plugins folder.PluginInstaller::check_updategates onGitHubShorthand::parse(the parserupdate_pluginalready used) instead ofsource.contains('/'), and every "can't check" is an error saying why. The source isn't printed, because a URL may hold a credential.PluginInstaller::installed_wordslists the manifest entries whose file is still there, for update-all.Public API (crate
meta_core):Target revised: W8.2
touch xhook sometimes exits before meta writes), and would fire every time for a hook that ignores a payload over 64 KiB. Under--strictit would fail a working setup.--strict. The hook shares the plugin exchange, which the 256 KiB / 100 KiB test covers.Tests (each fails on
origin/main)a_plugin_that_writes_before_reading_a_large_request_gets_all_of_it: the plugin writes 256 KiB, then reads a request over 100 KiB. meta finishes, the plugin got the whole request, and the output is intact. On main, meta and the plugin block each other until the test's 30 s deadline kills meta.unusable_files_in_plugin_folders_are_warned_about_but_not_on_path: a bad-JSON file, a file that can't start and a non-executable file, in.meta/pluginsand in~/.meta/plugins, are each warned about bymeta --help. The same three on PATH are not.plugin_update_names_each_plugin_it_cannot_check_and_fails: a URL-installed plugin, one with no version, and a manifest entry whose file was deleted.plugin updateandplugin update --checkname the first two, leave the deleted one alone and exit non-zero, andplugin update <name>fails naming it. No network is needed.a_plugin_that_answers_without_reading_its_request_still_answersnow sends a 100 KiB request under--strict, so the plugin always exits before meta finishes writing: a broken pipe stays no failure, for plugins and hooks alike. Checked by removing that line fromexchange: the test then fails. The update test also checks that the plugin's source, which may hold a credential, is never printed.tests/worktree_edge_cases.bats"a umask 002 checkout…": its fixture plugins now answer--meta-plugin-info. Before, they answered nothing, which this PR now warns about, as intended.Verified
cargo nextest run --workspace(8 threads): 677 passed. bats, run locally in a sandbox (HOME, XDG andGIT_CONFIG_GLOBALall inside it):hooks,plugin_install,helpanddry_run(62 ok), plus the plugin, umask, symlinked-data and hook tests inworktree_edge_cases/worktree(6 ok).cargo clippy --workspace --all-targets --all-features -D warningsandcargo fmt --checkare clean.plugin update --checkwith no manifest still says "All plugins are up to date" and makes no plugins folder.origin/main07559ab: all three fail there ("All plugins are up to date"; no warning namingmeta-garbled-local; "meta and the plugin blocked each other" after 30 s).agent-25.sh(U70), in its own sandbox (git config --global --show-originpoints into it), on main's build:on this branch:
main's binary with the same plugin hangs until
timeout 10kills it (exit 124), and nothing is left running afterwards.Other
claude-plugin/.claude-plugin/plugin.json0.2.4 → 0.2.5, because themeta-pluginsskill text changed (the rule indocs/claude_code_skills.md).Not checked
plugin update; there's no network here. The lookup's error is now reported instead of dropped.Follow-ups
plugin updateuninstalls the old plugin before installing the new one, so a failed install leaves none. Also,meta plugin install user/reporecords no version, so such a plugin can never be checked (now said out loud instead of "up to date"), and updating a pinneduser/repo@v1reinstalls v1. All three are inregistry.rsand out of scope here.