Skip to content

fix(model): complete MiniMax optimizer role deployment, timeout forwarding, and typing - #255

Open
RohithPariki wants to merge 1 commit into
microsoft:mainfrom
RohithPariki:auto-fix-model-minimax-hardening
Open

fix(model): complete MiniMax optimizer role deployment, timeout forwarding, and typing#255
RohithPariki wants to merge 1 commit into
microsoft:mainfrom
RohithPariki:auto-fix-model-minimax-hardening

Conversation

@RohithPariki

Copy link
Copy Markdown
Contributor

Problem

In skillopt.model.minimax_backend and the top-level skillopt.model dispatcher:

  1. chat_target dropped the timeout parameter when routing to minimax_chat, ignoring caller-configured timeouts.
  2. chat_optimizer_messages was not implemented in minimax_backend.py, forcing the dispatcher to fall back to _minimax.chat_target_messages(..., stage="optimizer") with mismatched target deployment resolution.
  3. set_optimizer_deployment was missing in minimax_backend.py, causing skillopt.model.set_optimizer_deployment() to omit MiniMax from optimizer deployment updates.
  4. Return type annotations in minimax_backend.py (dict[int]) were malformed generics.

Root Cause

MiniMax backend support previously focused on the target path, leaving optimizer role deployment registration, timeout forwarding, and structured message dispatcher entry points incomplete.

Solution

  • Added OPTIMIZER_DEPLOYMENT and set_optimizer_deployment to skillopt.model.minimax_backend.
  • Added chat_optimizer_messages in minimax_backend.py using OPTIMIZER_DEPLOYMENT.
  • Forwarded timeout across chat_target, chat_optimizer, and chat_optimizer_messages.
  • Fixed return type annotations to tuple[str, dict[str, int]].
  • Registered _minimax.set_optimizer_deployment in skillopt.model.set_optimizer_deployment.
  • Added unit tests in tests/test_minimax_backend.py validating deployment resolution, tool calls, and timeout propagation.

Testing

  • Ran unit tests: pytest tests/test_minimax_backend.py (9/9 passed).
  • Ran lint check: ruff check (clean).

Risk

Low. Additive and backwards-compatible with existing backend configuration.

@RohithPariki
RohithPariki marked this pull request as ready for review August 26, 2026 01:35
@Yif-Yang

Copy link
Copy Markdown
Contributor

Thanks — the role-specific MiniMax routing and timeout forwarding are useful. One initialization blocker remains: chat_optimizer_messages() reads OPTIMIZER_DEPLOYMENT, but the module never initializes that global; it is created only if set_optimizer_deployment() has already been called. A fresh process calling the optimizer path therefore raises NameError. Please initialize it from the optimizer deployment environment/default at import time and add a fresh-import regression that calls the optimizer directly without invoking the setter first.

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.

2 participants