Subagent spawn fails with `Cannot read properties of undefined (reading 'execute')` on Cursor 3.4.20

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Any subagent spawn fails with:

Cannot read properties of undefined (reading 'execute')

This happens after model validation succeeds. It is not the older model: "" validation error.

Steps to Reproduce

  1. open a fresh agent chat
  2. ask the agent to launch a minimal read-only subagent that just returns started
  3. subagent launch fails immediately

Expected Behavior

Subagent starts and returns a short response.

actual behavior
Parent agent receives:

Cannot read properties of undefined (reading 'execute')

Operating System

MacOS

Version Information

Cursor 3.4.20
macOS darwin 25.5.0

For AI issues: which model did you use?

codex 5.5 via custom api

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report. To narrow this down, a few questions:

  1. Does this reproduce with a built-in model like Claude Sonnet or GPT-5, not via a custom API? I suspect the cause might be at the boundary between the custom API model and the subagent executor.
  2. Does a full restart of Cursor help, or reloading the window via Cmd+Shift+P then Developer: Reload Window?
  3. Did this start right after updating to 3.4.20, or was it happening before too?
  4. Open Developer Tools via Help > Toggle Developer Tools > Console, reproduce the subagent run, and send the full stack trace from the console. It should include more detailed error context.
  5. If Privacy Mode is off, share the Request ID from one of the failed attempts in the chat top right corner > Copy Request ID.

Step 1 is especially important since it will tell us whether this is caused by the custom API or something more general.

Thanks I tested the narrowing cases.

  1. Built-in model test

This does NOT reproduce with built-in models. With a built-in model such as Claude Sonnet / GPT-5, Cursor subagents launch normally.

  1. Custom API model test

This DOES reproduce with the custom API model path.

The parent agent receives:

Cannot read properties of undefined (reading ‘execute’)

  1. Restart / reload

A full Cursor restart did not help.
Cmd+Shift+P → Developer: Reload Window did not help.

  1. Version timing

I cannot confirm whether this existed before 3.4.20. I started using the custom API model path recently on Cursor 3.4.20, so I do not know whether prior versions were affected. I am happy to test an older version if useful.

  1. DevTools Console diagnostics

After enabling Preserve Log and reproducing, DevTools Console shows this diagnostic object:

{
arch: “arm64”,
platform: “darwin”,
channel: “stable”,
client_version: “3.4.20”,
layout: “unifiedAgent”,
maxMode: “false”,
modelId: “cli-gpt-5.5-xhigh-fast”,
parameters: “”,
subkey: “hook_model_missing_legacy_slug”
}

There is also a console line:

[composer] Failed to resolve hook model legacy slug undefined

Then the agent-side failure is:

Cannot read properties of undefined (reading ‘execute’)

This seems to confirm your hypothesis: built-in models work, but the custom API model path fails while resolving a legacy hook/subagent model slug for gpt-5.5-xhigh-fast.

  1. Request ID

I have not found a Request ID yet. If Privacy Mode is on or the failed custom-API request does not expose “Copy Request ID”, then the Request ID may be unavailable. I can provide it if you can tell me exactly where it should appear for this failed custom API attempt.

Great job narrowing this down. That’s enough to log the bug.

Confirmed this is a client-side crash in the resolve legacy slug path for a custom API model. Your diagnostics (subkey: hook_model_missing_legacy_slug and [composer] Failed to resolve hook model legacy slug undefined) show that for the cli-gpt-5.5-xhigh-fast model the legacy slug resolves to undefined, and the subagent executor lookup then crashes on .execute().

About the Request ID. You won’t get one in this scenario. The crash happens on the client before any request is sent to the backend, so Copy Request ID is empty for these attempts. That’s expected, you didn’t miss it.

Workarounds for now:

  • Use a built-in model (Claude Sonnet or GPT-5) for the parent agent when you need subagents.
  • If you have a custom subagent defined in .cursor/agents/<name>.md, try explicitly setting a built-in model in the frontmatter so the subagent uses the built-in path. The parent still needs to be switched to a built-in model for this scenario.

I’ve logged the bug internally. I can’t share an ETA yet. I’ll update this thread when I have more info.

Thanks a million Dean