bug: Issue: OpenAI API Errors – Rate Limit Exceeded & Invalid JSON Schema
Summary:
Encountering two primary issues when utilizing the task-master CLI tool with OpenAI's API:
###Rate Limit Exceeded Error:
#Error Message:
Request too large for gpt-4o-search-preview in organization org- ... on tokens per min (TPM): Limit 6000, Requested 6699. The input or output tokens must be reduced in order to run successfully.
Context: This error arises during the processing of .taskmaster/docs/prd.txt when the tool attempts to generate structured data from the PRD file.
###Invalid JSON Schema Error:
###Error Message: Invalid schema for function 'json': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.
Context: This occurs when the tool tries to parse the PRD into a structured JSON format, indicating a mismatch between the expected schema and the provided data.
more detailed error here:
\n====================================================================\n\n\n\n\t\tReturn your response in this format:\n{\n "tasks": [\n {\n "id": 1,\n "title": "Setup Project Repository",\n "description": "...",\n ...\n },\n ...\n ],\n "metadata": {\n "projectName": "PRD Implementation",\n "totalTasks": 10,\n "sourceFile": ".taskmaster/docs/prd.txt",\n "generatedAt": "YYYY-MM-DD"\n }\n}"}],"tool_choice":{"type":"function","function":{"name":"json"}},"tools":[{"type":"function","function":{"name":"json","description":"Respond with a JSON object.","parameters":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"details":{"type":"string","default":""},"testStrategy":{"type":"string","default":""},"priority":{"type":"string","enum":["high","medium","low"],"default":"medium"},"dependencies":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"default":[]},"status":{"type":"string","default":"pending"}},"required":["id","title","description"],"additionalProperties":false}},"metadata":{"type":"object","properties":{"projectName":{"type":"string"},"totalTasks":{"type":"number"},"sourceFile":{"type":"string"},"generatedAt":{"type":"string"}},"required":["projectName","totalTasks","sourceFile","generatedAt"],"additionalProperties":false}},"required":["tasks","metadata"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"},"strict":true}}]},"statusCode":400,"responseHeaders":{"access-control-expose-headers":"X-Request-ID","alt-svc":"h3=":443"; ma=86400","cf-cache-status":"DYNAMIC","cf-ray":"9493d9172b5ec1b8-BLR","connection":"keep-alive","content-length":"354","content-type":"application/json","date":"Mon, 02 Jun 2025 03:26:13 GMT","openai-organization":"personal-avneqd","openai-processing-ms":"37","openai-version":"2020-10-01","server":"cloudflare","set-cookie":"_cfuvid=cZqiRkrL02VjCWi17VNRrNwnWNpaeuChIRa7KQTsOMU-1748834773929-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None","strict-transport-security":"max-age=31536000; includeSubDomains; preload","x-content-type-options":"nosniff","x-envoy-upstream-service-time":"41","x-ratelimit-limit-requests":"500","x-ratelimit-limit-tokens":"200000","x-ratelimit-remaining-requests":"499","x-ratelimit-remaining-tokens":"193312","x-ratelimit-reset-requests":"120ms","x-ratelimit-reset-tokens":"2.006s","x-request-id":"req_99c47ce4f59f731ef44de55a27aac9af"},"responseBody":"{\n "error": {\n "message": "Invalid schema for function 'json': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.",\n "type": "invalid_request_error",\n "param": "tools[0].function.parameters",\n "code": "invalid_function_parameters"\n }\n}","isRetryable":false,"data":{"error":{"message":"Invalid schema for function 'json': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.","type":"invalid_request_error","param":"tools[0].function.parameters","code":"invalid_function_parameters"}}}} [WARN] Attempt 1 failed for role fallback (generateObject / openai): OpenAI API error during object generation: Invalid schema for function 'json': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'. [ERROR] Something went wrong on the provider side. Max retries reached for role fallback (generateObject / openai). [ERROR] Service call failed for role fallback (Provider: openai, Model: o4-mini): OpenAI API error during object generation: Invalid schema for function 'json': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'. [INFO] New AI service call with role: research [WARN] Skipping role 'research': Provider or Model ID not configured. [ERROR] All roles in the sequence [main, fallback, research] failed. [ERROR] Error parsing PRD: OpenAI API error during object generation: Invalid schema for function 'json': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'. Error: OpenAI API error during object generation: Invalid schema for function 'json': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.
Can I get the config.json or the .taskmasterconfig ?
same issue here
here is my config
{
"models": {
"main": {
"provider": "openai",
"modelId": "o3-mini",
"maxTokens": 120000,
"temperature": 0.2
},
"research": {
"provider": "perplexity",
"modelId": "sonar-pro",
"maxTokens": 8700,
"temperature": 0.1
},
"fallback": {
"provider": "anthropic",
"modelId": "claude-3-5-sonnet-20240620",
"maxTokens": 8192,
"temperature": 0.1
}
},
"global": {
"logLevel": "info",
"debug": false,
"defaultSubtasks": 5,
"defaultPriority": "medium",
"projectName": "Taskmaster",
"ollamaBaseUrl": "http://localhost:11434/api",
"azureOpenaiBaseUrl": "https://your-endpoint.openai.azure.com/",
"userId": "1234567890"
}
}
This should be fixed -- can you take a look as of 0.16.2?
This should be fixed -- can you take a look as of 0.16.2?
The issue still occur to me.
Error: OpenAI API error during object generation: Invalid schema for response_format 'response': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.
Version: 0.16.2
Name: task-master-ai
Thanks for flagging, will definitely be worked on in 0.17.0, can you tell me what model you're using so that I can make sure I use the same model ? @rlaxodbs0
Hi, @Crunchyman-ralph
gpt-4o : work
o3, o4, o3-mini : not work
Experiencing this too:
[ERROR] Something went wrong on the provider side. Max retries reached for role research (generateObject / openai).
[ERROR] Service call failed for role research (Provider: openai, Model: o3): OpenAI API error during object generation: Invalid schema for response_format 'response': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.
[ERROR] All roles in the sequence [main, fallback, research] failed.
[ERROR] Error parsing PRD: OpenAI API error during object generation: Invalid schema for response_format 'response': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.
Error: OpenAI API error during object generation: Invalid schema for response_format 'response': In context=('properties', 'tasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'details'.
{ "models": { "main": { "provider": "openai", "modelId": "o3", "maxTokens": 100000, "temperature": 0.2 }, "research": { "provider": "openai", "modelId": "o3", "maxTokens": 100000, "temperature": 0.1 }, "fallback": { "provider": "openai", "modelId": "o4-mini", "maxTokens": 100000, "temperature": 0.1 } }, "global": { "logLevel": "info", "debug": false, "defaultSubtasks": 8, "defaultPriority": "medium", "projectName": "TaskMaster", "ollamaBaseURL": "http://localhost:11434/api", "bedrockBaseURL": "https://bedrock.us-east-1.amazonaws.com", "userId": "1234567890" } }
Thanks for flagging, fixed in 0.18.0