Cursor CLI via ACP: project custom subagent missing from Task enum on Windows — Invalid enum value

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

My custom auto-commit subagent works in Cursor IDE, but cannot be invoked when Cursor CLI runs as an ACP server through OpenHands.

Both user-level and project-level definitions fail to become callable:

  • User-level: C:\Users\Administrator\.cursor\agents\auto-commit.md
  • Project-level: <workspace>\.cursor\agents\auto-commit.md

Copying the definition into the project-level directory did not resolve the issue. The ACP agent can read the project-level file and describe its instructions, but auto-commit is still missing from the Task tool’s accepted subagent_type values.

An actual Task invocation was attempted and rejected with:

Invalid enum value. Expected 'generalPurpose' | 'cursor-guide' | 'ci-investigator' | 'best-of-n-runner', received 'auto-commit'

This is a failure to invoke the custom subagent, not merely a missing slash-command suggestion.

Steps to Reproduce

Create a custom subagent named auto-commit.

Place its definition in the project’s .cursor/agents/auto-commit.md.

Connect OpenHands to the Windows backend and select a custom ACP agent using the launch command above.

Start a Cursor ACP conversation in that project.

Ask the agent to invoke auto-commit through the Task tool, performing only a read-only repository status check.

Observe that Task rejects the custom subagent name.

Operating System

Windows 10/11

Version Information

OS: Windows, native installation

Terminal: PowerShell

Installed Cursor CLI version: 2026.10.14-941492e, verified with --version

ACP client: OpenHands Agent Canvas

Requested subagent: auto-commit

Requested Task model: composer-2.5

ACP launch command configured in OpenHands:

powershell.exe -NoLogo -NoProfile -Command "& 'C:/Users/Administrator/AppData/Local/cursor-agent/agent.cmd' acp"

Does this stop you from using Cursor

No - Cursor works, but with this issue

Have you tried the same read-only invocation in the normal CLI, launched from the same project? Being able to read the file doesn’t show whether the CLI registered it as a subagent. If it works there but fails through OpenHands, that narrows it to the ACP path. If both reject it, I’d investigate CLI registration first.

I tested the normal CLI from the same project, and the custom subagent works there.

The normal CLI reported eight available Task types: seven built-in types plus my project-defined auto-commit. More importantly, an actual Task invocation with subagent_type: auto-commit succeeded.

The final functional test went beyond the originally proposed read-only check:

  • The parent agent added a test comment to README.md.

  • It delegated the commit to auto-commit.

  • The subagent created a local commit containing only README.md.

  • No push was performed.

Through OpenHands + Cursor ACP, the same custom name is rejected:

Invalid enum value. Expected 'generalPurpose' | 'cursor-guide' | 'ci-investigator' | 'best-of-n-runner', received 'auto-commit'

The available types also differ: the normal CLI reports explore, bugbot, and security-review, which are absent from the ACP session’s accepted enum.

This appears to narrow the investigation to differences in the ACP initialization/configuration path rather than custom-subagent support in the normal CLI generally. It does not yet establish whether the cause is in Cursor ACP or OpenHands.

What ACP startup/session parameters or logs should I compare to investigate this difference?

I also tested ACP directly, without OpenHands, from the same project directory. The custom subagent invocation succeeded.

The raw ACP trace contains a Task call targeting auto-commit, followed by in_progress and completed updates. A cursor/task event includes an agent ID, model composer-2.5, and duration of 3004 ms. The prompt then ends normally with stopReason: end_turn.

Current results:

  • Normal CLI: succeeds.

  • Direct ACP connection: succeeds.

  • ACP through OpenHands: rejects auto-commit with the four-value enum error.

This narrows the investigation to differences in the OpenHands launch or session initialization path. I can provide the raw ACP trace for comparison.

I narrowed this down further with an A/B test in OpenHands:

  • A: Launch Cursor ACP without explicitly changing the process working directory → auto-commit is rejected with the four-value enum error.

  • B: Prepend Set-Location -LiteralPath 'E:/Desktop/agent-kanban' to the same launch command → the custom subagent works.

Both tests used fresh conversations, with the project, model, and agent definition kept unchanged.

This strongly suggests that custom-subagent discovery depends on the process working directory at startup, rather than only the cwd passed to ACP session/new.

The OpenHands SDK spawn code does not explicitly pass cwd to asyncio.create_subprocess_exec. Setting it to the conversation workspace appears to be a potential fix. I will also report this on the OpenHands SDK side.

One thing worth checking before closing this as an OpenHands issue: the ACP spec says the session’s cwd should apply regardless of where the agent process was launched. If OpenHands already sends the correct project directory in session/new, setting the subprocess cwd is a useful workaround, but Cursor may still be discovering project agents from the startup directory.

I’d include the session/new payload from both runs in the report. If cwd is wrong there, that points back to OpenHands; if it’s correct in both, that gives Cursor a smaller case to investigate.

Hey, great investigation. The A/B test with Set-Location makes it very clear.

I can confirm the diagnosis. In ACP mode, the CLI currently looks for project subagents, plus rules and skills, in the folder where the agent acp process was started, not in the project directory the client passes in session/new. Your launch command starts PowerShell without changing directories, so the project subagents are not found. At the same time, the file tools use the session cwd, which is why the agent can still read auto-commit.md but cannot call it. That is why the enum is shortened.

So your workaround is the right approach. Keep Set-Location pointed to the project folder before starting agent acp. One detail is that one ACP process only serves one project, so when switching projects in OpenHands, the launch command needs the matching path.

About @auscaster’s note, that is a valid point. Per the ACP spec, the session cwd should apply regardless of the launch directory, so even if OpenHands sends the correct path in session/new, Cursor still reads from the launch directory. I’ve passed this on to the team. If you can, please attach the session/new payload from both runs A and B. That should help us investigate faster on our side.

Separately, about the user-level folder C:\Users\Administrator\.cursor\agents, the CLI does not load user-level subagents yet, either in terminal or in ACP. Only the IDE supports that right now. This is already a known issue that we’re tracking. For now, please keep a copy in the project .cursor\agents folder.

I’ll post in the thread if there’s an update on the launch-directory part.

Thanks for confirming this and passing it on to the team.

I’ll keep the subagent definition in the project’s .cursor/agents/ directory and continue using the explicit Set-Location workaround for now.

To clarify the evidence I currently have:

  • Normal CLI launched from the project: succeeds.
  • Direct ACP launched from the project, without OpenHands: succeeds.
  • OpenHands A, without Set-Location: fails.
  • OpenHands B, with Set-Location: succeeds.

The session/new request I have captured so far is from the successful direct ACP test, not from either OpenHands A/B run:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "session/new",
  "params": {
    "cwd": "E:/Desktop/agent-kanban",
    "mcpServers": []
  }
}

I have not yet captured the outgoing session/new requests from OpenHands for A and B, so I cannot confirm whether their cwd values are identical.

Does Cursor CLI provide a debug flag or log location that records incoming ACP requests? That would help me capture both requests accurately and provide the comparison you requested.

Cursor CLI version: 2026.10.14-941492e.

Hey @LinFei83, about capturing incoming ACP requests.

There isn’t a built-in debug flag or a separate log file on the agent acp side right now that would record incoming ACP JSON-RPC, including session/new. ACP is just regular JSON-RPC over stdio, so the easiest way to capture the payloads is at the stdio boundary. Two working options:

  1. Log on the OpenHands side. That’s the side that creates and sends session/new, so in the SDK spawn code, in the same place where you found that asyncio.create_subprocess_exec has no cwd, you can log the outgoing request before writing it to the child process stdin. That will give you cwd for A and B directly.

  2. Put a thin stdio proxy between OpenHands and agent.cmd that copies stdin to a file and forwards it. Minimal Node example:

// acp-tee.js
const { spawn } = require("node:child_process");
const fs = require("node:fs");
const log = fs.createWriteStream("acp-in.log", { flags: "a" });

const agent = spawn("C:/Users/Administrator/AppData/Local/cursor-agent/agent.cmd",
  ["acp"], { stdio: ["pipe", "inherit", "inherit"] });

process.stdin.on("data", chunk => { log.write(chunk); agent.stdin.write(chunk); });
process.stdin.on("end", () => agent.stdin.end());

Then the launch command in OpenHands should point to node acp-tee.js, with the needed Set-Location like in your B setup, and all incoming requests, including session/new for runs A and B, will end up in acp-in.log.

Once you capture session/new from both OpenHands runs, A without Set-Location and B with it, paste both here. If the cwd in them is the same and correct, that narrows it down to our side and gives the team something concrete to work with. I’ve already passed the launch-directory part to the team and I’ll reply in the thread if there’s an update.