fix(runtime): a plugin that throws in boot() is skipped, not fatal - #33
Merged
Conversation
An agent authoring a plugin can leave it momentarily uncbootable (a service wired with the wrong arguments). bootPlugin() called $plugin->boot() directly, so one throw aborted the whole boot loop — and a session-level read like agent:show, whose data lives in the session store, was blinded along with the rest. Wrap boot() in try/catch: log and skip, return false (the same contract the plugin.booting veto already uses — the caller continues with the next plugin). The broken plugin's services and routes are absent; the rest of the app boots. (greenhouse decisions/0181)
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
An agent authoring a plugin can leave it momentarily uncbootable — e.g. a service wired with the wrong constructor arguments.
PluginsManager::bootPlugin()called$plugin->boot()directly, so one throw aborted the whole boot loop, and a session-level read likeagent:show(whose data lives in the session store, not in that plugin) was blinded along with the rest of the app.Fix
Wrap
boot()in try/catch: log and skip, returningfalse— the same contract theplugin.bootingveto already uses, which the caller (registerAndBoot) already treats as "skip this plugin, continue the loop." The broken plugin's services and routes are absent; the rest of the app boots.Test
New:
testAPluginThatThrowsInBootIsSkippedAndTheLoopContinues— a plugin whoseboot()throws is skipped and a plugin registered after it still boots (5 assertions). Suite green (399 tests).Grounded in greenhouse
decisions/0181.