Skip to content

fix: suppress config warnings during Sentry init and API mode detection#1482

Merged
Crunchyman-ralph merged 3 commits intonextfrom
ralph/fix/suppress-sentry-config-warnings
Dec 3, 2025
Merged

fix: suppress config warnings during Sentry init and API mode detection#1482
Crunchyman-ralph merged 3 commits intonextfrom
ralph/fix/suppress-sentry-config-warnings

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Dec 3, 2025

Config file warnings were being emitted during CLI startup when:

  • Sentry initialization checks telemetry preferences
  • Checking if user is connected to Hamster (API mode)
  • Running commands on remote projects without local config

This fix adds a global suppression mechanism and uses it in:

  • sentry.js: Suppress during telemetry preference check
  • dev.js: Suppress if user has valid auth session (API mode)
  • commands.js: Suppress during Hamster connection detection
  • config-manager.js: Add setSuppressConfigWarnings export
  • path-utils.js: Honor global suppression flag

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

  • Bug Fixes
    • Reduced noisy configuration warnings during startup, telemetry checks, command loading, and API-storage detection for clearer console output.
    • When a valid session is present, config warnings are suppressed during initialization and specific checks; suppression is temporary and normal warning behavior is restored afterward.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

⚠️ No Changeset found

Latest commit: 83fea2d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

Walkthrough

Adds a global config-warning suppression API, threads a storageType option through config loading, suppresses warnings during API/telemetry checks, and performs a startup AuthManager.hasValidSession() check that enables suppression when a valid session exists.

Changes

Cohort / File(s) Summary
Config suppression core
scripts/modules/config-manager.js
Adds setSuppressConfigWarnings(suppress) and isConfigWarningSuppressed() exports; introduces providersWithoutApiKeys; changes _loadAndValidateConfig() and getConfig() to accept an options object (including storageType); gates "no config" warnings by suppression flag and storageType.
Path discovery adjustments
src/utils/path-utils.js
Reads isConfigWarningSuppressed() and storageType to skip/gate "No configuration file found" warnings; moves per-run dedupe/initialization behind suppression guard to avoid logging when suppressed.
Startup auth check
scripts/dev.js
Imports AuthManager from @tm/core; invokes AuthManager.hasValidSession() at startup and calls setSuppressConfigWarnings(true) when session is valid; auth check runs before dynamic import of commands.
Temporary suppression usages
scripts/modules/commands.js, src/telemetry/sentry.js
Wraps API-storage detection and telemetry opt-in checks with setSuppressConfigWarnings(true) / setSuppressConfigWarnings(false) (using finally blocks) and calls getConfig(..., { storageType: 'api' }) for API-specific detection.
Dev/test mocks updated
tests/unit/.../*.test.js
Adds mocks for setSuppressConfigWarnings() and isConfigWarningSuppressed() across affected unit tests to reflect the extended config-manager API.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to propagation of options.storageType through getConfig()_loadAndValidateConfig()findConfigPath.
  • Verify suppression flag is always reset on error/early-return paths (notably in commands.js, sentry.js, and startup flows).
  • Confirm per-run warning dedupe in path-utils.js still prevents duplicate warnings when suppression toggles during a run.

Possibly related PRs

Suggested reviewers

  • eyaltoledano
  • maxtuzz

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 title accurately describes the main change: introducing a global suppression mechanism for config warnings during Sentry initialization and API mode detection, which is the core objective of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ralph/fix/suppress-sentry-config-warnings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e05180b and 83fea2d.

📒 Files selected for processing (4)
  • tests/unit/ai-providers/claude-code-structured-output.test.js (1 hunks)
  • tests/unit/ai-providers/gemini-cli-structured-output.test.js (1 hunks)
  • tests/unit/ai-providers/zai-provider.test.js (1 hunks)
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
tests/unit/ai-providers/*.test.js

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

Create unit tests in tests/unit/ai-providers/<provider-name>.test.js that mock the provider's AI SDK module and test each exported function for correct client instantiation, parameter passing, result handling, and error handling

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
**/*.js

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

**/*.js: Always use isSilentMode() function to check current silent mode status instead of directly accessing the global silentMode variable or global.silentMode
Use try/finally block pattern when wrapping core function calls with enableSilentMode/disableSilentMode to ensure silent mode is always restored, even if errors occur
For functions that need to handle both a passed silentMode parameter and check global state, check both the function parameter and global state: const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())
Functions should accept their dependencies as parameters rather than using globals to promote testability and explicit dependency injection
Define callbacks as separate functions for easier testing rather than inline functions

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
tests/unit/**/*.js

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

Unit tests should be located in tests/unit/ and reflect the module structure with one test file per module

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
**/*.test.{js,ts}

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

**/*.test.{js,ts}: Follow the mock-first-then-import pattern for Jest mocking; use jest.spyOn() for spy functions; clear mocks between tests; verify mocks with the pattern described in tests.mdc
Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
**/*.{js,jsx}

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

JavaScript test files using Jest must follow the same testing patterns as TypeScript files, include proper mocking of external dependencies, and achieve the same coverage thresholds

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
**/*.test.js

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

**/*.test.js: Never use asynchronous operations in tests. Always mock tests properly based on the way the tested functions are defined and used.
Follow Jest test file structure: 1) Imports, 2) Mock setup before importing modules under test, 3) Import modules after mocks, 4) Set up spies on mocked modules, 5) Describe suite with descriptive name, 6) Setup/teardown hooks, 7) Grouped tests for related functionality, 8) Individual test cases with clear descriptions using Arrange-Act-Assert pattern.
When testing CLI commands built with Commander.js: test command action handlers directly rather than mocking the entire Commander chain; create simplified test-specific implementations of command handlers; explicitly handle all options including defaults and shorthand flags; include null/undefined checks for optional parameters; use fixtures for consistent sample data.
Use jest.mock() before any imports. Jest hoists mock calls to the top of the file. Always declare mocks before importing modules being tested. Use factory pattern for complex mocks that need access to other variables.
When testing ES modules with dynamic imports, use jest.unstable_mockModule() before await import(). Include __esModule: true in mock factories. Reset mock functions before dynamic import. Mock named and default exports as needed.
Mock file system operations using mock-fs library. Mock API calls by providing jest.fn() implementations that return expected structures. Mock environment variables in test setup.
When testing functions with callbacks: get the callback from mock's call arguments using mock.calls[index][argIndex]; execute it directly with test inputs; verify results match expectations.
For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock readJSON and writeJSON to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed t...

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
tests/unit/**/*.test.js

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

Locate unit tests in tests/unit/ directory. Test individual functions and utilities in isolation, mock all external dependencies, keep tests small and focused.

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
**/*.{js,ts}

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

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
🧠 Learnings (29)
📓 Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 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.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Do not import or instantiate real AI service clients. Create fully mocked versions that return predictable responses. Mock the entire module with controlled behavior.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to tests/unit/ai-providers/*.test.js : Create unit tests in `tests/unit/ai-providers/<provider-name>.test.js` that mock the provider's AI SDK module and test each exported function for correct client instantiation, parameter passing, result handling, and error handling

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : When testing CLI commands built with Commander.js: test command action handlers directly rather than mocking the entire Commander chain; create simplified test-specific implementations of command handlers; explicitly handle all options including defaults and shorthand flags; include null/undefined checks for optional parameters; use fixtures for consistent sample data.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T22:09:45.455Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Applies to packages/tm-core/**/*.{spec,test}.ts : In unit tests for tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T22:09:45.455Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Applies to apps/cli/**/*.{spec,test}.ts : In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Set mock environment variables for API keys in test setup (e.g., ANTHROPIC_API_KEY, PERPLEXITY_API_KEY) rather than relying on real environment variables.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T22:09:45.455Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : When testing UI functions: mock console output and verify correct formatting; test conditional output logic; use `toContain()` or `toMatch()` rather than exact `toBe()` for strings with emojis or formatting; create separate tests for different behavior modes; test structure of formatted output rather than exact string matching.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : For modules with initialization-dependent functions in tests: create test-specific implementations that initialize all variables correctly; use factory functions in mocks to ensure proper initialization order; be careful with how you mock functions that depend on module state.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Ensure AI calls correctly handle and propagate `telemetryData` as described in `telemetry.mdc`

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : When testing ES modules with dynamic imports, use `jest.unstable_mockModule()` before `await import()`. Include `__esModule: true` in mock factories. Reset mock functions before dynamic import. Mock named and default exports as needed.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Use `jest.mock()` before any imports. Jest hoists mock calls to the top of the file. Always declare mocks before importing modules being tested. Use factory pattern for complex mocks that need access to other variables.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T18:03:13.456Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.456Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to **/*.test.{js,ts} : Follow the mock-first-then-import pattern for Jest mocking; use jest.spyOn() for spy functions; clear mocks between tests; verify mocks with the pattern described in `tests.mdc`

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Each module should have well-defined exports that can be mocked in tests

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Mock file system operations using `mock-fs` library. Mock API calls by providing jest.fn() implementations that return expected structures. Mock environment variables in test setup.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Use `jest.spyOn()` after imports to create spies on mock functions. Reference these spies in test assertions to verify mock behavior.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Clear mocks between tests using `jest.clearAllMocks()` in `beforeEach`. Reset specific mock functions with `mockFn.mockReset()`. Prevent state leakage between tests.

Applied to files:

  • tests/unit/ai-providers/gemini-cli-structured-output.test.js
  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/config-manager.js : In `scripts/modules/config-manager.js`, update `MODEL_MAP` to include the new provider, ensure `VALID_PROVIDERS` includes the provider, update API key handling in `keyMap` and the `switch` statement in `getMcpApiKeyStatus` and `isApiKeySet`

Applied to files:

  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call

Applied to files:

  • tests/unit/ai-providers/zai-provider.test.js
📚 Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Do not wrap unified AI service calls (generateTextService, generateObjectService) in silent mode; their logging is handled internally

Applied to files:

  • tests/unit/ai-providers/zai-provider.test.js
  • tests/unit/ai-providers/claude-code-structured-output.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock `readJSON` and `writeJSON` to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed to `writeJSON`.

Applied to files:

  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to **/*.test.{js,ts} : Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Applied to files:

  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Create simplified test functions instead of complex setups: create simplified versions of complex functions focusing on core logic; remove file system operations, API calls, and external dependencies; pass all dependencies as parameters.

Applied to files:

  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:03:46.713Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.713Z
Learning: Applies to **/*.test.js : Make async operations synchronous in tests. Mock async functions to return synchronous values when possible. Don't use real async/await or Promise resolution that might fail unpredictably.

Applied to files:

  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking

Applied to files:

  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
📚 Learning: 2025-11-24T22:09:45.455Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.455Z
Learning: Skip tests for simple getters/setters, trivial pass-through functions, pure configuration objects, and code that just delegates to another tested function

Applied to files:

  • tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js
⏰ 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: Typecheck
🔇 Additional comments (4)
tests/unit/ai-providers/zai-provider.test.js (1)

18-23: LGTM! Test mocks properly updated for new config-manager API.

The mock additions for setSuppressConfigWarnings and isConfigWarningSuppressed correctly support the new global suppression mechanism introduced in this PR. Default behavior (suppression disabled) is appropriate for tests.

tests/unit/ai-providers/gemini-cli-structured-output.test.js (1)

39-44: LGTM! Consistent mock updates across provider tests.

The config-manager mock correctly includes the new suppression functions, maintaining consistency with other test files in this PR.

tests/unit/ai-providers/claude-code-structured-output.test.js (1)

60-69: LGTM! Test infrastructure properly updated.

The config-manager mock additions are consistent with the broader PR changes and correctly mock the new warning suppression API.

tests/unit/scripts/modules/task-manager/analyze-task-complexity.test.js (1)

192-195: LGTM! Mock extensions properly integrated.

The new suppression functions are correctly added to the extensive config-manager mock, maintaining consistency with other test files in this PR.


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

   Config file warnings were being emitted during CLI startup when:
   - Sentry initialization checks telemetry preferences
   - Checking if user is connected to Hamster (API mode)
   - Running commands on remote projects without local config

   This fix adds a global suppression mechanism and uses it in:
   - sentry.js: Suppress during telemetry preference check
   - dev.js: Suppress if user has valid auth session (API mode)
   - commands.js: Suppress during Hamster connection detection
   - config-manager.js: Add setSuppressConfigWarnings export
   - path-utils.js: Honor global suppression flag
@Crunchyman-ralph Crunchyman-ralph force-pushed the ralph/fix/suppress-sentry-config-warnings branch from fa27f1a to 0b7f24b Compare December 3, 2025 20:39
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: 0

🧹 Nitpick comments (3)
src/telemetry/sentry.js (1)

7-10: Prefer a try/finally around config-warning suppression

Logic is correct, but manually calling setSuppressConfigWarnings(false) in both the normal path and catch is a bit brittle. A try/finally around the telemetry check would ensure the flag is always reset even if more code is added later:

-try {
-	setSuppressConfigWarnings(true);
-	const telemetryEnabled = getAnonymousTelemetryEnabled(options.projectRoot);
-	setSuppressConfigWarnings(false);
-
-	if (!telemetryEnabled) {
-		// ...
-		return;
-	}
-} catch (error) {
-	setSuppressConfigWarnings(false);
-}
+setSuppressConfigWarnings(true);
+try {
+	const telemetryEnabled = getAnonymousTelemetryEnabled(options.projectRoot);
+
+	if (!telemetryEnabled) {
+		// ...
+		return;
+	}
+} catch (error) {
+	// Default to telemetry enabled on error
+} finally {
+	setSuppressConfigWarnings(false);
+}

Also applies to: 46-63

scripts/dev.js (1)

12-13: Consider using setSuppressConfigWarnings helper instead of touching global

The API-mode detection behavior looks correct, but this block reaches into global._tmSuppressConfigWarnings directly even though scripts/modules/config-manager.js already exposes setSuppressConfigWarnings(). To avoid duplicating the flag name and keep behavior centralized, consider:

-import { AuthManager, findProjectRoot } from '@tm/core';
+import { AuthManager, findProjectRoot } from '@tm/core';
+import { setSuppressConfigWarnings } from './modules/config-manager.js';
@@
-try {
-	const authManager = AuthManager.getInstance();
-	const hasValidSession = await authManager.hasValidSession();
-	if (hasValidSession) {
-		global._tmSuppressConfigWarnings = true;
-	}
-} catch {
+try {
+	const authManager = AuthManager.getInstance();
+	const hasValidSession = await authManager.hasValidSession();
+	if (hasValidSession) {
+		setSuppressConfigWarnings(true);
+	}
+} catch {
 	// Auth check failed, continue without suppressing
}

Also applies to: 39-49

scripts/modules/commands.js (1)

69-77: Tighten suppression pattern in isConnectedToHamster

The API-mode fallback check is functionally correct and safely resets suppression via finally, but setSuppressConfigWarnings(false) is invoked redundantly (in the try body, catch, and finally).

You can simplify to a single, clear try/finally while preserving behavior:

-		// Fallback: Check if storage type is 'api' (user selected Hamster during init)
-		// Suppress warnings during this check since we're detecting API mode
-		try {
-			setSuppressConfigWarnings(true);
-			const config = getConfig(null, false, { storageType: 'api' });
-			setSuppressConfigWarnings(false);
-			if (config?.storage?.type === 'api') {
-				return true;
-			}
-		} catch {
-			setSuppressConfigWarnings(false);
-			// Config check failed, continue
-		} finally {
-			setSuppressConfigWarnings(false);
-		}
+		// Fallback: Check if storage type is 'api' (user selected Hamster during init)
+		// Suppress warnings during this check since we're detecting API mode
+		setSuppressConfigWarnings(true);
+		try {
+			const config = getConfig(null, false, { storageType: 'api' });
+			if (config?.storage?.type === 'api') {
+				return true;
+			}
+		} catch {
+			// Config check failed, continue
+		} finally {
+			setSuppressConfigWarnings(false);
+		}

Also applies to: 154-184

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8674007 and fa27f1a.

📒 Files selected for processing (5)
  • scripts/dev.js (2 hunks)
  • scripts/modules/commands.js (2 hunks)
  • scripts/modules/config-manager.js (5 hunks)
  • src/telemetry/sentry.js (3 hunks)
  • src/utils/path-utils.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
scripts/modules/commands.js

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

commands.js should parse command-line arguments and options, invoke appropriate core logic functions from scripts/modules/, handle user input/output for CLI, and implement CLI-specific validation

scripts/modules/commands.js: Follow the basic command template structure when implementing CLI commands: use .command(), .description(), .option(), and .action() in Commander.js with concise action handlers that extract functionality to core modules
Keep command action handlers concise and focused; extract core functionality to appropriate modules like task-manager.js or init.js rather than implementing business logic in handlers
Use kebab-case for command names (e.g., 'analyze-complexity', 'remove-task') and action-oriented descriptions
Use kebab-case for long-form option names (e.g., --output-format) with single-letter shortcuts when appropriate (e.g., -f, --file), and access them in code as camelCase properties (e.g., options.numTasks)
Use positive flags with --skip- prefix for disabling behavior instead of --no- prefix negated flags; use clear variable naming like const generateFiles = !options.skipGenerate to avoid double negatives
Include confirmation prompts by default for destructive operations (delete/remove commands) with a --yes or -y flag to skip confirmation; display what will be deleted in the confirmation message
For file path handling in destructive operations: use path.join() to construct paths, follow naming conventions (e.g., task_001.txt), check file existence before deletion, and handle errors gracefully without string concatenation
Clean up references to deleted items in other parts of the data after destructive operations, handling both direct and indirect references with explanatory console logging
Regenerate task files after destructive operations by explicitly passing all required parameters to generation functions; provide a --skip-generate option if needed
Suggest non-destructive alternatives (like status changes instead of deletion)...

Files:

  • scripts/modules/commands.js
**/*.js

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

**/*.js: Always use isSilentMode() function to check current silent mode status instead of directly accessing the global silentMode variable or global.silentMode
Use try/finally block pattern when wrapping core function calls with enableSilentMode/disableSilentMode to ensure silent mode is always restored, even if errors occur
For functions that need to handle both a passed silentMode parameter and check global state, check both the function parameter and global state: const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())
Functions should accept their dependencies as parameters rather than using globals to promote testability and explicit dependency injection
Define callbacks as separate functions for easier testing rather than inline functions

Files:

  • scripts/modules/commands.js
  • src/telemetry/sentry.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
  • src/utils/path-utils.js
scripts/**/*.js

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

scripts/**/*.js: Use the ContextGatherer class from scripts/modules/utils/contextGatherer.js to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using gpt-tokens library
Initialize ContextGatherer with project root and tasks path, then call gather() method with tasks array, files array, customContext, includeProjectTree, format ('research', 'chat', or 'system-prompt'), and includeTokenCounts options
Use the FuzzyTaskSearch class from scripts/modules/utils/fuzzyTaskSearch.js for intelligent task discovery with semantic matching, purpose categorization, and relevance scoring using Fuse.js
Implement a three-step initialization pattern for context-aware commands: (1) validate and parse parameters, (2) initialize context gatherer and find project root, (3) auto-discover relevant tasks using fuzzy search if task IDs not specified
Display token breakdown using boxen library with sections for tasks, files, and prompts, showing formatted token counts and file sizes in a clean bordered box with title
Process AI result responses using cli-highlight library to apply syntax highlighting to code blocks with language detection in the format language\ncode
Set reasonable file size limits (50KB default) and project tree depth limits (3-5 levels) when gathering context to maintain performance
Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Files:

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

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

Restart the MCP server if core logic in scripts/modules or MCP tool definitions change

Files:

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

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

When implementing MCP support for a command, ensure the core logic function can suppress console output via an outputFormat parameter or other mechanism

scripts/modules/*.js: Use consistent file naming conventions: task_${id.toString().padStart(3, '0')}.txt for task files; use path.join() for composing paths; use appropriate extensions (.txt for tasks, .json for data)
Export all core functions, helper functions, and utility methods needed by dependent code from their respective modules; explicitly verify module export blocks at the bottom of files
Use structured error objects with code and message properties; include clear error messages; handle both function-specific and file system errors; log errors at appropriate severity levels
Use isSilentMode() function to check global silent mode status; wrap core function calls within direct functions using enableSilentMode() and disableSilentMode() in try/finally blocks if the core function produces console output not reliably controlled by outputFormat parameter
Ensure AI calls correctly handle and propagate telemetryData as described in telemetry.mdc
Import context gathering utilities (ContextGatherer, FuzzyTaskSearch) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display
Prefer generateTextService for calls sending large context (like stringified JSON) where incremental display is not needed; import necessary service functions from ai-services-unified.js and prepare parameters (role, session, systemPrompt, prompt)
Create a clear unidirectional flow of dependencies between modules; separate business logic from UI rendering to avoid circular dependencies
Design functions to accept dependencies as parameters; avoid hard-coded dependencies that are difficult to mock
Keep pure logic separate from I/O operations or UI rendering to allow testing logic without mocking complex dependencies
Design core logic to work wi...

Files:

  • scripts/modules/commands.js
  • scripts/modules/config-manager.js
**/*.{js,jsx}

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

JavaScript test files using Jest must follow the same testing patterns as TypeScript files, include proper mocking of external dependencies, and achieve the same coverage thresholds

Files:

  • scripts/modules/commands.js
  • src/telemetry/sentry.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
  • src/utils/path-utils.js
**/*.{js,ts}

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

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • scripts/modules/commands.js
  • src/telemetry/sentry.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
  • src/utils/path-utils.js
scripts/modules/**/*.{js,ts}

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

scripts/modules/**/*.{js,ts}: Implement silent migration for tasks.json files that transforms old format to tagged format, marking global flag and performing complete migration
Implement tag resolution functions (getTasksForTag, setTasksForTag, getCurrentTag) that provide backward compatibility with legacy format and default to master tag
Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking
When a logger object is passed as a parameter to core functions, ensure the receiving function can call methods like .info, .warn, .error on that object

Files:

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

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

scripts/modules/config-manager.js: In scripts/modules/config-manager.js, update MODEL_MAP to include the new provider, ensure VALID_PROVIDERS includes the provider, update API key handling in keyMap and the switch statement in getMcpApiKeyStatus and isApiKeySet
For providers not requiring an API key (like Ollama), add a specific check at the beginning of isApiKeySet and getMcpApiKeyStatus to return true immediately for that provider

config-manager.js should load and validate .taskmasterconfig, provide getter functions (getMainProvider, getLogLevel, getDefaultSubtasks, etc.) for accessing settings, manage global.defaultTag and tags section for tag system settings, and NOT directly store or handle API keys

Files:

  • scripts/modules/config-manager.js
**/{utils,utilities,helpers}/**/*.{js,ts}

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

**/{utils,utilities,helpers}/**/*.{js,ts}: Document all parameters and return values in JSDoc format, include descriptions for complex logic, and add examples for non-obvious usage
Support multiple log levels (debug, info, warn, error) with appropriate icons for different log levels and respect the configured log level

Files:

  • src/utils/path-utils.js
**/{utils,utilities}/*.{js,ts}

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

Implement the silent mode control functions (enableSilentMode, disableSilentMode, isSilentMode) in utility modules and always use isSilentMode() to check current state

Files:

  • src/utils/path-utils.js
**/{utils,utilities}/**/*.{js,ts}

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

**/{utils,utilities}/**/*.{js,ts}: Use try/catch blocks for all file operations and return null or a default value on failure rather than allowing exceptions to propagate unhandled
Log detailed error information using the log utility in catch blocks for file operations
Create utilities for consistent task ID handling that support different ID formats (numeric, string, dot notation)
Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results
Implement cycle detection using graph traversal by tracking visited nodes and recursion stack, returning specific information about cycles
Detect circular dependencies using DFS and validate task references before operations
Export all utility functions explicitly in logical groups and include configuration constants from utility modules
Do not use default exports in utility modules - use named exports only
Group related exports together in utility modules and avoid creating circular dependencies
Make the log function respect silent mode by skipping logging when silent mode is enabled

Files:

  • src/utils/path-utils.js
🧠 Learnings (47)
📓 Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 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.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/config-manager.js : In `scripts/modules/config-manager.js`, update `MODEL_MAP` to include the new provider, ensure `VALID_PROVIDERS` includes the provider, update API key handling in `keyMap` and the `switch` statement in `getMcpApiKeyStatus` and `isApiKeySet`

Applied to files:

  • scripts/modules/commands.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Use `isSilentMode()` function to check global silent mode status; wrap core function calls within direct functions using `enableSilentMode()` and `disableSilentMode()` in try/finally blocks if the core function produces console output not reliably controlled by outputFormat parameter

Applied to files:

  • scripts/modules/commands.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Do not access the global silentMode variable directly - use the exported silent mode control functions instead

Applied to files:

  • scripts/modules/commands.js
  • src/telemetry/sentry.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/config-manager.js : config-manager.js should load and validate .taskmasterconfig, provide getter functions (getMainProvider, getLogLevel, getDefaultSubtasks, etc.) for accessing settings, manage global.defaultTag and tags section for tag system settings, and NOT directly store or handle API keys

Applied to files:

  • scripts/modules/commands.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Track and report changes made during dependency cleanup

Applied to files:

  • scripts/modules/commands.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js, scripts/modules/ai-services-unified.js : Do not import or call anything from deprecated AI service files (`ai-services.js`, `ai-client-factory.js`, `ai-client-utils.js`)

Applied to files:

  • scripts/modules/commands.js
  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/*.{js,ts} : Implement the silent mode control functions (enableSilentMode, disableSilentMode, isSilentMode) in utility modules and always use isSilentMode() to check current state

Applied to files:

  • scripts/modules/commands.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Implement silent mode by importing and using enableSilentMode() and disableSilentMode() from utils.js in a try/finally block when wrapping core function calls that might produce console output not controlled by outputFormat or mcpLog parameters

Applied to files:

  • scripts/modules/commands.js
📚 Learning: 2025-11-26T20:50:40.810Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/cli/src/ui/components/brand-banner.component.ts:42-44
Timestamp: 2025-11-26T20:50:40.810Z
Learning: In apps/cli/**/*.{ts,tsx}: Do not import or use isSilentMode() from the legacy scripts/modules/utils.js. isSilentMode is legacy code that will be removed during migration. The apps/cli package should use environment variables like TM_HIDE_BANNER for controlling output instead of legacy silent mode patterns.

Applied to files:

  • scripts/modules/commands.js
  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function along with setupCLI, runCLI, checkForUpdate, compareVersions, and displayUpgradeNotification functions

Applied to files:

  • scripts/modules/commands.js
  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • scripts/modules/commands.js
  • src/telemetry/sentry.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/commands/**/*.{js,ts} : Handle potential ConfigurationError if the .taskmasterconfig file is missing or invalid when accessed via getConfig

Applied to files:

  • scripts/modules/commands.js
  • scripts/modules/config-manager.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Ensure AI calls correctly handle and propagate `telemetryData` as described in `telemetry.mdc`

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:00:32.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.617Z
Learning: Refer to telemetry.mdc for guidelines on integrating AI usage telemetry across Task Master

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Organize imports by module/functionality, import only what's needed (not entire modules), and avoid creating circular dependencies

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Group imports by module/functionality, import only what's needed (not entire modules), and do not create circular dependencies.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Import context gathering utilities (`ContextGatherer`, `FuzzyTaskSearch`) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,ts} : 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

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/core/task-master-core.js : Update `task-master-core.js` by importing and re-exporting direct functions and adding them to the directFunctions map

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-09-26T19:03:33.225Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: package.json:130-132
Timestamp: 2025-09-26T19:03:33.225Z
Learning: In the eyaltoledano/claude-task-master repository, packages are bundled using tsdown during the build process, which means dependencies imported by the source code (including tm internal packages like tm/ai-sdk-provider-grok-cli) are included in the final bundle and don't need to be available as separate runtime dependencies, so they should remain as devDependencies rather than being moved to dependencies.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-21T11:09:42.143Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1431
File: apps/cli/tests/helpers/test-utils.ts:1-19
Timestamp: 2025-11-21T11:09:42.143Z
Learning: In the eyaltoledano/claude-task-master project, Vitest test environment provides __dirname as a global even when using ES modules, so test files can safely use __dirname without needing to convert to fileURLToPath(import.meta.url) patterns.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/tools/**/*.{js,ts} : Use the withNormalizedProjectRoot Higher-Order Function to wrap tool execute methods, ensuring normalized project root is injected into args

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the initialize_project tool for setting up new projects in integrated environments without requiring a project root

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Pass context object `{ projectRoot, tag }` to all core functions that read or write tasks

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/**/*.{js,ts} : Use normalizeProjectRoot(rawPath, log) to take a raw project root path (potentially URI encoded, with file:// prefix) and return a normalized, absolute path

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/*/[!.]* : Find and validate project root in commands with error handling before processing tasks

Applied to files:

  • scripts/dev.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-26T21:57:48.927Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/mcp/src/tools/tasks/set-task-status.tool.ts:23-25
Timestamp: 2025-11-26T21:57:48.927Z
Learning: Applies to apps/mcp/src/tools/**/*.ts : In the new apps/mcp MCP tool architecture, projectRoot is a required parameter in Zod schemas (not optional like in the legacy mcp-server structure)

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions must use findTasksJsonPath from ../utils/path-utils.js to resolve the tasks file path using args.projectRoot

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Core task functions must accept a context parameter with `{ projectRoot, tag }` properties

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/commands.js : commands.js should parse command-line arguments and options, invoke appropriate core logic functions from scripts/modules/, handle user input/output for CLI, and implement CLI-specific validation

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : API keys must be configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP); ensure they are correctly resolved via `session.env` in MCP contexts

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys with helpful hints for fallbacks

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Integrate version checking in the runCLI function by starting the update check in the background, parsing commands, and displaying update notifications after command execution

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:05:02.114Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/.windsurfrules:0-0
Timestamp: 2025-11-24T18:05:02.114Z
Learning: Use the global CLI command `task-master` instead of `node scripts/dev.js` for all task management operations

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function and keep the CLI setup code clean and maintainable.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys for features that depend on them.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement silent migration for tasks.json files that transforms old format to tagged format, marking global flag and performing complete migration

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Use positive flags with --skip- prefix for disabling behavior instead of --no- prefix negated flags; use clear variable naming like `const generateFiles = !options.skipGenerate` to avoid double negatives

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Export all utility functions explicitly in logical groups and include configuration constants from utility modules

Applied to files:

  • scripts/modules/config-manager.js
  • src/utils/path-utils.js
📚 Learning: 2025-07-18T05:38:17.352Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 943
File: scripts/modules/task-manager/move-task.js:24-24
Timestamp: 2025-07-18T05:38:17.352Z
Learning: In the Claude Task Master system, core task-manager functions are designed with fallback mechanisms for missing projectRoot parameters using the pattern `const projectRoot = providedProjectRoot || findProjectRoot();`. The readJSON and writeJSON functions have default parameters (projectRoot = null, tag = null) and handle missing parameters gracefully. Adding strict validation to these core functions would break the established flexible architecture pattern.

Applied to files:

  • scripts/modules/config-manager.js
  • src/utils/path-utils.js
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 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:

  • scripts/modules/config-manager.js
📚 Learning: 2025-07-18T21:57:56.681Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1011
File: scripts/modules/task-manager/models.js:29-30
Timestamp: 2025-07-18T21:57:56.681Z
Learning: The `task-master init` command creates the config.json file inside the .taskmaster directory, while `task-master models --setup` does not create this file. When the configuration file is missing, users should be directed to run `task-master init`.

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:59:00.056Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.056Z
Learning: Applies to scripts/**/*.js : Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Use try/catch blocks for all file operations and return null or a default value on failure rather than allowing exceptions to propagate unhandled

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Make the log function respect silent mode by skipping logging when silent mode is enabled

Applied to files:

  • src/utils/path-utils.js
🧬 Code graph analysis (5)
scripts/modules/commands.js (1)
scripts/modules/config-manager.js (9)
  • setSuppressConfigWarnings (80-82)
  • config (124-124)
  • config (471-471)
  • config (479-479)
  • config (504-504)
  • config (522-522)
  • config (652-652)
  • config (742-742)
  • config (1146-1146)
src/telemetry/sentry.js (1)
scripts/modules/config-manager.js (2)
  • setSuppressConfigWarnings (80-82)
  • options (103-103)
scripts/dev.js (4)
scripts/modules/commands.js (3)
  • authManager (156-156)
  • authManager (391-391)
  • authManager (5207-5207)
scripts/init.js (1)
  • authManager (414-414)
scripts/modules/ui.js (1)
  • authManager (87-87)
packages/tm-core/src/index.ts (1)
  • AuthManager (154-154)
scripts/modules/config-manager.js (1)
src/utils/path-utils.js (1)
  • findConfigPath (402-475)
src/utils/path-utils.js (1)
mcp-server/src/core/utils/path-utils.js (4)
  • projectRoot (62-64)
  • projectRoot (115-117)
  • projectRoot (151-153)
  • projectRoot (186-186)
⏰ 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 (2)
src/utils/path-utils.js (1)

455-472: Config warning suppression and deduplication look correct

The new shouldSkipWarning guard and per-run warning key set preserve the original “warn once per project” behavior while correctly skipping warnings in API mode and when the global suppression flag is set. No issues from a correctness or UX standpoint.

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

75-91: LGTM: config-warning suppression and storageType integration

The new suppression helpers and storageType plumbing in _loadAndValidateConfig/getConfig look sound:

  • setSuppressConfigWarnings centralizes the global flag mutation and is reused by callers like Sentry init and isConnectedToHamster.
  • _loadAndValidateConfig’s use of storageType and isConfigWarningSuppressed() correctly skips warnings both in API mode and when suppression is explicitly enabled, while still warning for “real” local projects that lack config.
  • Extending getConfig to accept an options object is backward compatible, and the options are correctly forwarded to _loadAndValidateConfig.

No functional issues spotted in these changes.

Also applies to: 100-104, 135-136, 224-259, 269-295

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: 0

Caution

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

⚠️ Outside diff range comments (1)
src/telemetry/sentry.js (1)

47-63: Use try/finally to ensure suppression is always reset.

The current pattern resets suppression in the catch block (line 62) but not via a finally block. If an unexpected exception occurs, suppression might not be reset properly. As per coding guidelines, wrap the core function call with try/finally to ensure the flag is always restored.

Apply this refactor:

 	try {
 		setSuppressConfigWarnings(true);
-		const telemetryEnabled = getAnonymousTelemetryEnabled(options.projectRoot);
-		setSuppressConfigWarnings(false);
-
-		if (!telemetryEnabled) {
-			console.log(
-				'✓ Anonymous telemetry disabled per user preference. ' +
-					'Set anonymousTelemetry: true in .taskmaster/config.json to re-enable.'
-			);
-			return;
-		}
+		try {
+			const telemetryEnabled = getAnonymousTelemetryEnabled(options.projectRoot);
+
+			if (!telemetryEnabled) {
+				console.log(
+					'✓ Anonymous telemetry disabled per user preference. ' +
+						'Set anonymousTelemetry: true in .taskmaster/config.json to re-enable.'
+				);
+				return;
+			}
+		} finally {
+			setSuppressConfigWarnings(false);
+		}
 	} catch (error) {
 		// If there's an error checking telemetry preferences (e.g., config not available yet),
 		// default to enabled. This ensures telemetry works during initialization.
-		setSuppressConfigWarnings(false);
 	}
🧹 Nitpick comments (2)
scripts/dev.js (1)

39-49: Consider using setSuppressConfigWarnings for consistency.

The code directly sets global._tmSuppressConfigWarnings = true instead of calling setSuppressConfigWarnings(true) from config-manager.js. While this works, using the exported function would improve consistency with the rest of the codebase (e.g., sentry.js uses the function).

Apply this diff:

+import { setSuppressConfigWarnings } from './modules/config-manager.js';
+
 // Suppress config warnings if user is authenticated (API mode)
 // When authenticated, we don't need local config - everything is remote
 try {
 	const authManager = AuthManager.getInstance();
 	const hasValidSession = await authManager.hasValidSession();
 	if (hasValidSession) {
-		global._tmSuppressConfigWarnings = true;
+		setSuppressConfigWarnings(true);
 	}
 } catch {
 	// Auth check failed, continue without suppressing
 }
src/utils/path-utils.js (1)

456-472: Consider exporting and using isConfigWarningSuppressed for consistency.

The code directly accesses global._tmSuppressConfigWarnings (line 458), while config-manager.js defines an isConfigWarningSuppressed() helper function (lines 88-90) that isn't exported. For better encapsulation and consistency across the codebase, consider exporting this helper and using it here.

In config-manager.js, export the helper:

 /**
  * Check if config warnings are currently suppressed
  * @returns {boolean}
  */
-function isConfigWarningSuppressed() {
+export function isConfigWarningSuppressed() {
 	return global._tmSuppressConfigWarnings === true;
 }

Then in path-utils.js:

+import { isConfigWarningSuppressed } from '../../scripts/modules/config-manager.js';
+
 	// Only warn once per command execution to prevent spam during init
 	// Skip warning if:
 	// Global suppress flag is set (during API mode detection)
-	const isWarningSuppressed = global._tmSuppressConfigWarnings === true;
+	const isWarningSuppressed = isConfigWarningSuppressed();
 	const shouldSkipWarning = isWarningSuppressed || args?.storageType === 'api';
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa27f1a and 0b7f24b.

📒 Files selected for processing (5)
  • scripts/dev.js (2 hunks)
  • scripts/modules/commands.js (2 hunks)
  • scripts/modules/config-manager.js (5 hunks)
  • src/telemetry/sentry.js (3 hunks)
  • src/utils/path-utils.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/modules/commands.js
🧰 Additional context used
📓 Path-based instructions (11)
**/*.js

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

**/*.js: Always use isSilentMode() function to check current silent mode status instead of directly accessing the global silentMode variable or global.silentMode
Use try/finally block pattern when wrapping core function calls with enableSilentMode/disableSilentMode to ensure silent mode is always restored, even if errors occur
For functions that need to handle both a passed silentMode parameter and check global state, check both the function parameter and global state: const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())
Functions should accept their dependencies as parameters rather than using globals to promote testability and explicit dependency injection
Define callbacks as separate functions for easier testing rather than inline functions

Files:

  • src/telemetry/sentry.js
  • src/utils/path-utils.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
**/*.{js,jsx}

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

JavaScript test files using Jest must follow the same testing patterns as TypeScript files, include proper mocking of external dependencies, and achieve the same coverage thresholds

Files:

  • src/telemetry/sentry.js
  • src/utils/path-utils.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
**/*.{js,ts}

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

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • src/telemetry/sentry.js
  • src/utils/path-utils.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
**/{utils,utilities,helpers}/**/*.{js,ts}

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

**/{utils,utilities,helpers}/**/*.{js,ts}: Document all parameters and return values in JSDoc format, include descriptions for complex logic, and add examples for non-obvious usage
Support multiple log levels (debug, info, warn, error) with appropriate icons for different log levels and respect the configured log level

Files:

  • src/utils/path-utils.js
**/{utils,utilities}/*.{js,ts}

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

Implement the silent mode control functions (enableSilentMode, disableSilentMode, isSilentMode) in utility modules and always use isSilentMode() to check current state

Files:

  • src/utils/path-utils.js
**/{utils,utilities}/**/*.{js,ts}

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

**/{utils,utilities}/**/*.{js,ts}: Use try/catch blocks for all file operations and return null or a default value on failure rather than allowing exceptions to propagate unhandled
Log detailed error information using the log utility in catch blocks for file operations
Create utilities for consistent task ID handling that support different ID formats (numeric, string, dot notation)
Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results
Implement cycle detection using graph traversal by tracking visited nodes and recursion stack, returning specific information about cycles
Detect circular dependencies using DFS and validate task references before operations
Export all utility functions explicitly in logical groups and include configuration constants from utility modules
Do not use default exports in utility modules - use named exports only
Group related exports together in utility modules and avoid creating circular dependencies
Make the log function respect silent mode by skipping logging when silent mode is enabled

Files:

  • src/utils/path-utils.js
scripts/**/*.js

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

scripts/**/*.js: Use the ContextGatherer class from scripts/modules/utils/contextGatherer.js to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using gpt-tokens library
Initialize ContextGatherer with project root and tasks path, then call gather() method with tasks array, files array, customContext, includeProjectTree, format ('research', 'chat', or 'system-prompt'), and includeTokenCounts options
Use the FuzzyTaskSearch class from scripts/modules/utils/fuzzyTaskSearch.js for intelligent task discovery with semantic matching, purpose categorization, and relevance scoring using Fuse.js
Implement a three-step initialization pattern for context-aware commands: (1) validate and parse parameters, (2) initialize context gatherer and find project root, (3) auto-discover relevant tasks using fuzzy search if task IDs not specified
Display token breakdown using boxen library with sections for tasks, files, and prompts, showing formatted token counts and file sizes in a clean bordered box with title
Process AI result responses using cli-highlight library to apply syntax highlighting to code blocks with language detection in the format language\ncode
Set reasonable file size limits (50KB default) and project tree depth limits (3-5 levels) when gathering context to maintain performance
Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Files:

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

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

scripts/modules/config-manager.js: In scripts/modules/config-manager.js, update MODEL_MAP to include the new provider, ensure VALID_PROVIDERS includes the provider, update API key handling in keyMap and the switch statement in getMcpApiKeyStatus and isApiKeySet
For providers not requiring an API key (like Ollama), add a specific check at the beginning of isApiKeySet and getMcpApiKeyStatus to return true immediately for that provider

config-manager.js should load and validate .taskmasterconfig, provide getter functions (getMainProvider, getLogLevel, getDefaultSubtasks, etc.) for accessing settings, manage global.defaultTag and tags section for tag system settings, and NOT directly store or handle API keys

Files:

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

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

Restart the MCP server if core logic in scripts/modules or MCP tool definitions change

Files:

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

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

When implementing MCP support for a command, ensure the core logic function can suppress console output via an outputFormat parameter or other mechanism

scripts/modules/*.js: Use consistent file naming conventions: task_${id.toString().padStart(3, '0')}.txt for task files; use path.join() for composing paths; use appropriate extensions (.txt for tasks, .json for data)
Export all core functions, helper functions, and utility methods needed by dependent code from their respective modules; explicitly verify module export blocks at the bottom of files
Use structured error objects with code and message properties; include clear error messages; handle both function-specific and file system errors; log errors at appropriate severity levels
Use isSilentMode() function to check global silent mode status; wrap core function calls within direct functions using enableSilentMode() and disableSilentMode() in try/finally blocks if the core function produces console output not reliably controlled by outputFormat parameter
Ensure AI calls correctly handle and propagate telemetryData as described in telemetry.mdc
Import context gathering utilities (ContextGatherer, FuzzyTaskSearch) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display
Prefer generateTextService for calls sending large context (like stringified JSON) where incremental display is not needed; import necessary service functions from ai-services-unified.js and prepare parameters (role, session, systemPrompt, prompt)
Create a clear unidirectional flow of dependencies between modules; separate business logic from UI rendering to avoid circular dependencies
Design functions to accept dependencies as parameters; avoid hard-coded dependencies that are difficult to mock
Keep pure logic separate from I/O operations or UI rendering to allow testing logic without mocking complex dependencies
Design core logic to work wi...

Files:

  • scripts/modules/config-manager.js
scripts/modules/**/*.{js,ts}

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

scripts/modules/**/*.{js,ts}: Implement silent migration for tasks.json files that transforms old format to tagged format, marking global flag and performing complete migration
Implement tag resolution functions (getTasksForTag, setTasksForTag, getCurrentTag) that provide backward compatibility with legacy format and default to master tag
Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking
When a logger object is passed as a parameter to core functions, ensure the receiving function can call methods like .info, .warn, .error on that object

Files:

  • scripts/modules/config-manager.js
🧠 Learnings (42)
📓 Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 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.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Ensure AI calls correctly handle and propagate `telemetryData` as described in `telemetry.mdc`

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Do not access the global silentMode variable directly - use the exported silent mode control functions instead

Applied to files:

  • src/telemetry/sentry.js
  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • src/telemetry/sentry.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:00:32.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-11-24T18:00:32.617Z
Learning: Refer to telemetry.mdc for guidelines on integrating AI usage telemetry across Task Master

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Export all utility functions explicitly in logical groups and include configuration constants from utility modules

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-26T20:50:40.810Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/cli/src/ui/components/brand-banner.component.ts:42-44
Timestamp: 2025-11-26T20:50:40.810Z
Learning: In apps/cli/**/*.{ts,tsx}: Do not import or use isSilentMode() from the legacy scripts/modules/utils.js. isSilentMode is legacy code that will be removed during migration. The apps/cli package should use environment variables like TM_HIDE_BANNER for controlling output instead of legacy silent mode patterns.

Applied to files:

  • src/utils/path-utils.js
  • scripts/dev.js
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Track and report changes made during dependency cleanup

Applied to files:

  • src/utils/path-utils.js
  • scripts/dev.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Make the log function respect silent mode by skipping logging when silent mode is enabled

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-11-24T17:59:00.056Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.056Z
Learning: Applies to scripts/**/*.js : Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement silent migration for tasks.json files that transforms old format to tagged format, marking global flag and performing complete migration

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/utils.js : utils.js should provide core utility functions including logging (log function), file I/O (readJSON, writeJSON), string utilities (truncate), task utilities (findTaskById), dependency utilities (findCycles), API key resolution (resolveEnvVariable), silent mode control (enableSilentMode, disableSilentMode), and tagged task list support (migration system, tag resolution, current tag management)

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions must use findTasksJsonPath from ../utils/path-utils.js to resolve the tasks file path using args.projectRoot

Applied to files:

  • src/utils/path-utils.js
  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/commands/**/*.{js,ts} : Handle potential ConfigurationError if the .taskmasterconfig file is missing or invalid when accessed via getConfig

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-07-18T05:38:17.352Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 943
File: scripts/modules/task-manager/move-task.js:24-24
Timestamp: 2025-07-18T05:38:17.352Z
Learning: In the Claude Task Master system, core task-manager functions are designed with fallback mechanisms for missing projectRoot parameters using the pattern `const projectRoot = providedProjectRoot || findProjectRoot();`. The readJSON and writeJSON functions have default parameters (projectRoot = null, tag = null) and handle missing parameters gracefully. Adding strict validation to these core functions would break the established flexible architecture pattern.

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js, scripts/modules/ai-services-unified.js : Do not import or call anything from deprecated AI service files (`ai-services.js`, `ai-client-factory.js`, `ai-client-utils.js`)

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Organize imports by module/functionality, import only what's needed (not entire modules), and avoid creating circular dependencies

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,ts} : 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

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Import context gathering utilities (`ContextGatherer`, `FuzzyTaskSearch`) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-21T11:09:42.143Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1431
File: apps/cli/tests/helpers/test-utils.ts:1-19
Timestamp: 2025-11-21T11:09:42.143Z
Learning: In the eyaltoledano/claude-task-master project, Vitest test environment provides __dirname as a global even when using ES modules, so test files can safely use __dirname without needing to convert to fileURLToPath(import.meta.url) patterns.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/tools/**/*.{js,ts} : Use the withNormalizedProjectRoot Higher-Order Function to wrap tool execute methods, ensuring normalized project root is injected into args

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the initialize_project tool for setting up new projects in integrated environments without requiring a project root

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Pass context object `{ projectRoot, tag }` to all core functions that read or write tasks

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/**/*.{js,ts} : Use normalizeProjectRoot(rawPath, log) to take a raw project root path (potentially URI encoded, with file:// prefix) and return a normalized, absolute path

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/*/[!.]* : Find and validate project root in commands with error handling before processing tasks

Applied to files:

  • scripts/dev.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-26T21:57:48.927Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/mcp/src/tools/tasks/set-task-status.tool.ts:23-25
Timestamp: 2025-11-26T21:57:48.927Z
Learning: Applies to apps/mcp/src/tools/**/*.ts : In the new apps/mcp MCP tool architecture, projectRoot is a required parameter in Zod schemas (not optional like in the legacy mcp-server structure)

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Core task functions must accept a context parameter with `{ projectRoot, tag }` properties

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/commands.js : commands.js should parse command-line arguments and options, invoke appropriate core logic functions from scripts/modules/, handle user input/output for CLI, and implement CLI-specific validation

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function along with setupCLI, runCLI, checkForUpdate, compareVersions, and displayUpgradeNotification functions

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys with helpful hints for fallbacks

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : API keys must be configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP); ensure they are correctly resolved via `session.env` in MCP contexts

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Integrate version checking in the runCLI function by starting the update check in the background, parsing commands, and displaying update notifications after command execution

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:05:02.114Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/.windsurfrules:0-0
Timestamp: 2025-11-24T18:05:02.114Z
Learning: Use the global CLI command `task-master` instead of `node scripts/dev.js` for all task management operations

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function and keep the CLI setup code clean and maintainable.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys for features that depend on them.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/config-manager.js : config-manager.js should load and validate .taskmasterconfig, provide getter functions (getMainProvider, getLogLevel, getDefaultSubtasks, etc.) for accessing settings, manage global.defaultTag and tags section for tag system settings, and NOT directly store or handle API keys

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/config-manager.js : In `scripts/modules/config-manager.js`, update `MODEL_MAP` to include the new provider, ensure `VALID_PROVIDERS` includes the provider, update API key handling in `keyMap` and the `switch` statement in `getMcpApiKeyStatus` and `isApiKeySet`

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Use positive flags with --skip- prefix for disabling behavior instead of --no- prefix negated flags; use clear variable naming like `const generateFiles = !options.skipGenerate` to avoid double negatives

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Use `isSilentMode()` function to check global silent mode status; wrap core function calls within direct functions using `enableSilentMode()` and `disableSilentMode()` in try/finally blocks if the core function produces console output not reliably controlled by outputFormat parameter

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 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:

  • scripts/modules/config-manager.js
📚 Learning: 2025-07-18T21:57:56.681Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1011
File: scripts/modules/task-manager/models.js:29-30
Timestamp: 2025-07-18T21:57:56.681Z
Learning: The `task-master init` command creates the config.json file inside the .taskmaster directory, while `task-master models --setup` does not create this file. When the configuration file is missing, users should be directed to run `task-master init`.

Applied to files:

  • scripts/modules/config-manager.js
🧬 Code graph analysis (2)
src/telemetry/sentry.js (1)
scripts/modules/config-manager.js (1)
  • setSuppressConfigWarnings (80-82)
scripts/modules/config-manager.js (3)
scripts/modules/ui.js (1)
  • options (79-79)
src/utils/path-utils.js (1)
  • findConfigPath (402-475)
scripts/modules/commands.js (1)
  • storageType (5196-5196)
⏰ 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 (4)
src/telemetry/sentry.js (1)

7-10: LGTM! Import changes align with the suppression mechanism.

The addition of setSuppressConfigWarnings is necessary for the new suppression logic.

scripts/dev.js (1)

12-12: LGTM! AuthManager import is appropriate.

The import from @tm/core follows the established pattern for core utilities.

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

224-259: LGTM! Warning suppression logic is well-designed.

The implementation correctly:

  • Checks both the global suppression flag and storageType
  • Only warns for existing projects (checks for project markers)
  • Provides clear, actionable warning messages
  • Differentiates between explicit and derived root scenarios

264-295: LGTM! Options parameter properly documented and forwarded.

The addition of the options parameter to getConfig is well-documented and correctly propagated to _loadAndValidateConfig.

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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b7f24b and f0bad1e.

📒 Files selected for processing (3)
  • scripts/dev.js (2 hunks)
  • scripts/modules/commands.js (2 hunks)
  • src/telemetry/sentry.js (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/modules/commands.js
🧰 Additional context used
📓 Path-based instructions (4)
**/*.js

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

**/*.js: Always use isSilentMode() function to check current silent mode status instead of directly accessing the global silentMode variable or global.silentMode
Use try/finally block pattern when wrapping core function calls with enableSilentMode/disableSilentMode to ensure silent mode is always restored, even if errors occur
For functions that need to handle both a passed silentMode parameter and check global state, check both the function parameter and global state: const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())
Functions should accept their dependencies as parameters rather than using globals to promote testability and explicit dependency injection
Define callbacks as separate functions for easier testing rather than inline functions

Files:

  • src/telemetry/sentry.js
  • scripts/dev.js
**/*.{js,jsx}

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

JavaScript test files using Jest must follow the same testing patterns as TypeScript files, include proper mocking of external dependencies, and achieve the same coverage thresholds

Files:

  • src/telemetry/sentry.js
  • scripts/dev.js
**/*.{js,ts}

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

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • src/telemetry/sentry.js
  • scripts/dev.js
scripts/**/*.js

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

scripts/**/*.js: Use the ContextGatherer class from scripts/modules/utils/contextGatherer.js to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using gpt-tokens library
Initialize ContextGatherer with project root and tasks path, then call gather() method with tasks array, files array, customContext, includeProjectTree, format ('research', 'chat', or 'system-prompt'), and includeTokenCounts options
Use the FuzzyTaskSearch class from scripts/modules/utils/fuzzyTaskSearch.js for intelligent task discovery with semantic matching, purpose categorization, and relevance scoring using Fuse.js
Implement a three-step initialization pattern for context-aware commands: (1) validate and parse parameters, (2) initialize context gatherer and find project root, (3) auto-discover relevant tasks using fuzzy search if task IDs not specified
Display token breakdown using boxen library with sections for tasks, files, and prompts, showing formatted token counts and file sizes in a clean bordered box with title
Process AI result responses using cli-highlight library to apply syntax highlighting to code blocks with language detection in the format language\ncode
Set reasonable file size limits (50KB default) and project tree depth limits (3-5 levels) when gathering context to maintain performance
Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Files:

  • scripts/dev.js
🧠 Learnings (26)
📓 Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 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.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Ensure AI calls correctly handle and propagate `telemetryData` as described in `telemetry.mdc`

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Do not access the global silentMode variable directly - use the exported silent mode control functions instead

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call

Applied to files:

  • src/telemetry/sentry.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • src/telemetry/sentry.js
  • scripts/dev.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js, scripts/modules/ai-services-unified.js : Do not import or call anything from deprecated AI service files (`ai-services.js`, `ai-client-factory.js`, `ai-client-utils.js`)

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Organize imports by module/functionality, import only what's needed (not entire modules), and avoid creating circular dependencies

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,ts} : 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

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/tools/**/*.{js,ts} : Use the withNormalizedProjectRoot Higher-Order Function to wrap tool execute methods, ensuring normalized project root is injected into args

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the initialize_project tool for setting up new projects in integrated environments without requiring a project root

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Pass context object `{ projectRoot, tag }` to all core functions that read or write tasks

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/*/[!.]* : Find and validate project root in commands with error handling before processing tasks

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-21T11:09:42.143Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1431
File: apps/cli/tests/helpers/test-utils.ts:1-19
Timestamp: 2025-11-21T11:09:42.143Z
Learning: In the eyaltoledano/claude-task-master project, Vitest test environment provides __dirname as a global even when using ES modules, so test files can safely use __dirname without needing to convert to fileURLToPath(import.meta.url) patterns.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/**/*.{js,ts} : Use normalizeProjectRoot(rawPath, log) to take a raw project root path (potentially URI encoded, with file:// prefix) and return a normalized, absolute path

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-26T21:57:48.927Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/mcp/src/tools/tasks/set-task-status.tool.ts:23-25
Timestamp: 2025-11-26T21:57:48.927Z
Learning: Applies to apps/mcp/src/tools/**/*.ts : In the new apps/mcp MCP tool architecture, projectRoot is a required parameter in Zod schemas (not optional like in the legacy mcp-server structure)

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Core task functions must accept a context parameter with `{ projectRoot, tag }` properties

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions must use findTasksJsonPath from ../utils/path-utils.js to resolve the tasks file path using args.projectRoot

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/commands.js : commands.js should parse command-line arguments and options, invoke appropriate core logic functions from scripts/modules/, handle user input/output for CLI, and implement CLI-specific validation

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys with helpful hints for fallbacks

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function along with setupCLI, runCLI, checkForUpdate, compareVersions, and displayUpgradeNotification functions

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : API keys must be configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP); ensure they are correctly resolved via `session.env` in MCP contexts

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Integrate version checking in the runCLI function by starting the update check in the background, parsing commands, and displaying update notifications after command execution

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys for features that depend on them.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-26T20:50:40.810Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/cli/src/ui/components/brand-banner.component.ts:42-44
Timestamp: 2025-11-26T20:50:40.810Z
Learning: In apps/cli/**/*.{ts,tsx}: Do not import or use isSilentMode() from the legacy scripts/modules/utils.js. isSilentMode is legacy code that will be removed during migration. The apps/cli package should use environment variables like TM_HIDE_BANNER for controlling output instead of legacy silent mode patterns.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Check that required parameters are provided, provide clear error messages when parameters are missing, and use early returns with process.exit(1) for validation failures.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function and keep the CLI setup code clean and maintainable.

Applied to files:

  • scripts/dev.js
🧬 Code graph analysis (1)
src/telemetry/sentry.js (1)
scripts/modules/config-manager.js (1)
  • setSuppressConfigWarnings (80-82)
⏰ 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 (3)
scripts/dev.js (1)

12-13: LGTM: Imports support the new authentication gate.

The new imports are appropriately scoped and necessary for the authentication-based suppression logic.

src/telemetry/sentry.js (2)

7-10: LGTM: Import changes support suppression mechanism.

The addition of setSuppressConfigWarnings to the import statement enables the temporary suppression pattern implemented below.


46-63: LGTM: Correct try/finally pattern for suppression.

The implementation properly scopes the config warning suppression to just the telemetry preference check and guarantees cleanup in the finally block. This follows the coding guideline for mode-toggling patterns and ensures warnings are restored even if the check fails.

Comment on lines 40 to 50
// Suppress config warnings if user is authenticated (API mode)
// When authenticated, we don't need local config - everything is remote
try {
const authManager = AuthManager.getInstance();
const hasValidSession = await authManager.hasValidSession();
if (hasValidSession) {
setSuppressConfigWarnings(true);
}
} catch {
// Auth check failed, continue without suppressing
}
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 | 🔴 Critical

Critical: Config warning suppression is never restored.

The authentication check enables warning suppression when a valid session exists, but never resets it back to false. This permanently disables config warnings for the entire CLI session instead of only during the authentication check itself.

Per coding guidelines, mode-toggling patterns require a try/finally block to ensure restoration even if errors occur.

Apply this diff to scope the suppression to just the authentication check:

 // Suppress config warnings if user is authenticated (API mode)
 // When authenticated, we don't need local config - everything is remote
 try {
+	setSuppressConfigWarnings(true);
 	const authManager = AuthManager.getInstance();
 	const hasValidSession = await authManager.hasValidSession();
-	if (hasValidSession) {
-		setSuppressConfigWarnings(true);
-	}
+	// If authenticated, keep suppression enabled for the session
+	if (!hasValidSession) {
+		setSuppressConfigWarnings(false);
+	}
 } catch {
 	// Auth check failed, continue without suppressing
+	setSuppressConfigWarnings(false);
+} finally {
+	// If not keeping suppression enabled, ensure it's reset
 }

Note: If the intent is to keep suppression enabled for the entire session when authenticated (as the comment suggests), then the current implementation is correct but the PR description is misleading—it claims to suppress warnings "during" checks, not permanently for authenticated sessions.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
scripts/dev.js around lines 40 to 50: the code sets
setSuppressConfigWarnings(true) when an authenticated session is detected but
never restores the previous state, permanently disabling warnings; wrap the auth
check in a try/finally (or save the previous suppression value) so you set
suppression true only for the duration of the check and in finally restore it to
its original value (or, if the intended behavior is to keep suppression for the
whole session, update the comment/PR description to state that explicitly
instead of implying temporary suppression).

@Crunchyman-ralph Crunchyman-ralph force-pushed the ralph/fix/suppress-sentry-config-warnings branch from f0bad1e to e05180b Compare December 3, 2025 20:58
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: 0

♻️ Duplicate comments (1)
scripts/dev.js (1)

40-51: Config warning suppression is intentionally permanent for authenticated sessions.

The previous review correctly identified that setSuppressConfigWarnings(true) is never restored when a valid session exists. Based on the inline comment ("When authenticated, we don't need local config - everything is remote"), this appears intentional—the entire CLI session operates in API mode without local config.

However, if the intent is temporary suppression only during the auth check itself, then the previous review's suggestion to use a try/finally pattern applies. Please clarify the intended behavior:

  1. Permanent suppression for authenticated sessions (current behavior): The code is correct as-is, but the PR description saying "during" checks is misleading.
  2. Temporary suppression during auth check only: Apply the try/finally pattern from the previous review.
🧹 Nitpick comments (2)
src/utils/path-utils.js (1)

26-26: Cross-boundary import from src/ to scripts/modules/.

This import creates a dependency from the src/ directory back into scripts/modules/, which may complicate the ongoing migration to @tm/core. Consider whether isConfigWarningSuppressed should be exposed through @tm/core or a shared utility module to maintain cleaner module boundaries.

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

1190-1197: Duplicated providersWithoutApiKeys array.

This array duplicates the one defined inline at lines 868-875 inside isApiKeySet. If either list is updated, they could diverge.

Consider defining the array once at module scope and reusing it:

+// Providers that don't require API keys for authentication
+const providersWithoutApiKeys = [
+	CUSTOM_PROVIDERS.OLLAMA,
+	CUSTOM_PROVIDERS.BEDROCK,
+	CUSTOM_PROVIDERS.GEMINI_CLI,
+	CUSTOM_PROVIDERS.GROK_CLI,
+	CUSTOM_PROVIDERS.MCP,
+	CUSTOM_PROVIDERS.CODEX_CLI
+];
+
 function isApiKeySet(providerName, session = null, projectRoot = null) {
-	// Providers that don't require API keys for authentication
-	const providersWithoutApiKeys = [
-		CUSTOM_PROVIDERS.OLLAMA,
-		CUSTOM_PROVIDERS.BEDROCK,
-		CUSTOM_PROVIDERS.GEMINI_CLI,
-		CUSTOM_PROVIDERS.GROK_CLI,
-		CUSTOM_PROVIDERS.MCP,
-		CUSTOM_PROVIDERS.CODEX_CLI
-	];
-
 	if (providersWithoutApiKeys.includes(providerName?.toLowerCase())) {

Then remove the duplicate export definition at lines 1190-1197 and export the module-scope constant directly.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0bad1e and e05180b.

📒 Files selected for processing (5)
  • scripts/dev.js (2 hunks)
  • scripts/modules/commands.js (2 hunks)
  • scripts/modules/config-manager.js (5 hunks)
  • src/telemetry/sentry.js (3 hunks)
  • src/utils/path-utils.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/modules/commands.js
  • src/telemetry/sentry.js
🧰 Additional context used
📓 Path-based instructions (11)
**/*.js

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

**/*.js: Always use isSilentMode() function to check current silent mode status instead of directly accessing the global silentMode variable or global.silentMode
Use try/finally block pattern when wrapping core function calls with enableSilentMode/disableSilentMode to ensure silent mode is always restored, even if errors occur
For functions that need to handle both a passed silentMode parameter and check global state, check both the function parameter and global state: const isSilent = options.silentMode || (typeof options.silentMode === 'undefined' && isSilentMode())
Functions should accept their dependencies as parameters rather than using globals to promote testability and explicit dependency injection
Define callbacks as separate functions for easier testing rather than inline functions

Files:

  • scripts/dev.js
  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
scripts/**/*.js

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

scripts/**/*.js: Use the ContextGatherer class from scripts/modules/utils/contextGatherer.js to extract context from multiple sources (tasks, files, custom text, project tree) with token counting using gpt-tokens library
Initialize ContextGatherer with project root and tasks path, then call gather() method with tasks array, files array, customContext, includeProjectTree, format ('research', 'chat', or 'system-prompt'), and includeTokenCounts options
Use the FuzzyTaskSearch class from scripts/modules/utils/fuzzyTaskSearch.js for intelligent task discovery with semantic matching, purpose categorization, and relevance scoring using Fuse.js
Implement a three-step initialization pattern for context-aware commands: (1) validate and parse parameters, (2) initialize context gatherer and find project root, (3) auto-discover relevant tasks using fuzzy search if task IDs not specified
Display token breakdown using boxen library with sections for tasks, files, and prompts, showing formatted token counts and file sizes in a clean bordered box with title
Process AI result responses using cli-highlight library to apply syntax highlighting to code blocks with language detection in the format language\ncode
Set reasonable file size limits (50KB default) and project tree depth limits (3-5 levels) when gathering context to maintain performance
Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Files:

  • scripts/dev.js
  • scripts/modules/config-manager.js
**/*.{js,jsx}

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

JavaScript test files using Jest must follow the same testing patterns as TypeScript files, include proper mocking of external dependencies, and achieve the same coverage thresholds

Files:

  • scripts/dev.js
  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
**/*.{js,ts}

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

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • scripts/dev.js
  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
**/{utils,utilities,helpers}/**/*.{js,ts}

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

**/{utils,utilities,helpers}/**/*.{js,ts}: Document all parameters and return values in JSDoc format, include descriptions for complex logic, and add examples for non-obvious usage
Support multiple log levels (debug, info, warn, error) with appropriate icons for different log levels and respect the configured log level

Files:

  • src/utils/path-utils.js
**/{utils,utilities}/*.{js,ts}

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

Implement the silent mode control functions (enableSilentMode, disableSilentMode, isSilentMode) in utility modules and always use isSilentMode() to check current state

Files:

  • src/utils/path-utils.js
**/{utils,utilities}/**/*.{js,ts}

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

**/{utils,utilities}/**/*.{js,ts}: Use try/catch blocks for all file operations and return null or a default value on failure rather than allowing exceptions to propagate unhandled
Log detailed error information using the log utility in catch blocks for file operations
Create utilities for consistent task ID handling that support different ID formats (numeric, string, dot notation)
Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results
Implement cycle detection using graph traversal by tracking visited nodes and recursion stack, returning specific information about cycles
Detect circular dependencies using DFS and validate task references before operations
Export all utility functions explicitly in logical groups and include configuration constants from utility modules
Do not use default exports in utility modules - use named exports only
Group related exports together in utility modules and avoid creating circular dependencies
Make the log function respect silent mode by skipping logging when silent mode is enabled

Files:

  • src/utils/path-utils.js
scripts/modules/config-manager.js

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

scripts/modules/config-manager.js: In scripts/modules/config-manager.js, update MODEL_MAP to include the new provider, ensure VALID_PROVIDERS includes the provider, update API key handling in keyMap and the switch statement in getMcpApiKeyStatus and isApiKeySet
For providers not requiring an API key (like Ollama), add a specific check at the beginning of isApiKeySet and getMcpApiKeyStatus to return true immediately for that provider

config-manager.js should load and validate .taskmasterconfig, provide getter functions (getMainProvider, getLogLevel, getDefaultSubtasks, etc.) for accessing settings, manage global.defaultTag and tags section for tag system settings, and NOT directly store or handle API keys

Files:

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

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

Restart the MCP server if core logic in scripts/modules or MCP tool definitions change

Files:

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

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

When implementing MCP support for a command, ensure the core logic function can suppress console output via an outputFormat parameter or other mechanism

scripts/modules/*.js: Use consistent file naming conventions: task_${id.toString().padStart(3, '0')}.txt for task files; use path.join() for composing paths; use appropriate extensions (.txt for tasks, .json for data)
Export all core functions, helper functions, and utility methods needed by dependent code from their respective modules; explicitly verify module export blocks at the bottom of files
Use structured error objects with code and message properties; include clear error messages; handle both function-specific and file system errors; log errors at appropriate severity levels
Use isSilentMode() function to check global silent mode status; wrap core function calls within direct functions using enableSilentMode() and disableSilentMode() in try/finally blocks if the core function produces console output not reliably controlled by outputFormat parameter
Ensure AI calls correctly handle and propagate telemetryData as described in telemetry.mdc
Import context gathering utilities (ContextGatherer, FuzzyTaskSearch) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display
Prefer generateTextService for calls sending large context (like stringified JSON) where incremental display is not needed; import necessary service functions from ai-services-unified.js and prepare parameters (role, session, systemPrompt, prompt)
Create a clear unidirectional flow of dependencies between modules; separate business logic from UI rendering to avoid circular dependencies
Design functions to accept dependencies as parameters; avoid hard-coded dependencies that are difficult to mock
Keep pure logic separate from I/O operations or UI rendering to allow testing logic without mocking complex dependencies
Design core logic to work wi...

Files:

  • scripts/modules/config-manager.js
scripts/modules/**/*.{js,ts}

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

scripts/modules/**/*.{js,ts}: Implement silent migration for tasks.json files that transforms old format to tagged format, marking global flag and performing complete migration
Implement tag resolution functions (getTasksForTag, setTasksForTag, getCurrentTag) that provide backward compatibility with legacy format and default to master tag
Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking
When a logger object is passed as a parameter to core functions, ensure the receiving function can call methods like .info, .warn, .error on that object

Files:

  • scripts/modules/config-manager.js
🧠 Learnings (42)
📓 Common learnings
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1232
File: packages/tm-core/package.json:50-51
Timestamp: 2025-09-22T19:45:04.337Z
Learning: In the eyaltoledano/claude-task-master project, Crunchyman-ralph intentionally omits version fields from internal/private packages in package.json files to prevent changesets from releasing new versions of these packages while still allowing them to be processed for dependency updates. The changesets warnings about missing versions are acceptable as they don't break the process and achieve the desired behavior of only releasing public packages.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 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.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js, scripts/modules/ai-services-unified.js : Do not import or call anything from deprecated AI service files (`ai-services.js`, `ai-client-factory.js`, `ai-client-utils.js`)

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Organize imports by module/functionality, import only what's needed (not entire modules), and avoid creating circular dependencies

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,ts} : 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

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to scripts/modules/*.js : Import context gathering utilities (`ContextGatherer`, `FuzzyTaskSearch`) for AI-powered commands; support multiple context types (tasks, files, custom text, project tree); implement detailed token breakdown display

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : Do not fetch AI-specific parameters (model ID, max tokens, temperature) using `config-manager.js` getters for AI calls; pass the `role` parameter instead to the unified service

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:01:44.169Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.169Z
Learning: Applies to mcp-server/src/core/task-master-core.js : Update `task-master-core.js` by importing and re-exporting direct functions and adding them to the directFunctions map

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Group imports by module/functionality, import only what's needed (not entire modules), and do not create circular dependencies.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-12T20:05:10.138Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1389
File: packages/tm-core/src/modules/auth/config.ts:55-59
Timestamp: 2025-11-12T20:05:10.138Z
Learning: In packages/tm-core/src/modules/auth/config.ts, the DEFAULT_AUTH_CONFIG Proxy does not require enumeration support (has, ownKeys, getOwnPropertyDescriptor traps). The codebase only uses direct property access on this config object, so the basic get trap is sufficient.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Track and report changes made during dependency cleanup

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Ensure silent mode is disabled in a finally block to prevent it from staying enabled

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/tools/**/*.{js,ts} : Use the withNormalizedProjectRoot Higher-Order Function to wrap tool execute methods, ensuring normalized project root is injected into args

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:01:06.077Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-11-24T18:01:06.077Z
Learning: Applies to mcp-server/src/tools/*.js : Use the initialize_project tool for setting up new projects in integrated environments without requiring a project root

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Pass context object `{ projectRoot, tag }` to all core functions that read or write tasks

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/*/[!.]* : Find and validate project root in commands with error handling before processing tasks

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-21T11:09:42.143Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1431
File: apps/cli/tests/helpers/test-utils.ts:1-19
Timestamp: 2025-11-21T11:09:42.143Z
Learning: In the eyaltoledano/claude-task-master project, Vitest test environment provides __dirname as a global even when using ES modules, so test files can safely use __dirname without needing to convert to fileURLToPath(import.meta.url) patterns.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to mcp-server/src/**/*.{js,ts} : Use normalizeProjectRoot(rawPath, log) to take a raw project root path (potentially URI encoded, with file:// prefix) and return a normalized, absolute path

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-26T21:57:48.927Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/mcp/src/tools/tasks/set-task-status.tool.ts:23-25
Timestamp: 2025-11-26T21:57:48.927Z
Learning: Applies to apps/mcp/src/tools/**/*.ts : In the new apps/mcp MCP tool architecture, projectRoot is a required parameter in Zod schemas (not optional like in the legacy mcp-server structure)

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Core task functions must accept a context parameter with `{ projectRoot, tag }` properties

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Direct functions must use findTasksJsonPath from ../utils/path-utils.js to resolve the tasks file path using args.projectRoot

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/commands.js : commands.js should parse command-line arguments and options, invoke appropriate core logic functions from scripts/modules/, handle user input/output for CLI, and implement CLI-specific validation

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys with helpful hints for fallbacks

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function along with setupCLI, runCLI, checkForUpdate, compareVersions, and displayUpgradeNotification functions

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:57:31.417Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_services.mdc:0-0
Timestamp: 2025-11-24T17:57:31.417Z
Learning: Applies to scripts/modules/task-manager/*.js, scripts/modules/commands.js : API keys must be configured in `.env` (for CLI) or `.cursor/mcp.json` (for MCP); ensure they are correctly resolved via `session.env` in MCP contexts

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Integrate version checking in the runCLI function by starting the update check in the background, parsing commands, and displaying update notifications after command execution

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Validate file existence for critical file operations, provide context-specific validation for identifiers, and check required API keys for features that depend on them.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-26T20:50:40.810Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1451
File: apps/cli/src/ui/components/brand-banner.component.ts:42-44
Timestamp: 2025-11-26T20:50:40.810Z
Learning: In apps/cli/**/*.{ts,tsx}: Do not import or use isSilentMode() from the legacy scripts/modules/utils.js. isSilentMode is legacy code that will be removed during migration. The apps/cli package should use environment variables like TM_HIDE_BANNER for controlling output instead of legacy silent mode patterns.

Applied to files:

  • scripts/dev.js
  • src/utils/path-utils.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Check that required parameters are provided, provide clear error messages when parameters are missing, and use early returns with process.exit(1) for validation failures.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T17:58:47.030Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-11-24T17:58:47.030Z
Learning: Applies to scripts/modules/commands.js : Provide contextual error handling for common issues with specific troubleshooting hints for each error type and consistent error formatting across all commands

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-07-18T17:08:48.695Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/commands.mdc:0-0
Timestamp: 2025-07-18T17:08:48.695Z
Learning: Applies to scripts/modules/commands.js : Export the registerCommands function and keep the CLI setup code clean and maintainable.

Applied to files:

  • scripts/dev.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Export all utility functions explicitly in logical groups and include configuration constants from utility modules

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:59:00.056Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.056Z
Learning: Applies to scripts/**/*.js : Implement graceful error handling for context gathering: handle missing files with warnings, validate task IDs with helpful messages, continue processing if some context sources fail, and provide fallback behavior

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-09-03T12:20:36.005Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/index.ts:56-57
Timestamp: 2025-09-03T12:20:36.005Z
Learning: The logger functionality in tm-core should only be available through the main package entry point (import { getLogger, createLogger, setGlobalLogger } from 'tm-core'), not as a separate subpath export like other modules such as auth or storage.

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to scripts/commands/**/*.{js,ts} : Handle potential ConfigurationError if the .taskmasterconfig file is missing or invalid when accessed via getConfig

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:04:43.972Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.972Z
Learning: Applies to **/*.{js,ts} : Do not access the global silentMode variable directly - use the exported silent mode control functions instead

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:58:07.992Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.992Z
Learning: Applies to scripts/modules/config-manager.js : config-manager.js should load and validate .taskmasterconfig, provide getter functions (getMainProvider, getLogLevel, getDefaultSubtasks, etc.) for accessing settings, manage global.defaultTag and tags section for tag system settings, and NOT directly store or handle API keys

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T18:02:04.644Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-11-24T18:02:04.644Z
Learning: Applies to scripts/modules/task-manager/**/*.{js,mjs} : Use `readJSON(tasksPath, projectRoot, tag)` and `writeJSON(tasksPath, data, projectRoot, tag)` for all task data access

Applied to files:

  • src/utils/path-utils.js
📚 Learning: 2025-07-18T05:38:17.352Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 943
File: scripts/modules/task-manager/move-task.js:24-24
Timestamp: 2025-07-18T05:38:17.352Z
Learning: In the Claude Task Master system, core task-manager functions are designed with fallback mechanisms for missing projectRoot parameters using the pattern `const projectRoot = providedProjectRoot || findProjectRoot();`. The readJSON and writeJSON functions have default parameters (projectRoot = null, tag = null) and handle missing parameters gracefully. Adding strict validation to these core functions would break the established flexible architecture pattern.

Applied to files:

  • src/utils/path-utils.js
  • scripts/modules/config-manager.js
📚 Learning: 2025-11-24T17:57:14.743Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.743Z
Learning: Applies to scripts/modules/config-manager.js : In `scripts/modules/config-manager.js`, update `MODEL_MAP` to include the new provider, ensure `VALID_PROVIDERS` includes the provider, update API key handling in `keyMap` and the `switch` statement in `getMcpApiKeyStatus` and `isApiKeySet`

Applied to files:

  • scripts/modules/config-manager.js
📚 Learning: 2025-07-18T17:10:02.683Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 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:

  • scripts/modules/config-manager.js
📚 Learning: 2025-07-18T21:57:56.681Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1011
File: scripts/modules/task-manager/models.js:29-30
Timestamp: 2025-07-18T21:57:56.681Z
Learning: The `task-master init` command creates the config.json file inside the .taskmaster directory, while `task-master models --setup` does not create this file. When the configuration file is missing, users should be directed to run `task-master init`.

Applied to files:

  • scripts/modules/config-manager.js
🧬 Code graph analysis (3)
scripts/dev.js (5)
scripts/modules/commands.js (3)
  • authManager (156-156)
  • authManager (389-389)
  • authManager (5205-5205)
scripts/init.js (1)
  • authManager (414-414)
scripts/modules/ui.js (1)
  • authManager (87-87)
packages/tm-core/src/index.ts (1)
  • AuthManager (154-154)
scripts/modules/config-manager.js (1)
  • setSuppressConfigWarnings (80-82)
src/utils/path-utils.js (1)
scripts/modules/config-manager.js (1)
  • isConfigWarningSuppressed (88-90)
scripts/modules/config-manager.js (1)
src/utils/path-utils.js (1)
  • findConfigPath (403-476)
⏰ 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 (6)
src/utils/path-utils.js (1)

459-473: LGTM!

The warning suppression logic is well-implemented: it correctly guards both the global Set initialization and warning emission, uses a per-projectRoot key for deduplication, and respects both the global suppression flag and storageType-based suppression.

scripts/dev.js (1)

12-13: LGTM!

The imports are well-organized, separating @tm/core exports from local module imports.

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

75-90: LGTM! Clean global suppression API.

Using global._tmSuppressConfigWarnings is an appropriate pattern for sharing state across modules without introducing circular dependencies. The JSDoc comments clearly document the purpose.


100-103: LGTM!

The options parameter pattern is extensible and correctly threads storageType through the config loading flow.


224-255: LGTM!

The warning logic correctly combines multiple suppression conditions and adds an appropriate guard to avoid warnings during project initialization (when no markers exist).


269-273: LGTM!

The getConfig signature change is backward-compatible with the options = {} default, and the JSDoc is appropriately updated.

@Crunchyman-ralph Crunchyman-ralph merged commit 0e7c068 into next Dec 3, 2025
7 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 3, 2025
16 tasks
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