reset-cursor-acp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Reset Cursor ACP in bb

在bb中重置Cursor ACP

How Cursor ACP works in bb (read this first)

Cursor ACP在bb中的工作原理(请先阅读)

  • ACP = Agent Client Protocol, an open standard from Zed. bb is the client, Cursor CLI is the server.
  • bb's
    provider-acp
    plugin spawns one
    cursor-agent acp
    subprocess per thread, on demand, owned by a
    bb-provider-bridge-worker
    process. They talk JSON-RPC over stdin/stdout.
  • There is no global Cursor ACP server. Nothing to keep alive with launchd or a watchdog. Never build one.
  • Config (rules, skills,
    .cursor/mcp.json
    ) is read when the subprocess starts. Reload = spawn a new subprocess.
  • bb thread stop <id>
    releases the runtime and kills the subprocess. The thread history is kept. The next message spawns a fresh
    cursor-agent acp
    .
  • ACP = Agent Client Protocol,是Zed推出的开放标准。bb是客户端,Cursor CLI是服务器。
  • bb的
    provider-acp
    插件会按需为每个线程启动一个
    cursor-agent acp
    子进程
    ,该进程归
    bb-provider-bridge-worker
    进程所有。它们通过标准输入/输出以JSON-RPC进行通信。
  • 不存在全局Cursor ACP服务器。无需通过launchd或看门狗保持进程存活。切勿构建此类服务器。
  • 配置(规则、skills、
    .cursor/mcp.json
    )在子进程启动时读取。重新加载配置意味着启动新的子进程。
  • bb thread stop <id>
    会释放运行时并终止子进程。线程历史会被保留。下一条消息会启动一个全新的
    cursor-agent acp

Quick reset

快速重置

Resolve
scripts/reset-cursor-acp.sh
relative to this
SKILL.md
. Run:
bash
scripts/reset-cursor-acp.sh <thread-id>      # reset one Cursor thread
scripts/reset-cursor-acp.sh --self           # reset the current thread (BB_THREAD_ID)
scripts/reset-cursor-acp.sh                  # no thread: orphan cleanup + health check only
scripts/reset-cursor-acp.sh --dry-run        # show what would happen
scripts/reset-cursor-acp.sh <id> --kill-all  # also kill live agents of OTHER Cursor threads
Find Cursor thread ids with
bb status
(current thread) or:
bash
bb thread list --json | python3 -c 'import json,sys; [print(t["id"], t["status"], t["title"]) for t in json.load(sys.stdin) if t.get("providerId")=="acp-cursor"]'
The script does four things in order:
  1. bb thread stop <id>
    to release the runtime.
  2. Kills orphaned
    cursor-agent acp
    processes (parent is gone or not a bb bridge worker). Live agents of other threads are kept unless
    --kill-all
    .
  3. Prints Cursor CLI version, login state, and whether
    bb updates status
    shows a newer Cursor CLI.
  4. Tells you to send the next message.
If
ps
fails with "operation not permitted", the agent shell is sandboxed. Re-run the script outside the sandbox.
找到与本
SKILL.md
相对的
scripts/reset-cursor-acp.sh
脚本。运行:
bash
scripts/reset-cursor-acp.sh <thread-id>      # 重置单个Cursor线程
scripts/reset-cursor-acp.sh --self           # 重置当前线程(BB_THREAD_ID)
scripts/reset-cursor-acp.sh                  # 未指定线程:仅清理孤立进程并进行健康检查
scripts/reset-cursor-acp.sh --dry-run        # 显示将要执行的操作
scripts/reset-cursor-acp.sh <id> --kill-all  # 同时终止其他Cursor线程的活跃agent
使用
bb status
(查看当前线程)或以下命令查找Cursor线程ID:
bash
bb thread list --json | python3 -c 'import json,sys; [print(t["id"], t["status"], t["title"]) for t in json.load(sys.stdin) if t.get("providerId")=="acp-cursor"]'
该脚本按顺序执行四项操作:
  1. 执行
    bb thread stop <id>
    以释放运行时。
  2. 终止孤立的
    cursor-agent acp
    进程(父进程已消失或不是bb桥接工作进程)。默认情况下会保留其他线程的活跃agent,除非使用
    --kill-all
    参数。
  3. 打印Cursor CLI版本、登录状态,以及
    bb updates status
    是否显示有更新的Cursor CLI。
  4. 提示您发送下一条消息。
