Skip to content

feat: update tm models defaults#1225

Merged
Crunchyman-ralph merged 4 commits intonextfrom
ralph/feat/improve.defaults
Sep 19, 2025
Merged

feat: update tm models defaults#1225
Crunchyman-ralph merged 4 commits intonextfrom
ralph/feat/improve.defaults

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Sep 19, 2025

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 🔌 Integration
  • 📝 Docs
  • 🧹 Refactor
  • Other:

Description

Related Issues

How to Test This

# Example commands or steps

Expected result:

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

Changelog Entry


For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

  • Chores

    • Updated default AI provider/model defaults for improved quality: main → Claude Sonnet 4 (Anthropic), fallback → Claude 3.7 Sonnet; adjusted token limits and standardized the research model label to “sonar.” Added a minor release note recording these default improvements and cleaned up obsolete release entries.
  • Tests

    • Updated tests to expect the new default main, fallback, and research model values.

@changeset-bot
Copy link

changeset-bot bot commented Sep 19, 2025

🦋 Changeset detected

Latest commit: 1eb4180

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Updates default AI model selections across configs, core defaults, tests, and scripts; switches .taskmaster main provider/model to Anthropic sonnet 4 and updates fallbacks/token limits. Adds one changeset and removes several other changeset files. No API or control-flow changes.

Changes

Cohort / File(s) Summary of changes
Core defaults & tests
packages/tm-core/src/interfaces/configuration.interface.ts, packages/tm-core/src/config/config-manager.ts, packages/tm-core/src/config/config-manager.spec.ts
Default model values updated: main → claude-sonnet-4-20250514, fallback → claude-3-7-sonnet-20250219. Tests now use DEFAULT_CONFIG_VALUES. RuntimeStateManager test method names updated to getCurrentTag/setCurrentTag.
Taskmaster runtime config
.taskmaster/config.json
Main provider changed from Grok to anthropic with claude-sonnet-4-20250514 (maxTokens 64000); fallback set to claude-3-7-sonnet-20250219 (maxTokens 120000). Research/grokCli blocks unchanged except minor model id adjustments.
Scripts defaults
scripts/modules/config-manager.js
Script default models aligned with core defaults: main → claude-sonnet-4-20250514; fallback → claude-3-7-sonnet-20250219 (maxTokens updated). Research model label adjusted (sonar-prosonar).
Test fixtures
tests/unit/config-manager.test.js
DEFAULT_CONFIG in tests updated to reflect new main/research/fallback model ids and fallback maxTokens.
Changesets added/removed / docs
.changeset/ready-plums-worry.md, .changeset/easy-deer-heal.md, .changeset/moody-oranges-slide.md, .changeset/odd-otters-tan.md, .changeset/pretty-planes-cross.md
Added ready-plums-worry.md (minor release note for task-master-ai defaults). Removed three prior changeset files. Updated pretty-planes-cross.md content (provider wording and Grok/codebase-context docs).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • feat: add gpt-5 support #1105 — modifies scripts/modules/config-manager.js and related model/default selection logic; likely overlaps with these default changes.

Suggested reviewers

  • eyaltoledano

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat: update tm models defaults" is concise and accurately summarizes the primary change — updating Task Master model defaults across configs, defaults, and tests; it clearly signals a feature-level update and is meaningful to reviewers scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ralph/feat/improve.defaults

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/modules/config-manager.js (1)

1008-1017: Bug: base URL property name mismatch (baseURL vs baseUrl).

Role configs commonly use baseUrl; current check for baseURL will miss configured values.

Apply this diff:

 function getBaseUrlForRole(role, explicitRoot = null) {
   const roleConfig = getModelConfigForRole(role, explicitRoot);
-  if (roleConfig && typeof roleConfig.baseURL === 'string') {
-    return roleConfig.baseURL;
+  if (roleConfig && typeof roleConfig.baseUrl === 'string') {
+    return roleConfig.baseUrl;
+  }
+  // Back-compat for any legacy configs that might have used baseURL
+  if (roleConfig && typeof roleConfig.baseURL === 'string') {
+    return roleConfig.baseURL;
   }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47ddb60 and 6d17863.

📒 Files selected for processing (6)
  • .changeset/ready-plums-worry.md (1 hunks)
  • .taskmaster/config.json (1 hunks)
  • packages/tm-core/src/config/config-manager.spec.ts (1 hunks)
  • packages/tm-core/src/config/config-manager.ts (1 hunks)
  • packages/tm-core/src/interfaces/configuration.interface.ts (1 hunks)
  • scripts/modules/config-manager.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • packages/tm-core/src/config/config-manager.spec.ts
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • packages/tm-core/src/config/config-manager.spec.ts
**/?(*.)+(spec|test).ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

In JavaScript/TypeScript projects using Jest, test files should match *.test.ts and *.spec.ts patterns

Files:

  • packages/tm-core/src/config/config-manager.spec.ts
.changeset/*.md

📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)

.changeset/*.md: When running npm run changeset or npx changeset add, provide a concise summary of the changes for the CHANGELOG.md in imperative mood, typically a single line, and not a detailed Git commit message.
The changeset summary should be user-facing, describing what changed in the released version that is relevant to users or consumers of the package.
Do not use your detailed Git commit message body as the changeset summary.

Files:

  • .changeset/ready-plums-worry.md
.changeset/*

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

Create appropriate changesets for new features, use semantic versioning, include tagged system information in release notes, and document breaking changes if any.

Files:

  • .changeset/ready-plums-worry.md
scripts/modules/config-manager.js

📄 CodeRabbit inference engine (.cursor/rules/ai_providers.mdc)

scripts/modules/config-manager.js: Update scripts/modules/config-manager.js to add the new provider to MODEL_MAP, ensure it is included in VALID_PROVIDERS, and update API key handling logic.
If adding Ollama or another provider not requiring an API key, add a specific check at the beginning of isApiKeySet and getMcpApiKeyStatus in scripts/modules/config-manager.js to return true immediately for that provider.

scripts/modules/config-manager.js: Import and use specific getters from scripts/modules/config-manager.js to access configuration values needed for application logic; pass the explicitRoot parameter to getters if calling from MCP direct functions.
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before attempting an AI call.
Handle potential ConfigurationError if the .taskmasterconfig file is missing or invalid when accessed via getConfig.

Files:

  • scripts/modules/config-manager.js
scripts/modules/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Each module in scripts/modules/ should be focused on a single responsibility, following the modular architecture (e.g., commands.js for CLI command handling, task-manager.js for task data and core logic, dependency-manager.js for dependency management, ui.js for CLI output formatting, ai-services-unified.js for AI service integration, config-manager.js for configuration management, utils.js for utility functions).

scripts/modules/*.js: Export all core functions, helper functions, and utility methods needed by your new function or command from their respective modules. Explicitly review the module's export block to ensure every required dependency is included.
Pass all required parameters to functions you call within your implementation and verify that direct function parameters match their core function counterparts.
Use consistent file naming conventions: 'task_${id.toString().padStart(3, '0')}.txt', use path.join for composing file paths, and use appropriate file extensions (.txt for tasks, .json for data).
Use structured error objects with code and message properties, include clear error messages, and handle both function-specific and file system errors.
Import all silent mode utilities together from 'scripts/modules/utils.js' and always use isSilentMode() to check global silent mode status. Wrap core function calls within direct functions using enableSilentMode() and disableSilentMode() in a try/finally block if the core function might produce console output.
Core functions should check outputFormat === 'text' before displaying UI elements and use internal logging that respects silent mode.
Design functions to accept dependencies as parameters (dependency injection) and avoid hard-coded dependencies that are difficult to mock.
Keep pure logic separate from I/O operations or UI rendering to allow testing the logic without mocking complex dependencies.
When implementing core logic for new features, do so in 'scripts/modules/' before CLI or MCP interfaces, and d...

Files:

  • scripts/modules/config-manager.js
scripts/modules/**

📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

When using the MCP server, restart it if core logic in scripts/modules or MCP tool/direct function definitions change.

Files:

  • scripts/modules/config-manager.js
scripts/modules/*

📄 CodeRabbit inference engine (.cursor/rules/tags.mdc)

scripts/modules/*: Every command that reads or writes tasks.json must be tag-aware
All command files must import getCurrentTag from utils.js
Every CLI command that operates on tasks must include the --tag CLI option
All commands must resolve the tag using the pattern: options.tag || getCurrentTag(projectRoot) || 'master'
All commands must find projectRoot with error handling before proceeding
All commands must pass { projectRoot, tag } as context to core functions
MCP direct functions must accept and use a context object containing projectRoot and tag, and pass them to core functions
Do not hard-code tag resolution (e.g., const tag = options.tag || 'master';); always use getCurrentTag
Do not omit the --tag CLI option in commands that operate on tasks
Do not omit the context parameter when calling core functions from commands
Do not call readJSON or writeJSON without passing projectRoot and tag

Files:

  • scripts/modules/config-manager.js
**/*.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.js: Declare and initialize global variables at the top of modules to avoid hoisting issues.
Use proper function declarations to avoid hoisting issues and initialize variables before they are referenced.
Do not reference variables before their declaration in module scope.
Use dynamic imports (import()) to avoid initialization order issues in modules.

Files:

  • scripts/modules/config-manager.js
.taskmaster/config.json

📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

.taskmaster/config.json: Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, etc.) in the .taskmaster/config.json file located in the project root directory. Do not configure non-API key settings via environment variables.
Do not manually edit .taskmaster/config.json unless you are certain of the changes; use the task-master models command or models MCP tool for configuration.

.taskmaster/config.json: Do not manually edit the .taskmaster/config.json file. Use the included commands either in the MCP or CLI format as needed. Always prioritize MCP tools when available and use the CLI as a fallback.
All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.
Do not manually edit the .taskmaster/config.json file; always use the provided CLI or MCP tools for configuration changes.

Files:

  • .taskmaster/config.json
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Applies to scripts/modules/task-manager/*.js : Do not fetch AI-specific parameters (model ID, max tokens, temp) using `config-manager.js` getters for the AI call. Pass the `role` instead.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/task-manager/**/*.js : Do not call AI-specific getters (like `getMainModelId`, `getMainMaxTokens`) from core logic functions in `scripts/modules/task-manager/*`; instead, pass the `role` to the unified AI service.
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:02.683Z
Learning: Applies to .taskmaster/config.json : Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, tag management) in `.taskmaster/config.json` in the project root. Do not configure these via environment variables.

