feat(core): reload commands from config change feed - #39160
Merged
Conversation
kitlangton
force-pushed
the
command-reload
branch
from
July 27, 2026 18:33
d3e10e9 to
719645a
Compare
This was referenced Jul 27, 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.
What
Command source invalidation via
config.changes: editing, creating, renaming, or deleting Markdown files under a config root's{command,commands}directory now rebuilds command state directly, without waiting for aconfig.updatedevent that descendant edits never trigger. Fourth slice of the config source reload series (#38983, #39131, #39157); fixes #37429 for existing config roots (new-root discovery lands later in the series).How
ConfigCommandPluginsubscribes to the sharedconfig.changes()feed exposed in #39131 and owns its path predicate locally, per the design's ownership split (Config owns topology, domains own which paths matter):<root>/{command,commands}with no file-suffix check, so directory-level events (e.g.mv commands commands-old) that carry no per-file paths still invalidate.config.updatedhandler stays for structured config edits (inlinecommandsinopencode.json); both feeds share onereloadeffect.Testing
Reworked the source-lifecycle matrix against the renamed services (
Command,Bus) using the #39157 fixtures —Config.testLayerprovides the entries andConfig.Test.emitChangedrives the feed, no hand-rolled Watcher stubs:command.updatedsubscription so the event is asserted as a read barrier (committed state visible at delivery).Tests were red first (all six fail without the fix), then green with it. TestClock note: both
Stream.debounce(100ms) andState.reload(500ms batch debounce) register their sleeps from fiber hops a singleTestClock.adjustflush can miss, so the tests drive the clock with a settle/adjust loop (advance) that converges deterministically — verified stable across 10 consecutive full-file runs.bun test test/config/passes except the pre-existingPluginSupervisor config > reloads an auto-discovered plugin when its file changesfailure present on clean base;bun typecheckclean.Stack
test-fixtures