diff options
| author | Adam Malczewski <[email protected]> | 2026-04-30 20:24:33 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-04-30 20:24:33 +0900 |
| commit | 262aa7395c50b449ce0a897f28b1e33c319f5dc7 (patch) | |
| tree | 2ccc7c7f6402e76aea6b8788046215e82650fdfc /.rules/plan/05-10-config-swap.md | |
| parent | 1e7a273bda744f93f230d21df895b54d2a81ce15 (diff) | |
| download | dispatch-adapter-minimax-main.tar.gz dispatch-adapter-minimax-main.zip | |
Diffstat (limited to '.rules/plan/05-10-config-swap.md')
| -rw-r--r-- | .rules/plan/05-10-config-swap.md | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/.rules/plan/05-10-config-swap.md b/.rules/plan/05-10-config-swap.md new file mode 100644 index 0000000..708284b --- /dev/null +++ b/.rules/plan/05-10-config-swap.md @@ -0,0 +1,95 @@ +# Phase 05 — Config swap + +**Estimated time:** ~10 minutes +**Touches:** `lib/dispatch/adapter/minimax.rb`. + +## Goal + +Swap the four configuration constants in `lib/dispatch/adapter/minimax.rb` +so the adapter targets MiniMax instead of Anthropic. + +| Constant | Old value | New value | +|---|---|---| +| `DEFAULT_BASE_URL` | `"https://api.anthropic.com"` | `"https://api.minimax.io/anthropic"` | +| `DEFAULT_MODEL` | `"claude-sonnet-4-5-20250929"` (or whatever) | `"MiniMax-M2.7"` | +| `MESSAGES_PATH` | `"/v1/messages"` | `"/v1/messages"` (UNCHANGED) | +| `COUNT_TOKENS_PATH` | `"/v1/messages/count_tokens"` | `"/v1/messages/count_tokens"` (UNCHANGED) | +| `MODELS_PATH` | `"/v1/models"` | `"/v1/models"` (UNCHANGED) | + +The path constants stay because MiniMax mirrors the Anthropic SDK's URL +shape. Only the host changes. + +## Steps + +### 1. Update `DEFAULT_BASE_URL` + +Find the constant declaration in `lib/dispatch/adapter/minimax.rb`: + +```ruby +DEFAULT_BASE_URL = "https://api.anthropic.com" +``` + +Change it to: + +```ruby +DEFAULT_BASE_URL = "https://api.minimax.io/anthropic" +``` + +### 2. Update `DEFAULT_MODEL` + +Find: + +```ruby +DEFAULT_MODEL = "claude-sonnet-4-5-20250929" +``` + +(The exact string may differ — find whatever the current default is.) + +Change it to: + +```ruby +DEFAULT_MODEL = "MiniMax-M2.7" +``` + +### 3. Verify path constants are present + +Confirm the gem still defines (do NOT change them): + +- `MESSAGES_PATH = "/v1/messages"` +- `COUNT_TOKENS_PATH = "/v1/messages/count_tokens"` +- `MODELS_PATH = "/v1/models"` + +If any of these are inlined as strings in method bodies rather than +constants, leave them inlined — do not refactor. + +### 4. Update any `DEFAULT_BASE_URL` or `DEFAULT_MODEL` references in specs + +Run `grep -rn 'api.anthropic.com\|claude-sonnet-4' spec/`. For every +match in a spec file: + +- If the spec is asserting the *old* default value, update the assertion + to the new value. +- If the spec is using the URL/model in a `stub_request` for an + Anthropic-shaped fixture, leave the stub alone for now — fixture work + is in phase 12 and spec retargets are in phases 13–16. + +You may NOT delete or weaken any spec to make it pass. Only update +hardcoded references that genuinely must follow the constant rename. + +## Acceptance criteria + +- `grep -rn 'https://api.anthropic.com' lib/` returns ZERO matches. +- `grep -rn 'claude-sonnet' lib/` returns ZERO matches. +- `DEFAULT_BASE_URL == "https://api.minimax.io/anthropic"` (verified by + `bundle exec ruby -e 'require "./lib/dispatch/adapter/minimax"; \ + puts Dispatch::Adapter::MiniMax::DEFAULT_BASE_URL'`). +- `DEFAULT_MODEL == "MiniMax-M2.7"`. +- `bundle exec rubocop --autocorrect-all` exits 0. + +## Verification + +Run `run_tests` with `project_path=reference/dispatch-adapter-minimax`. +Rubocop must be clean. RSpec failures from fixtures and specs that still +reference Anthropic URLs are acceptable — they're cleaned up in phases +12–16. RSpec failures NOT explainable by Anthropic URL/model references +must be investigated and fixed before calling `ask_for_next_plan`. |
