fix(config-reload): retire watcher after provider scope closes - #1254
Open
choi138 wants to merge 1 commit into
Open
fix(config-reload): retire watcher after provider scope closes#1254choi138 wants to merge 1 commit into
choi138 wants to merge 1 commit into
Conversation
Debounced filesystem callbacks can outlive their session provider scope and crash RPC hosts. Treat only scope closure as terminal and preserve other callback errors.
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.
Summary
Provider scope is closedfrom scope-bound config-reload callbacks as a terminal lifecycle signalReproduction
On
main, the new regression test fails fromConfigReloadWatchEngine.#evaluatePendingwith an uncaughtError: Provider scope is closed. With this patch, the callback closes the watcher and its subscriptions drain on the existing deferred teardown tick.Verification
bun run --cwd packages/coding-agent test test/suite/config-reload-lazy-teardown.test.ts(4 passed)bun run checkcommon.mjs --self-check(10/10),rpc-drive.mjs --self-test(4/4),mock-loop.mjs --with-tool --api openai-responses(4/4)Changelog
This fixes a user-visible RPC host crash and prompt timeout. Per
CONTRIBUTING.md, external contributors must not editCHANGELOG.md; a maintainer changelog entry is still needed for the changelog gate.Summary by cubic
Fixes a crash in the config-reload extension when a debounced filesystem event fires after the owning provider scope closes.
Provider scope is closedas a terminal signal and retires the orphaned watcher.Written for commit 4061523. Summary will update on new commits.