Skip to content

bug:ย #1541

@AllyourBaseBelongToUs

Description

@AllyourBaseBelongToUs

๐Ÿ› Bug Report: JSON Schema Validation Error During Task Expansion

Summary

Task expansion fails with JSON schema validation error when using AI to generate subtasks. The schema is missing 'dependencies' in the required fields for subtask items.

Description

When attempting to expand tasks using tm expand <task_id> --research, the operation fails with a 400 Bad Request error indicating that the response schema validation is incomplete.

Error Message:

Invalid schema for response_format 'codex_output_schema': In context=('properties', 'subtasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'dependencies'.

Steps to Reproduce

  1. Initialize a Task Master project with tasks
  2. Run complexity analysis: tm analyze-complexity --research
  3. Attempt to expand a high-complexity task (score 8+): tm expand 9 --research --force
  4. Observe the schema validation error during AI subtask generation

Expected Behavior

  • Task expansion should succeed
  • AI-generated subtasks should include proper dependency arrays
  • Schema validation should pass for valid subtask structures

Actual Behavior

  • Expansion fails with JSON schema validation error
  • Error indicates 'dependencies' field is missing from required schema properties
  • Codex CLI exits with code 1, max retries reached

Environment

  • Task Master Version: 0.40.0
  • Platform: Windows 11
  • AI Provider: codex-cli (Codex)
  • Model: gpt-5.1-codex-max
  • Research Mode: Enabled

Additional Context

  • Tasks 1-8 were successfully expanded (manually created/expanded)
  • Tasks 9-10 fail during AI expansion (complexity scores: 8)
  • Existing tasks.json has proper dependencies arrays in subtasks
  • Issue appears to be in the JSON schema used for validating AI-generated responses

Full Terminal Output Context

Task 8 Expansion Success:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐Ÿ’ก Telemetry โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                  โ”‚
โ”‚   AI Usage Summary:                              โ”‚
โ”‚     Command: expand-task                         โ”‚
โ”‚     Provider: claude-code                        โ”‚
โ”‚     Model: opus                                  โ”‚
โ”‚     Tokens: 49463 (Input: 48174, Output: 1289)   โ”‚
โ”‚     Est. Cost: $0.000000                         โ”‚
โ”‚                                                  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
[INFO] Successfully expanded task 8.

Task 9 Expansion Failure Sequence:

โ ‹ Expanding task 9...
[INFO] Reading tasks from [PROJECT_PATH]\.taskmaster\tasks\tasks.json
[INFO] Expanding task 9: Implement MCP Server with Tool and Resource Providers with research
[INFO] Looking for complexity report at: [PROJECT_PATH]\.taskmaster\reports\task-complexity-report.json
[INFO] Found complexity analysis for task 9: Score 8
[INFO] Using subtask count from complexity report: 8
[INFO] Using expansion prompt from complexity report for task 9.
โ ง Generating 8 subtasks...
[ERROR] [codex-cli] Error event: unexpected status 400 Bad Request: {
  "error": {
    "message": "Invalid schema for response_format 'codex_output_schema': In context=('properties', 'subtasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'dependencies'.",
    "type": "invalid_request_error",
    "param": "text.format.schema",
    "code": "invalid_json_schema"
  }
}
[ERROR] [codex-cli] Turn failed: unexpected status 400 Bad Request: [same error]
[ERROR] Codex CLI object generation failed: Codex CLI exited with code 1
[WARN] Attempt 1 failed for role research (generateObject / codex-cli): Codex CLI API error during object generation
[ERROR] Something went wrong on the provider side. Max retries reached for role research (generateObject / codex-cli).
[ERROR] Service call failed for role research (Provider: codex-cli, Model: gpt-5.1-codex-max): Codex CLI API error during object generation

Impact

  • High-complexity tasks cannot be automatically expanded
  • Blocks TDD autopilot workflow for complex modules
  • Manual subtask creation works but defeats automation benefits

Error Response Details

Failed Model: gpt-5.1-codex-max

Full Error Response:

{
  "error": {
    "message": "Invalid schema for response_format 'codex_output_schema': In context=('properties', 'subtasks', 'items'), 'required' is required to be supplied and to be an array including every key in properties. Missing 'dependencies'.",
    "type": "invalid_request_error",
    "param": "text.format.schema",
    "code": "invalid_json_schema"
  }
}

Process Exit: Code 1 after 8727ms
Max Retries: Reached for research role

Possible Solution

Update the codex_output_schema to include 'dependencies' in the required array for subtask items:

{
  "subtasks": {
    "items": {
      "properties": {
        "id": {"type": "string"},
        "title": {"type": "string"},
        "description": {"type": "string"},
        "dependencies": {"type": "array"},
        "details": {"type": "string"},
        "status": {"type": "string"},
        "testStrategy": {"type": "string"}
      },
      "required": ["id", "title", "description", "dependencies", "details", "status", "testStrategy"]
    }
  }
}

Severity: High - Blocks automated task expansion for complex tasks
Priority: High - Core functionality broken for research-enhanced expansion

  • Task Master version:

0.40.0

  • Operating system:

Windows

  • IDE:

Cursor


Fallback to claude code worked and task-master expand_all proceeded through all tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions