fix: config overrides reach session.context and session.orchestrator - #342
Merged
Brian Krabach (bkrabach) merged 1 commit intoSep 15, 2026
Merged
Conversation
resolve_bundle_config() walked providers/tools/hooks at the bundle root and
inside each agent, and nothing else. The context manager and orchestrator are
declared at session.context / session.orchestrator as single module entries
rather than lists, so the walk never visited them.
The consequence was total, not partial: NO context-manager or orchestrator
setting could be overridden from settings.yaml. Writing
overrides:
context-simple:
config:
max_tokens: 500000
did nothing, silently -- no error, no warning, no effect.
That contradicted the rule the loop is built on, stated in
_apply_config_overrides_to_section's own docstring: "overrides.<id>.config is
keyed by module identity, not by mount location, so it must reach a module
wherever it's declared." Holding a dict instead of a list is a mount-location
accident, which is exactly what that rule exists to rule out.
Adds _apply_config_overrides_to_entry(), the single-entry sibling, which
delegates to the list version so both paths share one definition of what an
override means -- normalize, match by module id, deep-merge with the override
winning, preserve other keys, return the original object untouched on no
match.
This is what makes context-simple's new max_tokens / max_tokens_fallback
settable by a user without editing a bundle.
Tests: 9 new, exercising the real seam rather than a copy of its logic,
including agreement between the entry and section paths. 2335 passed.
Generated with Amplifier
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Collaborator
Author
The five PRs in this coordinated changeMerge FIRST — independent of each other, any order:
Merge AFTER those three: The two config repos (4, 5) delete |
This was referenced Sep 15, 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 changed
resolve_bundle_config()walkedproviders/tools/hooksat the bundle root and inside each agent, and nothing else. The context manager and orchestrator are declared atsession.context/session.orchestratoras single module entries rather than lists, so the walk never visited them.The consequence was total, not partial: no context-manager or orchestrator setting could be overridden from
settings.yaml. Writingdid nothing, silently — no error, no warning, no effect.
Why
That contradicted the rule the loop is built on, stated in
_apply_config_overrides_to_section's own docstring: "overrides.<id>.config is keyed by module identity, not by mount location, so it must reach a module wherever it's declared." Holding a dict instead of a list is a mount-location accident, which is exactly what that rule exists to rule out.Adds
_apply_config_overrides_to_entry(), the single-entry sibling, which delegates to the list version so both paths share one definition of what an override means — normalize, match by module id, deep-merge with the override winning, preserve other keys, return the original object untouched on no match.This is what makes context-simple's new
max_tokens/max_tokens_fallbacksettable by a user without editing a bundle.How to verify
9 new tests, exercising the real seam rather than a copy of its logic, including agreement between the entry and section paths.
Breaking changes
None — this is additive. Overrides that previously did nothing now take effect; a
settings.yamlthat already named a context/orchestrator module id underoverrideswill begin applying, which was the documented intent.Coordinated five-repo change
max_tokensincontext-simplewas documented as "Maximum context size" but implemented as a fallback consulted only when a provider published no context window. Orchestrators always pass a provider, so the knob was silently dead in production. It is now a real cap (defaultNone= no cap); a newmax_tokens_fallback(default 200,000) took over the fallback role.Merge order matters
Merge FIRST (independent of each other, any order):
amplifier-module-context-simple—feat/max-tokens-capamplifier-module-provider-gemini—feat/publish-context-windowamplifier-app-cli—feat/session-module-config-overridesMerge AFTER those three:
4.
amplifier-foundation—chore/drop-dead-max-tokens5.
amplifier-bundle-attractor—chore/drop-dead-max-tokensRationale: the two config repos delete
max_tokenslines that only become safe-to-delete once context-simple's new semantics are in.Cross-repo verification
DTU instance
context-overflow-fix-20260915, all 8 target behaviors PASS:max_tokens: 500000caps to exactly 500,000.settings.yamloverrides.context-simple.confignow reachessession.contextthrough the CLI's ownresolve_bundle_config.test_image_vision_integration_with_real_api, needs a liveGOOGLE_API_KEY, fails onmaintoo)test_grpc_adapter_main.py::TestVerifyModuleType::test_non_isinstance_object_with_mount_passes, verified failing onmainbefore the change)