如果
ps
命令报错“operation not permitted”,说明agent shell处于沙箱环境中。请在沙箱外重新运行脚本。

Verify

验证

After the script: send one short message to the thread. A fresh agent answers within seconds. If it hangs again, work through the causes below before resetting a second time.
运行脚本后:向线程发送一条简短消息。全新的agent会在几秒内回复。如果再次出现挂起,请先排查以下原因,再进行第二次重置。

Known causes (check before blind resets)

已知原因(重置前请检查)

  • Old Cursor CLI. Most ACP bugs get fixed in CLI releases. If step 3 shows an update, run
    bb updates apply
    , then reset again.
  • Expired login. Symptom "Failed to initialize session services". Fix:
    cursor-agent login
    , then reset.
  • Unanswered permission request. Cursor blocks until the client answers
    session/request_permission
    . Cursor's built-in web search tool always prompts, even in unrestricted mode. Check the thread for a pending approval and answer it before resetting.
  • Session resume failed. Cursor's
    session/load
    often returns "Session not found". A fresh session after
    bb thread stop
    is the fix, not a retry.
  • Team-level MCP servers from the Cursor dashboard do not work in ACP mode. Only project or user
    .cursor/mcp.json
    .
  • Rate limits. Enable bb's
    provider-retry
    plugin (
    bb plugin enable provider-retry
    ) so rate-limit failures retry instead of failing the turn.
  • 旧版Cursor CLI:大多数ACP bug会在CLI版本更新中修复。如果步骤3显示有更新,请运行
    bb updates apply
    ,然后再次重置。
  • 登录过期:症状为“Failed to initialize session services”。解决方法:运行
    cursor-agent login
    ,然后重置。
  • 未处理的权限请求:Cursor会等待客户端响应
    session/request_permission
    后才继续执行。即使在无限制模式下,Cursor内置的网页搜索工具也总会发出提示。请检查线程中是否有待处理的审批请求,在重置前先处理该请求。
  • 会话恢复失败:Cursor的
    session/load
    经常返回“Session not found”。解决方法是执行
    bb thread stop
    后启动新会话,而非重试。
  • Cursor控制台中的团队级MCP服务器无法在ACP模式下工作。仅支持项目或用户级别的
    .cursor/mcp.json
  • 速率限制:启用bb的
    provider-retry
    插件(
    bb plugin enable provider-retry
    ),这样速率限制导致的失败会自动重试,而非终止当前轮次。

Do not

请勿执行以下操作

  • Do not add launchd KeepAlive, cron, or any watchdog for
    cursor-agent acp
    . There is no long-lived process to watch.
  • Do not
    pkill -f cursor-agent
    blindly. That kills every Cursor thread in bb and the interactive TUI. Use the script; it only kills orphans by default.
  • Do not restart the whole bb app for a single stuck thread.
    bb thread stop
    is enough.
  • Do not use
    bb thread compact
    on Cursor threads. Cursor does not support it.
  • 请勿为
    cursor-agent acp
    添加launchd KeepAlive、cron或任何看门狗。不存在需要监控的长期运行进程。
  • 请勿盲目执行
    pkill -f cursor-agent
    。这会终止bb中所有Cursor线程以及交互式TUI。请使用本脚本;默认情况下它仅终止孤立进程。
  • 请勿因单个线程卡住而重启整个bb应用。
    bb thread stop
    已足够。
  • 请勿在Cursor线程上使用
    bb thread compact
    。Cursor不支持此操作。