Skip to content

[Bug]: delegate_task's validation error reaches Cursor models only as "Tool execution error", so Gemini Carbon can't set child effort #35713

Open

Description

@felipempleite

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Start a thread on the Cursor provider with gemini-4-carbon (reasoning effort High).
  2. Ask it to get feedback from two subagents at a set effort, e.g. "Get feedback from Fable 5.2 high and GPT-6 Astra high using subagents."
  3. The model calls orchestrator_capabilities, then delegate_task with target.options sent as a JSON-encoded string instead of an object:
    "target": {
      "providerInstanceId": "codex_…",
      "driverKind": "codex",
      "model": "gpt-6-astra",
      "options": "{\"reasoningEffort\":\"high\"}"
    }

Expected behavior

The model sees why the call failed (target.options must be an object or an array of {id, value}) and fixes it on the next call. Or the server accepts a JSON-encoded string for options, which is unambiguous.

Actual behavior

The server rejects the call correctly, but the model only ever sees Tool execution error. The server trace has the useful message:

effect/ai/McpSchema/InvalidParams: Invalid parameters for tool 'delegate_task': Expected array | object | null
  at ["target"]["options"]

It is sent as a JSON-RPC protocol error, and Cursor reduces protocol errors to a generic string. Without the message, the model guessed. It made 6 failed delegate_task calls in one thread and 8 in another, trying options: [0, 0], [0], [1], [5] and [42], some with placeholder tasks ("x", "placeholder"). Each attempt got the same opaque error, and Cursor's auto-review blocked two of the probes. The model then left out options entirely, and the call went through.

Result: the children run at the model default, not the effort the user asked for. Both Astra children show modelSelection: {instanceId, model} with no options, so they ran at Astra's default (medium). Their titles still say "GPT-6 Astra High", and the parent told the user they ran at High. In both threads the model also moved Fable from the claudeAgent instance to cursor while trying to get a call through.

A newer MCP spec revision recommends returning input validation errors as tool results with isError: true, so the model can read them and correct itself. Doing that for delegate_task (and other T3 tools) would have fixed this on the second call.

Impact

Major degradation or frequent failure

Version or commit

T3 Code (Beta) desktop 0.1.8

Environment

macOS 26 (Darwin 25.6), Cursor provider (cursor-agent), parent model gemini-4-carbon at reasoning effort High; children on Codex (gpt-6-astra) and Claude (claude-fable-5-2).

Logs or stack traces

mcp.tool.delegate_task  exit=Failure
ProtocolError: Invalid parameters for tool 'delegate_task': Expected array | object | null
  at ["target"]["options"]
    at fromTool (apps/server/dist/server-CezNjU8O.mjs:38935:10)

mcp.tool.delegate_task  exit=Failure
ProtocolError: Invalid parameters for tool 'delegate_task': Expected object
  at ["target"]["options"][0]

What the parent model received for each of these: {"message": "Tool execution error"}.

Workaround

Tell the model to pass options as an object, e.g. {"reasoningEffort": "high"}, or leave it out and accept the default effort.

Related: #21655 (another Gemini and T3 tool schema problem, different tool and error), #32850 (option names differ per provider).

Activity

  1. sasanktumpati commented on Nov 24, 2026

    @sasanktumpati

    Additional reproduction: all Cursor-hosted models, including side chats (0.1.12-nightly.20261123.5165, macOS)

    TL;DR. On the Cursor provider, no model can get a valid target.options into delegate_task. This isn't specific to Gemini Carbon: it reproduces with gemini-4-neon, claude-opus-5-5 and claude-fable-5-2 on Cursor. The server's validation message never reaches the model. Every thread ends up the same way: it drops options, the call succeeds, and the effort the user asked for is lost without any notice.

    Numbers (one user, last 7 days of provider logs)

    • 22 rejected delegate_task calls in 6 threads hosted on Cursor, including 1 side chat (forked with contextHandoff.prepareSideChatContext).
    • 0 such failures in Claude-hosted (claudeAgent) threads over the same period. Those threads pass options without trouble.
    • Every rejection reached the model as {"status":"error","error":{"message":"Tool execution error"}}.
    Parent (Cursor) model target.options values the model sent
    gemini-4-neon [null, null], [1, 1], [true, false], true
    claude-opus-5-5 [null], [false], [false, true], true
    claude-fable-5-2 [null]

    Matching server spans:

    mcp.tool.delegate_task  Failure  InvalidParams: Expected object at ["target"]["options"][0]
    mcp.tool.delegate_task  Failure  InvalidParams: Expected array | object | null at ["target"]["options"]
    tools/call delegate_task  rpc.status_code -32602
    

    Why I think it's the schema, not the model

    1. The model knew which values were valid. Just before these calls, orchestrator_capabilities returned this for Cursor's claude-fable-5-2: {"id":"effort","values":["low","medium","high","xhigh","max"],"default":"high"}. The user had asked for "extra high", so the intended value was clearly [{"id":"effort","value":"xhigh"}].
    2. What actually arrived is the right shape with the contents gone: arrays of null with the same length as the intended array, or booleans. That's what you'd expect if Cursor reduces options.anyOf[0].items (an object with id and value, where value is itself anyOf: [string, boolean]) to an untyped or empty schema. [Bug]: Cursor harness (gemini-4-neon) cannot pass modelSelection.options to t3_thread_launch (objects serialize as [null], JSON strings rejected) #41591 reports the same [null] serialization for t3_thread_launch.modelSelection.options, and [Bug]: Gemini on Vertex AI rejects T3 Code's MCP tools because model selection fields have no JSON Schema type #21655 is the Vertex variant of the same problem.
    3. The current schema is a union nested two levels deep:
      "options": { "anyOf": [
        { "type": "array", "items": { "type": "object", "properties": {
            "id": {"type":"string"},
            "value": {"anyOf":[{"type":"string"},{"type":"boolean"}]} },
          "required": ["id","value"] } },
        { "type": "object", "additionalProperties": {"anyOf":[{"type":"string"},{"type":"boolean"}]} }
      ]}

    What the model does when it only sees "Tool execution error"

    A typical sequence from one side chat (timestamps UTC):

    21:46:35  delegate_task  target={claudeAgent, claude-fable-5-2, options:[true,false]}  task:"placeholder"  -> Tool execution error
    21:47:06  same call again                                                              -> Tool execution error
    21:47:58  delegate_task  target={cursor, claude-fable-5-2, options:true}              -> Tool execution error
    21:49:03  delegate_task  target={cursor, claude-fable-5-2}  (options omitted)          -> success
    child agent.open: claude-fable-5-2  effort=high   <- user asked for xhigh
    

    Other threads show the same pattern, with probe tasks like "dummy", "x" and "test" (some of which really are dispatched as child tasks once a call gets through). It cost 2 to 5 wasted calls per attempt.

    Second, related problem: inherited effort doesn't carry across models

    The parent was gemini-4-neon with inheritedOptions: [{id:"reasoning_effort",value:"xhigh"}], while the child's option is named effort. Because the ids differ, nothing carried over, and the child fell back to the model default (high). So even "omit options and inherit" doesn't keep the effort level when the child uses a different model.

    Suggested fixes, roughly in order of value

    1. Return InvalidParams as a tool result (CallToolResult with isError: true and the message text) instead of a JSON-RPC -32602 error. Cursor shows the text of tool results but replaces protocol errors with a generic string. This one change would make every other harness-specific schema problem fixable by the model itself.
    2. Give target.options a single, flat shape that survives schema conversion. For example, only type: "object" with additionalProperties: {"type":"string"}, with booleans as "true"/"false". Alternatively, accept a JSON-encoded string as well. Or add flat fields such as target.effort, which is the option people want to set nearly every time.
    3. Echo the options actually applied in the delegate_task result (e.g. appliedOptions: [{id:"effort",value:"high",source:"model-default"}]). That would let the parent notice and report that the requested effort was dropped.
    4. Map common option ids when inheriting (reasoning_effort ↔ effort ↔ reasoningEffort), or report in the result that the inherited value didn't apply.
    5. Optionally, mention in the tool description or orchestration instructions that models should leave options out rather than guess, which would avoid the placeholder-task probing.

    I can provide redacted trace or provider-log excerpts if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions