fix(model): route chat_optimizer through minimax_chat (not just chat_target)#116
Open
jcforever1 wants to merge 1 commit into
Open
fix(model): route chat_optimizer through minimax_chat (not just chat_target)#116jcforever1 wants to merge 1 commit into
jcforever1 wants to merge 1 commit into
Conversation
…target) Two missing pieces in the minimax_chat dispatch chain: 1. minimax_backend.py did not define chat_optimizer or chat_optimizer_messages; only chat_target / chat_target_messages existed. Any caller using optimizer_backend='minimax_chat' would hit AttributeError or fall through to _openai (Azure). 2. skillopt/model/__init__.py's chat_optimizer and chat_optimizer_messages dispatchers checked claude_chat and qwen_chat but not minimax_chat, so minimax_chat callers would silently fall through to _openai.chat_optimizer (the Azure path), which fails with 'Azure OpenAI endpoint is not configured' on any setup without AZURE_OPENAI_* env vars. Adds chat_optimizer to minimax_backend.py (mirrors chat_target via _chat_messages_impl) and minimax_chat branches to both chat_optimizer / chat_optimizer_messages dispatchers. Verified locally: 1-epoch training on a 4-item SearchQA-format dataset went from '[skip] no usable patches — skill unchanged' (baseline fallback) to a successful accept_new_best with success_patches=1 per step. Co-authored-by: jc <jc@users.noreply.github.com>
Contributor
|
@jcforever1 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
Summary
Two missing pieces in the
minimax_chatdispatch chain prevented the optimizer side of any SkillOpt training run from working whenoptimizer_backend='minimax_chat':minimax_backend.pydid not definechat_optimizer— onlychat_target/chat_target_messagesexisted. Any caller usingoptimizer_backend='minimax_chat'would hitAttributeErroror silently fall through to the Azure path.skillopt/model/__init__.pychat_optimizerandchat_optimizer_messagesdispatchers checkedclaude_chatandqwen_chatbut NOTminimax_chat, so minimax users would silently fall through to_openai.chat_optimizer(Azure) which fails with"Azure OpenAI endpoint is not configured for optimizer."for any user withoutAZURE_OPENAI_*env vars.Symptoms before the fix
[skip] no usable patches — skill unchangedandtotal tokens: N (calls=6)— only the target side ran, optimizer was bypassedaccept=0 reject=0 skip=Nregardless of baseline quality, even when baseline is 0% and edits would clearly helpminimax_chat(or any non-OpenAI/Azure backend that wrapsclaude-agent-sdk-style chat) as the optimizer — silently produces no training improvementWhat this PR changes
chat_optimizerfunction tominimax_backend.py(mirrorschat_targetvia_chat_messages_impl)minimax_chatbranches to bothchat_optimizerandchat_optimizer_messagesdispatchers inskillopt/model/__init__.pyVerification
Local 1-epoch training on a 4-item SearchQA-format dataset went from
[skip] no usable patches — skill unchanged(baseline 0.5, optimizer bypassed) toaccept_new_bestwithsuccess_patches=1per step and the skill expanding from 451 chars to 951 chars. Total LLM calls went from 6 (target-only) to 12 (target + optimizer), confirming both sides of the pipeline now run.Motivation
The skillopt 0.2.0 release notes list
"Multi-backend support (OpenAI / Azure / Claude / Qwen / MiniMax)"— but on MiniMax the optimizer side was never actually wired. Anyone who pickedminimax_chatbased on that list would hit the bug. This was confirmed during a parallel-training bench run on macOS withANTHROPIC_AUTH_TOKENrouted to MiniMax's anthropic-compat proxy.Backwards compatibility
claude_chat/qwen_chat/openai_chatcallers unaffectedTest plan
skillopt-trainruns end-to-end withoptimizer_backend=minimax_chatskillopt-sleep runworks in the same backend (useschat_target, already worked)success_patches > 0instead of[skip] no usable patches