Keep plugin host calls responsive across environment changes - #3557
Merged
ymichael merged 3 commits intoSep 12, 2026
Merged
Conversation
ymichael
force-pushed
the
bb/fixer-preserve-running-plugin-calls-when-environ-thr_sgfnrax8n9
branch
from
September 12, 2026 03:31
44c3b0b to
e0a740c
Compare
ymichael
force-pushed
the
bb/fixer-preserve-running-plugin-calls-when-environ-thr_sgfnrax8n9
branch
from
September 12, 2026 04:13
0dfb654 to
65c3680
Compare
ymichael
deleted the
bb/fixer-preserve-running-plugin-calls-when-environ-thr_sgfnrax8n9
branch
September 12, 2026 04:28
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.
Human comments
What was wrong
Plugin host calls share a process and its environment. After #3274, a call needing changed machine variables waited for all active calls to finish. That could block a stop/close call behind the long-running work it was meant to stop. Cancelling a waiting call could also trigger the manager's five-second force-kill timer and interrupt unrelated calls in the same worker.
What changed
Remove the environment wait queue. While any calls are active, incoming calls run immediately using the worker's current environment, even if they supply different values. Once all calls finish, the next incoming call supplies fresh values. Values from overlapping calls are not saved as pending updates. Continuous overlapping work can intentionally retain old settings until the worker becomes idle.
The environment is restored when the last active call finishes. Existing cancellation and force-kill protection for unresponsive handlers remain intact. Acquisition stays inside the call's error cleanup.
Bump
HOST_DAEMON_PROTOCOL_VERSIONfrom 205 to 206 so enrolled machines update for the changed environment semantics. Document when plugin calls adopt settings in the machine CLI guide, configuration docs, and bb-cli skill reference. No new CLI flags or public SDK members. This PR does not touch UI code.How you verified
pnpm exec turbo run test build typecheck --filter=@bb/host-daemon --filter=@bb/host-daemon-contract --force— 617 daemon tests and 56 contract tests passed; all 11 Turbo tasks passed.bbCLI, isolated source server, enrolled built daemon, and a diagnostic plugin installed withbb plugin install. Two 20-second calls overlapped across a machine-variable update and retained the old values in one worker PID; stop commands returned in 268 ms and 259 ms; the first idle call adopted the new values and later reflected removal.git diff --check origin/main...HEADpassed.