fix(routing): compose routing behaviors before prepare - #258
Open
Sam Schillace (ramparte) wants to merge 1 commit into
Open
Conversation
…ing failure as required Ensure routing behavior bundles are composed before bundle preparation so routing hook modules are available during prepare(). Add required_behaviors parameter to load_and_prepare_bundle() so selected behaviors (routing) propagate load/composition errors instead of being silently ignored. This prevents a source-less hook being appended after prepare by composing routing ahead of prepare, and preserves compatibility by treating only routing as required while leaving other behaviors optional. Tests: Added unit tests to assert required behavior failures propagate and optional behavior failures remain non-fatal. Integration tests verify routing is composed when active and not when inactive, and that preparation errors propagate when routing is active. Acceptance: 38 tests passed locally (independently verified). Compatibility risk: low. The behavior tightens semantics for routing (will fail fast if routing composition fails) which may cause failures in environments that relied on silent warnings from earlier behavior composition. Other behaviors remain optional.
Sam Schillace (ramparte)
requested review from
Brian Krabach (bkrabach) and
Salil Das (sadlilas)
August 6, 2026 22:04
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.
Problem
The routing hook was being appended to the final bundle_config after prepare(), but its module source was not available during prepare. That produced a "source-less hook appended after prepare" failure: the hook entry existed in bundle_config but its code could not be imported/initialized because compose/load happened too late.
What I changed
Why
Behavior and failure semantics
Tests
Compatibility risk
Notes
PR created from ramparte:fix/compose-routing-before-prepare -> microsoft:feat/cli-session-matrix