Applied to files:

  • packages/tm-core/src/interfaces/configuration.interface.ts
  • .taskmaster/config.json
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.

Applied to files:

  • packages/tm-core/src/interfaces/configuration.interface.ts
  • .taskmaster/config.json
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Store Taskmaster configuration settings (AI model selections, parameters, logging level, default subtasks/priority, project name, etc.) in the `.taskmaster/config.json` file located in the project root directory. Do not configure non-API key settings via environment variables.

Applied to files:

  • packages/tm-core/src/interfaces/configuration.interface.ts
  • .taskmaster/config.json
📚 Learning: 2025-09-01T09:55:15.061Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-01T09:55:15.061Z
Learning: Applies to assets/.taskmaster/config.json : Never manually edit .taskmaster/config.json; configure models via `task-master models`

Applied to files:

  • .taskmaster/config.json
📚 Learning: 2025-07-18T17:10:12.881Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Applies to .taskmaster/config.json : Do not manually edit `.taskmaster/config.json` unless you are certain of the changes; use the `task-master models` command or `models` MCP tool for configuration.

Applied to files:

  • .taskmaster/config.json
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to .taskmasterconfig : Use `.taskmasterconfig` (JSON) in the project root for storing Taskmaster configuration (excluding API keys), and manage it via the `task-master models --setup` CLI command or the `models` MCP tool.

Applied to files:

  • .taskmaster/config.json
🪛 markdownlint-cli2 (0.18.1)
.changeset/ready-plums-worry.md

5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


8-8: Files should end with a single newline character

(MD047, single-trailing-newline)

🪛 GitHub Actions: CI
.taskmaster/config.json

[error] 1-43: Biome format check failed. Found 1 formatting error. Run 'biome format .' to fix.

🔇 Additional comments (3)
packages/tm-core/src/interfaces/configuration.interface.ts (1)

402-404: Defaults bump looks consistent with the PR.

New MAIN/FALLBACK model IDs align with other changes. No further issues in this file.

Please confirm docs/CLI help that reference defaults are updated accordingly.

scripts/modules/config-manager.js (2)

28-46: Defaults updated (main/research/fallback) — OK.

Values look sane and consistent with the rest of the PR.

Double‑check MODEL_MAP contains claude-sonnet-4-20250514 and claude-3-7-sonnet-20250219 as supported to avoid UI listing gaps.


43-45: Resolved — fallback maxTokens aligns with MODEL_MAP
scripts/modules/supported-models.json lists "claude-3-7-sonnet-20250219" with max_tokens: 120000, so the 120000 fallback in scripts/modules/config-manager.js (lines 43–45) matches the model map.

Comment on lines +5 to +8
Improve taskmaster ai provider defaults

- moving from main anthropic 3.7 to anthropic sonnet 4
- moving from fallback anthropic 3.5 to anthropic 3.7 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Use a single‑line, imperative changeset summary per guidelines.

Keep it user‑facing and concise; include exact model IDs.

Apply this diff:

-Improve taskmaster ai provider defaults
-
-- moving from main anthropic 3.7 to anthropic sonnet 4
-- moving from fallback anthropic 3.5 to anthropic 3.7
+Update default models: main -> claude-sonnet-4-20250514; fallback -> claude-3-7-sonnet-20250219.

Also ensure the file ends with a newline to satisfy linters.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Improve taskmaster ai provider defaults
- moving from main anthropic 3.7 to anthropic sonnet 4
- moving from fallback anthropic 3.5 to anthropic 3.7
Update default models: main -> claude-sonnet-4-20250514; fallback -> claude-3-7-sonnet-20250219.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


8-8: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
In .changeset/ready-plums-worry.md around lines 5 to 8, replace the multi-line
descriptive text with a single-line, imperative changeset summary that names the
exact model IDs (for example: "Set Taskmaster AI defaults to anthropic-sonnet-4
with fallback anthropic-claude-3.7"), update the body to reflect moving the main
default from anthropic-claude-3.7 to anthropic-sonnet-4 and the fallback from
anthropic-claude-3.5 to anthropic-claude-3.7, and ensure the file ends with a
trailing newline to satisfy linters.

Comment on lines 1 to 43
{
"models": {
"main": {
"provider": "grok-cli",
"modelId": "grok-4-latest",
"maxTokens": 131072,
"temperature": 0.2
},
"research": {
"provider": "perplexity",
"modelId": "sonar",
"maxTokens": 8700,
"temperature": 0.1
},
"fallback": {
"provider": "anthropic",
"modelId": "claude-sonnet-4-20250514",
"maxTokens": 64000,
"temperature": 0.2
}
},
"global": {
"logLevel": "info",
"debug": false,
"defaultNumTasks": 10,
"defaultSubtasks": 5,
"defaultPriority": "medium",
"projectName": "Taskmaster",
"ollamaBaseURL": "http://localhost:11434/api",
"bedrockBaseURL": "https://bedrock.us-east-1.amazonaws.com",
"responseLanguage": "English",
"enableCodebaseAnalysis": true,
"userId": "1234567890",
"azureBaseURL": "https://your-endpoint.azure.com/",
"defaultTag": "master"
},
"claudeCode": {},
"grokCli": {
"timeout": 120000,
"workingDirectory": null,
"defaultModel": "grok-4-latest"
}
}
"models": {
"main": {
"provider": "anthropic",
"modelId": "claude-sonnet-4-20250514",
"maxTokens": 64000,
"temperature": 0.2
},
"research": {
"provider": "perplexity",
"modelId": "sonar",
"maxTokens": 8700,
"temperature": 0.1
},
"fallback": {
"provider": "anthropic",
"modelId": "claude-3-7-sonnet-20250219",
"maxTokens": 120000,
"temperature": 0.2
}
},
"global": {
"logLevel": "info",
"debug": false,
"defaultNumTasks": 10,
"defaultSubtasks": 5,
"defaultPriority": "medium",
"projectName": "Taskmaster",
"ollamaBaseURL": "http://localhost:11434/api",
"bedrockBaseURL": "https://bedrock.us-east-1.amazonaws.com",
"responseLanguage": "English",
"enableCodebaseAnalysis": true,
"userId": "1234567890",
"azureBaseURL": "https://your-endpoint.azure.com/",
"defaultTag": "master"
},
"claudeCode": {},
"grokCli": {
"timeout": 120000,
"workingDirectory": null,
"defaultModel": "grok-4-latest"
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

❓ Verification inconclusive

Fix Biome format failure.

Run the formatter to satisfy CI; also ensure a trailing newline.


🏁 Script executed:

#!/bin/bash
biome format . || npx @biomejs/biome format .
git diff --name-only --diff-filter=M

Length of output: 2947


Fix Biome config errors blocking formatter

biome.json fails to parse (unknown keys: files.ignore at line ~3, and linter.include / linter.ignore at lines ~28–29). Replace with Biome-supported keys (use files.includes and linter.includes or convert ignore arrays to negated includes/domains), then run biome format . (or npx @biomejs/biome format .) and ensure .taskmaster/config.json ends with a trailing newline.

🧰 Tools
🪛 GitHub Actions: CI

[error] 1-43: Biome format check failed. Found 1 formatting error. Run 'biome format .' to fix.

🤖 Prompt for AI Agents
.taskmaster/config.json lines 1-43: Biome config keys are invalid for the
formatter; replace unsupported keys (e.g., files.ignore → files.includes,
linter.include / linter.ignore → linter.includes and use negated include
patterns where needed) so the config uses Biome-supported keys and formats
correctly; convert any ignore arrays into equivalent negated include patterns or
domains, run `biome format .` (or `npx @biomejs/biome format .`) to validate and
reformat, and ensure the file ends with a single trailing newline.

Comment on lines 2 to 21
"models": {
"main": {
"provider": "anthropic",
"modelId": "claude-sonnet-4-20250514",
"maxTokens": 64000,
"temperature": 0.2
},
"research": {
"provider": "perplexity",
"modelId": "sonar",
"maxTokens": 8700,
"temperature": 0.1
},
"fallback": {
"provider": "anthropic",
"modelId": "claude-3-7-sonnet-20250219",
"maxTokens": 120000,
"temperature": 0.2
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Do not manually edit .taskmaster/config.json; update via CLI/MCP.

Per project rules, model changes should be applied using task-master models or the MCP tool to keep metadata/state consistent.

Example CLI:

  • task-master models set main anthropic claude-sonnet-4-20250514 --max-tokens 64000 --temperature 0.2
  • task-master models set fallback anthropic claude-3-7-sonnet-20250219 --max-tokens 120000 --temperature 0.2
🤖 Prompt for AI Agents
In .taskmaster/config.json lines 2-21: this file was modified directly to change
model entries but per project rules you must not edit this file by hand; instead
update model metadata via the CLI or the MCP to keep state/metadata consistent.
Use the task-master models set command (or the MCP UI) to update the "main" and
"fallback" model definitions with the new provider, modelId, maxTokens and
temperature values so the config is regenerated correctly, then revert the
direct edits to this file.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (9)
tests/unit/config-manager.test.js (6)

65-88: Test setup reads through mocks; use requireActual and don’t exit the runner

You mock fs/path earlier, so this block never loads the real JSON. Replace with requireActual and throw instead of process.exit.

-const __filename = fileURLToPath(import.meta.url); // Get current file path
-const __dirname = path.dirname(__filename); // Get current directory
-const realSupportedModelsPath = path.resolve(
-	__dirname,
-	'../../scripts/modules/supported-models.json'
-);
-let REAL_SUPPORTED_MODELS_CONTENT;
-let REAL_SUPPORTED_MODELS_DATA;
-try {
-	REAL_SUPPORTED_MODELS_CONTENT = fs.readFileSync(
-		realSupportedModelsPath,
-		'utf-8'
-	);
-	REAL_SUPPORTED_MODELS_DATA = JSON.parse(REAL_SUPPORTED_MODELS_CONTENT);
-} catch (err) {
-	console.error(
-		'FATAL TEST SETUP ERROR: Could not read or parse real supported-models.json',
-		err
-	);
-	REAL_SUPPORTED_MODELS_CONTENT = '{}'; // Default to empty object on error
-	REAL_SUPPORTED_MODELS_DATA = {};
-	process.exit(1); // Exit if essential test data can't be loaded
-}
+const realFs = jest.requireActual('fs');
+const realPath = jest.requireActual('path');
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = realPath.dirname(__filename);
+const realSupportedModelsPath = realPath.resolve(
+	__dirname,
+	'../../scripts/modules/supported-models.json'
+);
+let REAL_SUPPORTED_MODELS_CONTENT = '{}';
+let REAL_SUPPORTED_MODELS_DATA = {};
+try {
+	REAL_SUPPORTED_MODELS_CONTENT = realFs.readFileSync(
+		realSupportedModelsPath,
+		'utf-8'
+	);
+	REAL_SUPPORTED_MODELS_DATA = JSON.parse(REAL_SUPPORTED_MODELS_CONTENT);
+} catch (err) {
+	throw new Error(
+		`FATAL TEST SETUP ERROR: Could not read or parse real supported-models.json: ${err.message}`
+	);
+}

373-382: Test name vs assertion mismatch (ollama/openrouter)

Description says “should return true”, but assertions expect false. Flip to true.

-		expect(
-			configManager.validateProviderModelCombination('ollama', 'any-model')
-		).toBe(false);
-		expect(
-			configManager.validateProviderModelCombination('openrouter', 'any/model')
-		).toBe(false);
+		expect(
+			configManager.validateProviderModelCombination('ollama', 'any-model')
+		).toBe(true);
+		expect(
+			configManager.validateProviderModelCombination('openrouter', 'any/model')
+		).toBe(true);

501-508: Duplicate throw; remove unreachable line

Second throw is dead code.

-			throw new Error(`Unexpected fs.readFileSync call: ${filePath}`);
-			throw new Error(`Unexpected fs.readFileSync call: ${filePath}`);
+			throw new Error(`Unexpected fs.readFileSync call: ${filePath}`);

641-647: Spreading possibly undefined throws at runtime

VALID_CUSTOM_CONFIG.claudeCode is undefined; object spread will crash. Guard with ?? {}.

-			claudeCode: {
-				...DEFAULT_CONFIG.claudeCode,
-				...VALID_CUSTOM_CONFIG.claudeCode
-			},
+			claudeCode: {
+				...DEFAULT_CONFIG.claudeCode,
+				...(VALID_CUSTOM_CONFIG.claudeCode ?? {})
+			},

684-690: Wrong variable and undefined spread

Use PARTIAL_CONFIG and guard with ?? {}.

-			claudeCode: {
-				...DEFAULT_CONFIG.claudeCode,
-				...VALID_CUSTOM_CONFIG.claudeCode
-			},
+			claudeCode: {
+				...DEFAULT_CONFIG.claudeCode,
+				...(PARTIAL_CONFIG.claudeCode ?? {})
+			},

793-799: Undefined spread again in expected config

Guard and reference the correct source.

-			claudeCode: {
-				...DEFAULT_CONFIG.claudeCode,
-				...VALID_CUSTOM_CONFIG.claudeCode
-			},
+			claudeCode: {
+				...DEFAULT_CONFIG.claudeCode,
+				...(INVALID_PROVIDER_CONFIG.claudeCode ?? {})
+			},
packages/tm-core/src/config/config-manager.ts (1)

274-281: Implement no-op watch() to satisfy tests and future extension

Tests call manager.watch(); add a minimal API that warns and returns an unsubscribe no-op.

   getConfigSources() {
     return this.merger.getSources();
   }
+
+  /**
+   * Watch for configuration changes (not implemented yet)
+   * Returns an unsubscribe no-op function.
+   */
+  watch(_callback: (...args: any[]) => void) {
+    console.warn('Configuration watching not yet implemented');
+    return () => {};
+  }
 }
packages/tm-core/src/config/config-manager.spec.ts (2)

179-182: Fix storage expectation to match getStorageConfig shape

getStorageConfig includes basePath and apiConfigured for non-API storage.

-			expect(storage).toEqual({ type: 'file' });
+			expect(storage).toEqual({
+				type: 'file',
+				basePath: testProjectRoot,
+				apiConfigured: false
+			});

206-212: Include basePath and apiConfigured for API storage

Align with getStorageConfig return shape.

-			expect(storage).toEqual({
-				type: 'api',
-				apiEndpoint: 'https://api.example.com',
-				apiAccessToken: 'token123'
-			});
+			expect(storage).toEqual({
+				type: 'api',
+				basePath: testProjectRoot,
+				apiEndpoint: 'https://api.example.com',
+				apiAccessToken: 'token123',
+				apiConfigured: true
+			});
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3b30b3 and 1eb4180.

📒 Files selected for processing (3)
  • packages/tm-core/src/config/config-manager.spec.ts (4 hunks)
  • packages/tm-core/src/config/config-manager.ts (2 hunks)
  • tests/unit/config-manager.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
tests/{unit,integration,e2e,fixtures}/**/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Test files must be organized as follows: unit tests in tests/unit/, integration tests in tests/integration/, end-to-end tests in tests/e2e/, and test fixtures in tests/fixtures/.

Files:

  • tests/unit/config-manager.test.js
tests/unit/*.js

📄 CodeRabbit inference engine (.cursor/rules/architecture.mdc)

Each module should have a corresponding unit test file in tests/unit/ that reflects the module structure (one test file per module).

Files:

  • tests/unit/config-manager.test.js
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/git_workflow.mdc)

**/*.{test,spec}.{js,ts,jsx,tsx}: Create a test file and ensure all tests pass when all subtasks are complete; commit tests if added or modified
When all subtasks are complete, run final testing using the appropriate test runner (e.g., npm test, jest, or manual testing)

Files:

  • tests/unit/config-manager.test.js
  • packages/tm-core/src/config/config-manager.spec.ts
**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.test.js: Never use asynchronous operations in tests. Make all mocks return synchronous values when possible.
Always mock tests properly based on the way the tested functions are defined and used.
Follow the test file organization: mocks must be set up before importing modules under test, and spies on mocked modules should be set up after imports.
Use fixtures from tests/fixtures/ for consistent sample data across tests.
Always declare mocks before importing the modules being tested in Jest test files.
Use jest.spyOn() after imports to create spies on mock functions and reference these spies in test assertions.
When testing functions with callbacks, get the callback from your mock's call arguments, execute it directly with test inputs, and verify the results.
For ES modules, use jest.mock() before static imports and jest.unstable_mockModule() before dynamic imports to mock dependencies.
Reset mock functions (mockFn.mockReset()) before dynamic imports if they might have been called previously.
When verifying console assertions, assert against the actual arguments passed (single formatted string), not multiple arguments.
Use mock-fs to mock file system operations in tests, and restore the file system after each test.
Mock API calls (e.g., Anthropic/Claude) by mocking the entire module and providing predictable responses.
Set mock environment variables in test setup and restore them after each test.
Maintain test fixtures separate from test logic.
Follow the mock-first-then-import pattern for all Jest mocks.
Do not define mock variables before jest.mock() calls (they won't be accessible due to hoisting).
Use test-specific file paths (e.g., 'test-tasks.json') for all file operations in tests.
Mock readJSON and writeJSON to avoid real file system interactions in tests.
Verify file operations use the correct paths in expect statements.
Use different file paths for each test to avoid test interdependence.
Verify modifications on the in-memory task objects passed to w...

Files:

  • tests/unit/config-manager.test.js
tests/unit/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/unit/**/*.test.js: Unit tests must be located in tests/unit/, test individual functions and utilities in isolation, mock all external dependencies, and keep tests small, focused, and fast.
Do not include actual command execution in unit tests.

Files:

  • tests/unit/config-manager.test.js
tests/{unit,integration,e2e}/**/*.test.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

tests/{unit,integration,e2e}/**/*.test.js: When testing CLI commands built with Commander.js, test the command action handlers directly rather than trying to mock the entire Commander.js chain.
When mocking the Commander.js chain, mock ALL chainable methods (option, argument, action, on, etc.) and return this (or the mock object) from all chainable method mocks.
Explicitly handle all options, including defaults and shorthand flags (e.g., -p for --prompt), and include null/undefined checks in test implementations for parameters that might be optional.
Do not try to use the real action implementation without proper mocking, and do not mock Commander partially—either mock it completely or test the action directly.
Mock the action handlers for CLI commands and verify they're called with correct arguments.
Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Mock console output and verify correct formatting in UI function tests. Use flexible assertions like toContain() or toMatch() for formatted output.
Mock chalk functions to return the input text to make testing easier while still verifying correct function calls.

Files:

  • tests/unit/config-manager.test.js
**/*.js

📄 CodeRabbit inference engine (.cursor/rules/tests.mdc)

**/*.js: Declare and initialize global variables at the top of modules to avoid hoisting issues.
Use proper function declarations to avoid hoisting issues and initialize variables before they are referenced.
Do not reference variables before their declaration in module scope.
Use dynamic imports (import()) to avoid initialization order issues in modules.

Files:

  • tests/unit/config-manager.test.js
**/*.{test,spec}.*

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Test files should follow naming conventions: .test., .spec., or _test. depending on the language

Files:

  • tests/unit/config-manager.test.js
  • packages/tm-core/src/config/config-manager.spec.ts
tests/{unit,integration,e2e}/**

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Organize test directories by test type (unit, integration, e2e) and mirror source structure where possible

Files:

  • tests/unit/config-manager.test.js
**/?(*.)+(spec|test).ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

In JavaScript/TypeScript projects using Jest, test files should match *.test.ts and *.spec.ts patterns

Files:

  • packages/tm-core/src/config/config-manager.spec.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/task-manager/**/*.js : Do not call AI-specific getters (like `getMainModelId`, `getMainMaxTokens`) from core logic functions in `scripts/modules/task-manager/*`; instead, pass the `role` to the unified AI service.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Applies to scripts/modules/task-manager/*.js : Do not fetch AI-specific parameters (model ID, max tokens, temp) using `config-manager.js` getters for the AI call. Pass the `role` instead.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: Applies to .taskmaster/config.json : All other Taskmaster settings (model choice, max tokens, temperature, log level, custom endpoints) are managed in .taskmaster/config.json via the task-master models command or models MCP tool.
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
📚 Learning: 2025-07-18T17:06:57.833Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-07-18T17:06:57.833Z
Learning: Applies to scripts/modules/task-manager/*.js : Do not fetch AI-specific parameters (model ID, max tokens, temp) using `config-manager.js` getters for the AI call. Pass the `role` instead.

Applied to files:

  • packages/tm-core/src/config/config-manager.ts
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Be careful with how you mock or stub functions that depend on module state; use factory functions in mocks to ensure proper initialization order.

Applied to files:

  • packages/tm-core/src/config/config-manager.spec.ts
🧬 Code graph analysis (2)
packages/tm-core/src/config/config-manager.ts (1)
scripts/modules/config-manager.js (1)
  • DEFAULTS (26-66)
packages/tm-core/src/config/config-manager.spec.ts (2)
packages/tm-core/src/interfaces/configuration.interface.ts (1)
  • DEFAULT_CONFIG_VALUES (400-440)
packages/tm-core/src/config/index.ts (1)
  • DEFAULT_CONFIG_VALUES (43-43)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
🔇 Additional comments (5)
packages/tm-core/src/config/config-manager.ts (2)

13-13: Importing centralized defaults — good

Using DEFAULTS eliminates string duplication across packages.


171-173: getModelConfig now derives from DEFAULTS — good

Prevents drift and matches the new defaults policy.

packages/tm-core/src/config/config-manager.spec.ts (3)

8-8: Using DEFAULT_CONFIG_VALUES in tests — good

Keeps expectations aligned with centralized defaults.


73-75: State manager API aligned (getCurrentTag/setCurrentTag) — good

Matches production naming.


231-233: Default models expectation uses DEFAULT_CONFIG_VALUES — good

Avoids hard-coded strings in tests.

Comment on lines 121 to 137
provider: 'anthropic',
modelId: 'claude-3-7-sonnet-20250219',
modelId: 'claude-sonnet-4-20250514',
maxTokens: 64000,
temperature: 0.2
},
research: {
provider: 'perplexity',
modelId: 'sonar-pro',
modelId: 'sonar',
maxTokens: 8700,
temperature: 0.1
},
fallback: {
provider: 'anthropic',
modelId: 'claude-3-5-sonnet',
maxTokens: 8192,
modelId: 'claude-3-7-sonnet-20250219',
maxTokens: 120000,
temperature: 0.2
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick

Defaults updated — avoid drift by sourcing from a single constant

Hardcoding main/research/fallback defaults in tests will drift. Prefer importing a shared DEFAULTS (export it from the script module) or assert properties rather than deep-equality of the whole object.

🤖 Prompt for AI Agents
In tests/unit/config-manager.test.js around lines 121 to 137, the test hardcodes
the main/research/fallback default configs which will drift from the source;
update the test to either import the shared DEFAULTS constant from the module
under test (export DEFAULTS from the config module) and use that in the
assertion, or change the assertions to check only the required properties (e.g.,
provider, modelId, maxTokens, temperature) for each section instead of
deep-equality against a hardcoded object so the test remains stable and aligned
with the implementation.

@Crunchyman-ralph Crunchyman-ralph merged commit a621ff0 into next Sep 19, 2025
8 checks passed
@Crunchyman-ralph Crunchyman-ralph deleted the ralph/feat/improve.defaults branch September 19, 2025 23:07
github-actions bot added a commit that referenced this pull request Sep 19, 2025
  This PR was automatically generated to update documentation based on recent changes.

  Original commit: feat: update tm models defaults (#1225)\n\n\n

  Co-authored-by: Claude <claude-assistant@anthropic.com>
@github-actions github-actions bot mentioned this pull request Sep 22, 2025
sfc-gh-dflippo pushed a commit to sfc-gh-dflippo/task-master-ai that referenced this pull request Dec 4, 2025
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.

1 participant