refactor: centralize DEFAULT_MODEL constant, fix remaining kimi-k2.5-free references (#208)#210
refactor: centralize DEFAULT_MODEL constant, fix remaining kimi-k2.5-free references (#208)#210
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #208
) The yargs CLI default in `js/src/index.js` still referenced `opencode/kimi-k2.5-free` (discontinued model). When the yargs caching bug (#192) caused the `--model` CLI argument to be silently dropped, `argv.model` fell back to the stale default and the agent immediately failed with HTTP 401 "Model kimi-k2.5-free not supported". Also update the `--use-existing-claude-oauth` default-model check in `js/src/cli/model-config.js` from `kimi-k2.5-free` to `minimax-m2.5-free`, and fix the echo provider test to explicitly request `link-assistant/echo` instead of relying on the unavailable-model fallback behavior. - js/src/index.js: update --model yargs default to opencode/minimax-m2.5-free - js/src/cli/model-config.js: update oauth default-model check and comments - js/tests/models-cache.test.js: explicitly pass --model link-assistant/echo - docs/case-studies/issue-208/: add second failing run analysis and log Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit c673e62.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
…free refs (#208) - Add `js/src/cli/defaults.ts` with `DEFAULT_MODEL`, `DEFAULT_PROVIDER_ID`, and `DEFAULT_MODEL_ID` constants as single source of truth - Update `js/src/index.js` to use `DEFAULT_MODEL` constant for yargs default - Update `js/src/cli/model-config.js` to use `DEFAULT_PROVIDER_ID` / `DEFAULT_MODEL_ID` constants in OAuth fallback check and error messages - Update `js/src/tool/task.ts` to use `DEFAULT_PROVIDER_ID` / `DEFAULT_MODEL_ID` constants as the fallback model for sub-agents - Update case study README with corrected root cause analysis: the command-stream quoting bug in hive-mind passes agentArgs as a single quoted string, preventing yargs/process.argv from seeing --model - Update changeset to describe the new DEFAULT_MODEL centralization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🔄 Auto-restart 1/3 LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
hive-mind'sagent.lib.mjspassesagentArgsas a single template-interpolated string (e.g.,--model opencode/minimax-m2.5-free --verbose) tocommand-stream's$tag. Thecommand-streamquote()function wraps this space-containing string in single quotes, making the agent receive it as one argument — so yargs andgetModelFromProcessArgv()never see--modelas a separate flag, and the agent falls back to the yargs default.index.jswas stillopencode/kimi-k2.5-free, so the fallback was wrong.index.jsfromkimi-k2.5-freetominimax-m2.5-free.DEFAULT_MODELconstant injs/src/cli/defaults.ts— all places that reference the default now import from this single source.Changes
js/src/cli/defaults.ts— New file: exportsDEFAULT_MODEL = 'opencode/minimax-m2.5-free',DEFAULT_PROVIDER_ID, andDEFAULT_MODEL_IDconstants as the single source of truthjs/src/index.js— Updated--modelyargs default fromopencode/kimi-k2.5-freetoDEFAULT_MODEL(via import fromdefaults.ts)js/src/cli/model-config.js— Updated--use-existing-claude-oauthdefault-model check and error messages to useDEFAULT_PROVIDER_ID/DEFAULT_MODEL_ID(via import fromdefaults.ts); previously referencedkimi-k2.5-freejs/src/tool/task.ts— Updated fallback model for sub-agent tasks to useDEFAULT_PROVIDER_ID/DEFAULT_MODEL_ID(via import fromdefaults.ts); previously referencedminimax-m2.5-freeas a literaljs/tests/models-cache.test.js— Fixed echo provider test to explicitly pass--model link-assistant/echodocs/case-studies/issue-208/— Added second failing run analysis with correct root cause (command-stream quoting bug), Phase 2/3 documentation, and the second log fileTest plan
npm run check(eslint + prettier) passesbun test tests/models-cache.test.js— 5 pass, 0 failbun test tests/model-fallback.test.ts tests/model-not-supported.test.ts tests/output-response-model.test.js tests/model-validation.test.ts tests/models-cache.test.js— 41 pass, 0 failFixes #208
🤖 Generated with Claude Code