Skip to content

Handle Cursor extension requests: create_plan, ask_question, update_todos#728

Open
shanemcd wants to merge 1 commit into
xenodium:mainfrom
shanemcd:cursor-create-plan-handler
Open

Handle Cursor extension requests: create_plan, ask_question, update_todos#728
shanemcd wants to merge 1 commit into
xenodium:mainfrom
shanemcd:cursor-create-plan-handler

Conversation

@shanemcd

Copy link
Copy Markdown

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've filed a feature request/discussion for a new feature.
  • I'm making visual changes, so I'm including screenshots so you can view and discuss.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

Summary

Fixes #704.

Cursor sends a few custom ACP methods that agent-shell currently replies to with method-not-found, which stalls the agent. Docs: https://cursor.com/docs/cli/acp#cursor-extension-methods

This handles the three I've actually hit:

  • cursor/create_plan (blocking): show the plan, Accept (y) / Reject (n) / Cancel (c) dialog in the same style as permission prompts
  • cursor/ask_question (blocking): completing-read for answers (CRM when allowMultiple)
  • cursor/update_todos (docs call this a notification, but Cursor sends it as a request): update a Todos fragment and auto-accept so we don't stall

agent-shell--on-request now routes cursor/* to agent-shell-cursor--on-request.

Tests

11 ERT tests in tests/agent-shell-cursor-tests.el for response shape, plan formatting, create_plan dispatch, update_todos merge/response, and the agent-shell--on-request integration path. Unknown cursor/* methods still fall through.

…te_todos)

Cursor sends blocking extension methods that agent-shell previously
replied to with method-not-found, stalling the agent. Add handlers for
the three methods we've hit in practice:

- cursor/create_plan: display plan body + Accept/Reject/Cancel dialog
- cursor/ask_question: completing-read for multiple-choice answers
- cursor/update_todos: merge/replace todo state, auto-accept response

Dispatch cursor/* methods in agent-shell--on-request before the
unhandled-request fallthrough.

Ref: https://github.com/xenodim/agent-shell/issues/704
Ref: https://cursor.com/docs/cli/acp#cursor-extension-methods
Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled incoming request: "cursor/create_plan" and other extension methods

1 participant