From 3ec601d4da46e0ac8f792edc046ebea5f2a5dedf Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 17 Jun 2026 14:50:01 -0400 Subject: [PATCH] fix(tier2): override top-level model to MiniMax-M3 The clone's opencode.json inherited the main repo's top-level 'model' field (zai/glm-5) via 'git clone'. The tier2-autonomous agent has its own 'model: minimax-coding-plan/MiniMax-M3' override, so the default agent path was technically correct, but any other agent spawned without an explicit model (or if the user manually switched to build/plan) would have used zai/glm-5 instead of MiniMax-M3. Fix: 1. Add top-level 'model: minimax-coding-plan/MiniMax-M3' to conductor/tier2/opencode.json.fragment. 2. setup_tier2_clone.ps1 merge now overrides 'model' from the fragment (was only overriding agent, permission, default_agent). 3. Added test_config_fragment_has_top_level_model (default-on) to assert the fragment's model field. 4. Added test_setup_script_overrides_model (opt-in TIER2_SANDBOX_TESTS=1) to assert the merge code. All 17 tests pass (14 default-on + 3 opt-in). Verified: re-ran setup against the live clone; opencode.json's top-level 'model' is now minimax-coding-plan/MiniMax-M3. --- conductor/tier2/opencode.json.fragment | 1 + scripts/tier2/setup_tier2_clone.ps1 | 1 + tests/test_tier2_setup_bootstrap.py | 9 +++++++++ tests/test_tier2_slash_command_spec.py | 12 ++++++++++++ 4 files changed, 23 insertions(+) diff --git a/conductor/tier2/opencode.json.fragment b/conductor/tier2/opencode.json.fragment index 620d12bb..f3b8d617 100644 --- a/conductor/tier2/opencode.json.fragment +++ b/conductor/tier2/opencode.json.fragment @@ -1,6 +1,7 @@ { "$schema": "https://opencode.ai/config.json", "default_agent": "tier2-autonomous", + "model": "minimax-coding-plan/MiniMax-M3", "permission": { "edit": "deny", "read": { diff --git a/scripts/tier2/setup_tier2_clone.ps1 b/scripts/tier2/setup_tier2_clone.ps1 index 16cb4ffd..3a614582 100644 --- a/scripts/tier2/setup_tier2_clone.ps1 +++ b/scripts/tier2/setup_tier2_clone.ps1 @@ -80,6 +80,7 @@ if ($PSCmdlet.ShouldProcess("Bootstrap Tier 2 clone at $Tier2ClonePath")) { if (-not $existing.permission) { $existing | Add-Member -MemberType NoteProperty -Name permission -Value ([PSCustomObject]@{}) } $existing.permission = $fragment.permission $existing | Add-Member -MemberType NoteProperty -Name default_agent -Value "tier2-autonomous" -Force + $existing | Add-Member -MemberType NoteProperty -Name model -Value $fragment.model -Force $existing | ConvertTo-Json -Depth 10 | Set-Content $cloneConfig } else { Copy-Item -Force "$MainRepoPath\conductor\tier2\opencode.json.fragment" $cloneConfig diff --git a/tests/test_tier2_setup_bootstrap.py b/tests/test_tier2_setup_bootstrap.py index 33ac1c14..8b276ab7 100644 --- a/tests/test_tier2_setup_bootstrap.py +++ b/tests/test_tier2_setup_bootstrap.py @@ -52,3 +52,12 @@ def test_setup_script_overrides_mcp_server() -> None: assert "mcp.'manual-slop'.environment.PYTHONPATH" in content, "script must override MCP server PYTHONPATH" assert "mcp_paths.toml" in content, "script must reset mcp_paths.toml" assert "extra_dirs = []" in content, "script must set extra_dirs to empty" + + +def test_setup_script_overrides_model() -> None: + """Regression test: setup_tier2_clone.ps1 MUST override the top-level + 'model' field in the clone's opencode.json to the Tier 2 model + (minimax-coding-plan/MiniMax-M3), not the main repo's zai/glm-5.""" + script = Path("scripts/tier2/setup_tier2_clone.ps1").resolve() + content = script.read_text(encoding="utf-8") + assert 'Name model -Value $fragment.model' in content, "script must override top-level model from fragment" diff --git a/tests/test_tier2_slash_command_spec.py b/tests/test_tier2_slash_command_spec.py index cddbcdb8..ae311780 100644 --- a/tests/test_tier2_slash_command_spec.py +++ b/tests/test_tier2_slash_command_spec.py @@ -89,6 +89,18 @@ def test_config_fragment_valid_json() -> None: assert "git reset*" in perms["bash"] +def test_config_fragment_has_top_level_model() -> None: + """Top-level model MUST be minimax-coding-plan/MiniMax-M3 (the Tier 2 + model), NOT the main repo's zai/glm-5. Regression test for the bug + where the clone inherited the main repo's default model and Tier 2 + ran on zai/glm-5 instead of MiniMax-M3 (2026-06-17).""" + data = json.loads(CONFIG_PATH.read_text(encoding="utf-8")) + assert "model" in data, "top-level model field is required" + assert data["model"] == "minimax-coding-plan/MiniMax-M3", ( + f"top-level model must be MiniMax-M3, got: {data['model']}" + ) + + def test_config_fragment_has_top_level_permission() -> None: """Top-level permission.read/write MUST allow the sandbox dirs (added 2026-06-17 after the bug where the agent's permission.read was not