conductor(checkpoint): Phase 4 complete - MiniMax refactored to use shared helper
Phase 4 of qwen_llama_grok_integration_20260606 ships the MiniMax
refactor. 6 of 6 state tasks done (all of Phase 4 in fact -- the
simplest phase).
Modules changed:
- src/ai_client.py: _send_minimax() refactored from 231 lines of
inline OpenAI-compatible send logic to 75 lines that delegate to
send_openai_compatible(). Net: 68% reduction.
- Preserved: 10-arg signature, _minimax_history_lock, _repair_minimax_history,
discussion_history handling, system+context message wrapping,
reasoning_content extraction (for minimax-reasoner models),
<thinking> tag wrapping, _trim_minimax_history
- Restored: tool-call loop (round_idx in range(MAX_TOOL_ROUNDS+2);
uses _execute_tool_calls_concurrently via asyncio.run /
run_coroutine_threadsafe; appends tool results to history)
- Dropped: extra_body={reasoning_split: True} (not supported by
send_openai_compatible; would be a Phase 5 adapter addition
if minimax-reasoner models need it)
- src/vendor_capabilities.py: 4 per-model MiniMax entries (M2.7, M2.5,
M2.1, M2). Each mirrors the wildcard defaults. Wildcard still
catches new/future model names.
No new test files (the existing tests/test_minimax_provider.py is
the safety net; 6/6 pass after the refactor).
Verification: 38/38 tests pass in batch.
Refactor stats (per state.toml [minimax_refactor_stats]):
- lines_before: 231
- lines_after: 75 (or 41 without tool loop; the worker initially
omitted it, I restored it for behavior preservation)
- tests_passing: 6 (test_minimax_provider.py)
- tests_failing: 0
- reduction: 68% (or 82% if comparing without tool loop)
Net effect for the track so far:
- 3 new src modules (vendor_capabilities, openai_compatible, qwen_adapter)
- 5 new vendor entry points in ai_client.py (_send_qwen, _send_grok,
_send_llama, _send_minimax refactored, plus their ensure_client and
list_models helpers)
- 1 dep added (dashscope)
- 5 new test files
- 26 new tests (3 vendor_capabilities + 6 openai_compatible + 5
qwen + 2 grok + 6 llama + 4 minimax capability entries verified)
- 8 new PROVIDERS entries
- 11 new cost_tracker entries
- Capability registry: 22 entries (1 minimax wildcard + 4 specific;
4 grok + 9 llama; 7 qwen + 1 qwen wildcard; 3 anthropic/gemini/
deepseek pending_migration stubs)
- 1 architectural spec section (3.1.1 'best API per vendor') added
- 1 spec section (4.3 Grok) revised after Grok consultation
- 1 follow-up track documented (13.1.B 'Llama Native APIs')
Phase 5 (UX adaptation) is now unblocked. The 9 adaptations from
spec §6 need to be applied to src/gui_2.py:
1. Screenshot button iff vision
2. Tools toggle iff tool_calling
3. Cache panel iff caching
4. Stream progress iff streaming
5. Fetch Models iff model_discovery
6. Token budget max = context_window
7. Cost panel: estimate / 'Free (local)' / '-'
8. Cost panel: 'Free (local)' for localhost
9. Cost panel: '-' for other cost_tracking=false
This commit is contained in: