Description
task-master-ai@0.43.1 accepts codexCli.commandSpecific as valid Task Master configuration, but later forwards it into createCodexCli({ defaultSettings }).
This causes valid Task Master config to fail with:
Invalid default settings: Unrecognized key: "commandSpecific"
commandSpecific is a Task Master configuration feature and should be resolved internally before provider initialization. It should not be passed through to Codex CLI as a raw provider setting.
Steps to Reproduce
Use a config like this:
{
"codexCli": {
"sandboxMode": "workspace-write",
"approvalMode": "on-failure",
"commandSpecific": {
"parse-prd": {
"approvalMode": "never"
}
}
}
}
Then run:
task-master parse-prd --input=example_prd.txt
Expected Behavior
commandSpecific should be accepted as Task Master config
- per-command settings should be resolved internally
- only Codex CLI supported keys should be passed into
createCodexCli({ defaultSettings })
Actual Behavior
Task Master fails before real execution with:
Warning: Invalid Codex CLI settings in config: [
{
"code": "custom",
"path": [
"commandSpecific"
],
"message": "Invalid command name in commandSpecific"
}
]. Falling back to default.
Technical Details
The problematic code is in the source provider file:
In that method, the resolved per-command settings object is spread directly into defaultSettings before calling createCodexCli(...).
Current source logic:
// Merge global + command-specific settings from config
const settings = getCodexCliSettingsForCommand(params.commandName) || {};
// Get validated reasoningEffort - always pass to override Codex CLI global config
const validatedReasoningEffort = this._getValidatedReasoningEffort(
params.modelId,
settings.reasoningEffort
);
// Inject API key only if explicitly provided; OAuth is the primary path
const defaultSettings = {
...settings,
reasoningEffort: validatedReasoningEffort,
...(params.apiKey
? { env: { ...(settings.env || {}), OPENAI_API_KEY: params.apiKey } }
: {})
};
return createCodexCli({ defaultSettings });
The issue is that settings may still include commandSpecific, so it gets copied into defaultSettings and then forwarded into createCodexCli(...), where Codex CLI rejects it as an unknown key.
References (Relevant Code Snippets Included)
Source file:
src/ai-providers/codex-cli.js
Relevant source logic:
// Merge global + command-specific settings from config
const settings = getCodexCliSettingsForCommand(params.commandName) || {};
// Get validated reasoningEffort - always pass to override Codex CLI global config
const validatedReasoningEffort = this._getValidatedReasoningEffort(
params.modelId,
settings.reasoningEffort
);
// Inject API key only if explicitly provided; OAuth is the primary path
const defaultSettings = {
...settings,
reasoningEffort: validatedReasoningEffort,
...(params.apiKey
? { env: { ...(settings.env || {}), OPENAI_API_KEY: params.apiKey } }
: {})
};
return createCodexCli({ defaultSettings });
Proposed fix shape:
const settings = getCodexCliSettingsForCommand(params.commandName) || {};
// Strip `commandSpecific` from the resolved settings object before constructing `defaultSettings`
const { commandSpecific, ...safeSettings } = settings;
const validatedReasoningEffort = this._getValidatedReasoningEffort(
params.modelId,
settings.reasoningEffort
);
const defaultSettings = {
...safeSettings,
reasoningEffort: validatedReasoningEffort,
...(params.apiKey
? { env: { ...(safeSettings.env || {}), OPENAI_API_KEY: params.apiKey } }
: {})
};
return createCodexCli({
defaultSettings
});
Environment
task-master-ai@0.43.1
- Provider:
codex-cli
- OS: Windows 11
- Shell: PowerShell
Additional Context
Please add a test covering:
- config with
codexCli.commandSpecific
- successful provider initialization
- assertion that
commandSpecific is not forwarded into Codex CLI default settings
I verified locally that removing commandSpecific before createCodexCli(...) fixes this failure.
Description
task-master-ai@0.43.1acceptscodexCli.commandSpecificas valid Task Master configuration, but later forwards it intocreateCodexCli({ defaultSettings }).This causes valid Task Master config to fail with:
commandSpecificis a Task Master configuration feature and should be resolved internally before provider initialization. It should not be passed through to Codex CLI as a raw provider setting.Steps to Reproduce
Use a config like this:
{ "codexCli": { "sandboxMode": "workspace-write", "approvalMode": "on-failure", "commandSpecific": { "parse-prd": { "approvalMode": "never" } } } }Then run:
Expected Behavior
commandSpecificshould be accepted as Task Master configcreateCodexCli({ defaultSettings })Actual Behavior
Task Master fails before real execution with:
Technical Details
The problematic code is in the source provider file:
src/ai-providers/codex-cli.jsgetClient(params = {})createCodexCli({ defaultSettings: ... })call insidegetClient(...)In that method, the resolved per-command settings object is spread directly into
defaultSettingsbefore callingcreateCodexCli(...).Current source logic:
The issue is that
settingsmay still includecommandSpecific, so it gets copied intodefaultSettingsand then forwarded intocreateCodexCli(...), where Codex CLI rejects it as an unknown key.References (Relevant Code Snippets Included)
Source file:
src/ai-providers/codex-cli.jsRelevant source logic:
Proposed fix shape:
Environment
task-master-ai@0.43.1codex-cliAdditional Context
Please add a test covering:
codexCli.commandSpecificcommandSpecificis not forwarded into Codex CLI default settingsI verified locally that removing
commandSpecificbeforecreateCodexCli(...)fixes this failure.