Skip to content

fix(spawn): case-insensitive model-glob matching for agent/session spawns - #265

Merged
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/case-insensitive-model-glob-matching
Jul 5, 2026
Merged

fix(spawn): case-insensitive model-glob matching for agent/session spawns#265
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/case-insensitive-model-glob-matching

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

Summary

  • Agent/session spawn operations now use case-insensitive model-glob matching, consistent with the routing matrix
  • Spawned child sessions inherit the routing hook config (custom_routing_dirs) so custom user matrices reach spawned agents

Technical Details

Bug: spawn_utils model resolution was OS-dependent

  • spawn_utils used raw fnmatch.filter() for model-hint resolution
  • This is OS-dependent: case-sensitive on Linux, case-insensitive on Windows
  • Caused mixed-case model ids (e.g., Qwen3.6-..., Claude3...) to silently fail to match globs

Fix

  • Now lowercases both sides: fnmatch.filter([m.lower() for m in names], pattern.lower())
  • Deterministic on all platforms
  • Consistent with routing matrix fix and unified-llm-client reference behavior

Config propagation to spawned sessions

  • Added tests verifying custom_routing_dirs config deep-merges into spawned child sessions
  • Path: compose() → merge_module_lists() → fresh mount() on child
  • Fixes reach agent sub-sessions, not just the main session

Testing

uv run pytest tests/test_spawn_utils.py tests/test_bundle.py -q

All pass, including new deep-merge verification tests.

Note

This fix pairs with amplifier-bundle-routing-matrix PR #30 (custom matrix loading at runtime).

Co-authored with Amplifier

…awns

spawn_utils model-hint resolution used raw fnmatch.filter (OS-dependent case);
now lowercases both sides, consistent with the routing matrix, so spawned agent
sub-sessions resolve mixed-case model ids correctly (e.g., `qwen3.6-*` ->
`Qwen3.6-...`).

Added tests proving routing hook config (custom_routing_dirs) deep-merges into
spawned child sessions via compose()/merge_module_lists(), so the routing fix
reaches agent sub-sessions.

Test plan: uv run pytest tests/test_spawn_utils.py tests/test_bundle.py -q
(all pass).

Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@bkrabach
Brian Krabach (bkrabach) merged commit 1334c35 into main Jul 5, 2026
3 checks passed
@bkrabach
Brian Krabach (bkrabach) deleted the fix/case-insensitive-model-glob-matching branch July 5, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant