chore: rename log level environment variable to TASKMASTER_LOG_LEVEL #802

Closed
opened 2025-10-14 16:16:24 -06:00 by navan · 0 comments
Owner

Originally created by @ksylvan on 5/4/2025

CHANGES

  • Update environment variable from LOG_LEVEL to TASKMASTER_LOG_LEVEL.
  • Reflect change in documentation for clarity.
  • Adjust variable name in script and test files.
  • Maintain default log level as info.

Summary

This pull request fixes a bug where the LOG_LEVEL environment variable conflicts with fastmcp, causing a Pydantic validation error. The issue arises when LOG_LEVEL is set to info in the .env file, which is not a valid log level for fastmcp. To resolve this, the LOG_LEVEL variable has been renamed to TASKMASTER_LOG_LEVEL to avoid the conflict.

Fixed #409

Files Changed

The following files have been modified to fix the bug:

  • assets/scripts_README.md: Updated to reflect the change from LOG_LEVEL to TASKMASTER_LOG_LEVEL.
  • scripts/README.md: Updated to reflect the change from LOG_LEVEL to TASKMASTER_LOG_LEVEL.
  • scripts/init.js: Updated to use TASKMASTER_LOG_LEVEL instead of LOG_LEVEL.
  • tests/setup.js: Updated to use TASKMASTER_LOG_LEVEL instead of LOG_LEVEL.

Code Changes

// assets/scripts_README.md
-**Important:** Settings like `MODEL`, `MAX_TOKENS`, `TEMPERATURE`, `LOG_LEVEL`, etc., are **no longer set via `.env`**. Use `task-master models --setup` instead.
+**Important:** Settings like `MODEL`, `MAX_TOKENS`, `TEMPERATURE`, `TASKMASTER_LOG_LEVEL`, etc., are **no longer set via `.env`**. Use `task-master models --setup` instead.
// scripts/README.md
- `LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
+- `TASKMASTER_LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
// scripts/init.js
-const LOG_LEVEL = process.env.LOG_LEVEL
-? LOG_LEVELS[process.env.LOG_LEVEL.toLowerCase()]
-: LOG_LEVELS.info;
+const LOG_LEVEL = process.env.TASKMASTER_LOG_LEVEL
+? LOG_LEVELS[process.env.TASKMASTER_LOG_LEVEL.toLowerCase()]
+: LOG_LEVELS.info; // Default to info
// tests/setup.js
-process.env.LOG_LEVEL = 'error'; // Set to error to reduce noise in tests
+process.env.TASKMASTER_LOG_LEVEL = 'error'; // Set to error to reduce noise in tests

Reason for Changes

The reason for these changes is to avoid a conflict between the LOG_LEVEL environment variable and fastmcp. By renaming LOG_LEVEL to TASKMASTER_LOG_LEVEL, we can set the log level for Task Master without interfering with fastmcp's settings.

Impact of Changes

These changes should resolve the Pydantic validation error and allow the fastmcp server to run correctly. The log level for Task Master will now be controlled by the TASKMASTER_LOG_LEVEL environment variable, which defaults to info.

Test Plan

To test these changes, set up a test MCP file using fastmcp and run it with the LOG_LEVEL set to info in the .env file. The server should run correctly without any validation errors.

Additional Notes

It is recommended to update the .env file to use TASKMASTER_LOG_LEVEL instead of LOG_LEVEL to avoid any potential conflicts in the future.

*Originally created by @ksylvan on 5/4/2025* ### CHANGES - Update environment variable from `LOG_LEVEL` to `TASKMASTER_LOG_LEVEL`. - Reflect change in documentation for clarity. - Adjust variable name in script and test files. - Maintain default log level as `info`. # Summary This pull request fixes a bug where the `LOG_LEVEL` environment variable conflicts with `fastmcp`, causing a Pydantic validation error. The issue arises when `LOG_LEVEL` is set to `info` in the `.env` file, which is not a valid log level for `fastmcp`. To resolve this, the `LOG_LEVEL` variable has been renamed to `TASKMASTER_LOG_LEVEL` to avoid the conflict. Fixed #409 # Files Changed The following files have been modified to fix the bug: * `assets/scripts_README.md`: Updated to reflect the change from `LOG_LEVEL` to `TASKMASTER_LOG_LEVEL`. * `scripts/README.md`: Updated to reflect the change from `LOG_LEVEL` to `TASKMASTER_LOG_LEVEL`. * `scripts/init.js`: Updated to use `TASKMASTER_LOG_LEVEL` instead of `LOG_LEVEL`. * `tests/setup.js`: Updated to use `TASKMASTER_LOG_LEVEL` instead of `LOG_LEVEL`. # Code Changes ```markdown // assets/scripts_README.md -**Important:** Settings like `MODEL`, `MAX_TOKENS`, `TEMPERATURE`, `LOG_LEVEL`, etc., are **no longer set via `.env`**. Use `task-master models --setup` instead. +**Important:** Settings like `MODEL`, `MAX_TOKENS`, `TEMPERATURE`, `TASKMASTER_LOG_LEVEL`, etc., are **no longer set via `.env`**. Use `task-master models --setup` instead. ``` ```markdown // scripts/README.md - `LOG_LEVEL`: Log level - debug, info, warn, error (default: info) +- `TASKMASTER_LOG_LEVEL`: Log level - debug, info, warn, error (default: info) ``` ```javascript // scripts/init.js -const LOG_LEVEL = process.env.LOG_LEVEL -? LOG_LEVELS[process.env.LOG_LEVEL.toLowerCase()] -: LOG_LEVELS.info; +const LOG_LEVEL = process.env.TASKMASTER_LOG_LEVEL +? LOG_LEVELS[process.env.TASKMASTER_LOG_LEVEL.toLowerCase()] +: LOG_LEVELS.info; // Default to info ``` ```javascript // tests/setup.js -process.env.LOG_LEVEL = 'error'; // Set to error to reduce noise in tests +process.env.TASKMASTER_LOG_LEVEL = 'error'; // Set to error to reduce noise in tests ``` # Reason for Changes The reason for these changes is to avoid a conflict between the `LOG_LEVEL` environment variable and `fastmcp`. By renaming `LOG_LEVEL` to `TASKMASTER_LOG_LEVEL`, we can set the log level for Task Master without interfering with `fastmcp`'s settings. # Impact of Changes These changes should resolve the Pydantic validation error and allow the `fastmcp` server to run correctly. The log level for Task Master will now be controlled by the `TASKMASTER_LOG_LEVEL` environment variable, which defaults to `info`. # Test Plan To test these changes, set up a test MCP file using `fastmcp` and run it with the `LOG_LEVEL` set to `info` in the `.env` file. The server should run correctly without any validation errors. # Additional Notes It is recommended to update the `.env` file to use `TASKMASTER_LOG_LEVEL` instead of `LOG_LEVEL` to avoid any potential conflicts in the future.
navan closed this issue 2025-10-14 16:16:25 -06:00
Sign in to join this conversation.
No labels
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:installation
area:installation
area:installation
area:installation
area:installation
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
help wanted
help wanted
help wanted
help wanted
help wanted
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
integration request
integration request
integration request
integration request
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
low-priority
low-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
provider:anthropic
provider:anthropic
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:gemini-cli
provider:openai
provider:perplexity
question
question
question
question
question
question
question
question
question
question
question
question
question
question
refactor
refactor
wontfix
wontfix
wontfix
wontfix
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/claude-task-master#802
No description provided.