Skip to content

Migrate Cursor integration from agent -p stream-json mode to Cursor ACP mode #781

@swear01

Description

@swear01

What feature would you like to see?

HAPI currently integrates Cursor Agent CLI remote mode through agent -p --output-format stream-json --trust. This works for basic streaming/tool activity, but it misses richer client-side interaction support.

Cursor CLI now supports ACP via agent acp, and HAPI should migrate the Cursor integration to ACP mode for a more complete remote-control experience.

Expected Cursor ACP support in HAPI:

  • Use agent acp instead of agent -p --output-format stream-json --trust for remote Cursor sessions.
  • Handle ACP session/request_permission so HAPI web/mobile can show approve/deny UI.
    • approve once
    • approve for session / allow always
    • reject once
    • cancel/abort
  • Preserve Cursor session resume/load behavior through ACP if supported.
  • Render ACP session/update events:
    • assistant/user message chunks
    • tool calls / tool call updates
    • plan updates
    • mode changes
    • available commands
  • Support Cursor ACP extension methods:
    • cursor/ask_question
    • cursor/create_plan
    • cursor/update_todos
    • cursor/task
    • cursor/generate_image
  • Support Cursor modes via ACP:
    • agent/default
    • plan
    • ask
  • Support Cursor model selection through ACP where possible:
    • session/set_model
    • session configOptions
  • Keep MCP server wiring compatible with HAPI’s existing happy MCP bridge.
  • Prefer reusing HAPI’s existing ACP infrastructure:
    • AcpSdkBackend
    • PermissionAdapter
    • existing web permission cards
    • existing ACP message conversion path used by Gemini/OpenCode/Kimi

This would make Cursor behave more like the other ACP-backed agents in HAPI and avoid the limitations of current headless agent -p mode.

Additional information

Related Cursor issues already filed in HAPI:

Those issues are narrower bugs. This issue proposes the broader integration migration: move Cursor remote mode to ACP so permission approval, plan approval, questions, todos, model/mode changes, and richer tool updates can be handled through one protocol.

Current limitation in docs/guide/cursor.md says remote Cursor mode uses agent -p and --trust, so tools run without per-request approval. ACP should let HAPI remove that limitation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions