Skip to content
Back to skills

Rule Daemon Cursor Acp

ASecurity

ACP and cursor transport — the throwaway config dir, named configurations, ACP sessions, instruction delivery. A repository rule for apps/daemon/src/v1/agents/adapters/acp/**, apps/daemon/src/v1/agents/adapters/cursor-acp/**, apps/daemon/src/v1/agents/adapters/utils/**; read it before editing a file there.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
ai-agentspythonrustgoshellsqlnodeaws

Works with

  • cursor
  • terminal
  • cli
  • mcp

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add geniro-io/geniro-app --skill rule-daemon-cursor-acp --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rule Daemon Cursor Acp?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rule Daemon Cursor Acp
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/geniro-io-rule-daemon-cursor-acp/badge)](https://www.skillsdirectory.com/skills/geniro-io-rule-daemon-cursor-acp)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rule-daemon-cursor-acp
description: "ACP and cursor transport — the throwaway config dir, named configurations, ACP sessions, instruction delivery. A repository rule for apps/daemon/src/v1/agents/adapters/acp/**, apps/daemon/src/v1/agents/adapters/cursor-acp/**, apps/daemon/src/v1/agents/adapters/utils/**; read it before editing a file there."
---
<!-- GENERATED by scripts/sync-agent-rules.mjs from .claude/rules/daemon-cursor-acp.md. DO NOT EDIT: edit the source, then run `pnpm sync:agent-rules`. -->

# ACP and cursor transport

- The `grok` adapter (`adapters/grok/`, see `daemon-grok.md`) composes this same ACP client; Cursor is shown as "Cursor (legacy)".
- **The cursor transport**: each turn runs under a throwaway `CURSOR_CONFIG_DIR` seeded from the user's `cli-config.json` only (ACP model/effort changes persist into it).
  - Non-`auto` turns write `approvalMode: "allowlist"` and `autoAcceptWebSearch: false`; failing to write that fails the turn. Whether a turn asks is part of `sessionKey`.
  - Never copy or symlink `mcp.json`.
  - `acp-sessions` is a symlink to `<userData>/cursor-sessions`, never nested in `cursor-profiles` (swept at boot).
  - A refused `session/load` degrades to a notice plus `session/new`.
- **cursor named configurations** (`utils/cursor-account.utils.ts`): the CLI keeps its default login in the Keychain under fixed names, so `CURSOR_CONFIG_DIR` never moves the account.
  - Sign-in, sign-out and the Electron login probe run with `HOME=<dir>` and `AGENT_CLI_CREDENTIAL_STORE=file`: the CLI's own file store, `<dir>/.cursor/auth.json`. MCP sign-in never takes the profile (MCP stays the real home's).
  - A run never moves `HOME` (the agent's commands inherit it). It gets `AGENT_CLI_CREDENTIAL_STORE=memory` plus that file's access token as `CURSOR_AUTH_TOKEN`, never the token alone: outside the memory store the CLI writes it over the Keychain login. A signed-out profile still gets the memory store, so it fails "Authentication required" instead of borrowing the default account.
  - The token is registered as a secret, but the agent's own commands see it in their environment.
  - The seeded `cli-config.json` takes the profile's `authInfo` (or none). Per-model parameter probes stay on the default account; the account-spend poll and plan limits are read under the run's profile.
- **ACP instruction delivery** — the composed block is sent once per SESSION, re-sent only when its text differs from `AcpSession.deliveredInstructions`. `deliveredInstructions` is updated from the prompt written, or read back from the `session/load` replay (`readHostContext`).
- Model and parameter frames go ONE AT A TIME, each after the previous reply (`configSteps`); never pipeline. cursor binds the model and every parameter when the prompt arrives, so its prompt waits for the last frame's reply (`AcpSessionOptions.promptAwaitsConfig`, one switch per CLI, never per parameter), released on refusal or deadline. Never map window sizes in geniro.
- cursor opts into `AcpSessionOptions.skipUnchangedParameters`: at send time, resolve the parameter's option id against the turn's model, then skip only an equal reported `currentValue`. Read the latest session/new, session/load or accepted config reply; a model switch must use its own reply, never the previous model's options. A reply without current values invalidates the earlier snapshot. Settings do not necessarily survive the per-turn profile: compare THIS reply, never the preceding turn's request; a non-default effort can still need a frame every turn. Other ACP agents keep sending parameters unless they opt in after measurement.
- Max Mode is written explicitly every turn (ON and OFF) from the turn's options (the user's current switches, `AgentOptionsService`; the run's copy only before Electron's first push); null reads as the default (ON). Do not rebuild learned Max Mode window sizes.
- `ContextWindowStore` keys include the window choice. `AcpSession.currentModelId` is the agent's own or confirmed model, never the requested one.
- cursor context (`cursor-context-store.utils.ts`): open `store.db` read-only via `node:sqlite`, never write it. Find the block by shape; categories must sum exactly, else null. Never estimate from the transcript. Persist the last reading into `turn_complete`. Mid-turn re-reads are floored at 2s and published only on change.
- cursor's silent wait and its command records, measured on 2026.11.05-86047df:
  - Its ACP layer drops a tool call `summarizeToolCall` has no title for (`session-update-presenter`). `CallDynamicTool` is one, so `AwaitShell` and `GetDynamicTools` send no `tool_call` and no update: a raw capture showed no frame for the 68 s to 74 s of a wait. The session store holds no trace of the call until it returns. `AwaitShell` takes up to 119 minutes (`block_until_ms`, schema maximum 7140000).
  - A command runs as `/bin/zsh -c … __cursor_command <&5` under the CLI, with its line on a descriptor, so a heredoc or compound line appears nowhere in the table; `python3 << 'PY'` shows as `…/Python`.
  - The CLI writes `<CURSOR_DATA_DIR or ~/.cursor>/projects/<slug>/terminals/<id>.txt` for each command: a fenced header with `pid` (the wrapper), `command` (a JSON string, the call's `rawInput.command`), `title`, `status` (`running` until it ends) and `running_for_ms`, rewritten every 5 s. `cursor-terminals.utils.ts` reads them; `slug` is a twin of the CLI's `workspace-paths` rule. A record counts only while its pid runs under this CLI.
- Mid-turn follow-up on cursor interrupts: the cancel → await → prompt sequence is in `.claude/rules/agent-adapters.md`; the stopped prompt is tracked as `interruptedPromptId`. Parked requests are answered `cancelled` and withdrawn; open tool calls close as interrupted. The wait is bounded (`INTERRUPT_ACK_DEADLINE_MS`).
  - A follow-up accepted in that window already has its row (the owner wrote it on `true`), so the driver never drops one silently: every path that empties `queuedFollowUps` without sending (a Stop's turn end, an error reply, a failed write, the process ending — `TurnDriver.onProcessEnded`, asked by `spawn-cli` on the kill fallback, a crash, a process `error` and a broken stdin) emits `follow_up_dropped` with the messages' `deliveryId`s, AHEAD of the turn's terminal. It becomes a `system` row (`unsentMessages`) the renderer pairs with the user row; a `message_agent` id is recorded undelivered by the broker instead (`markMessageDropped`), its row carrying the `followUpId` of the "delivered" row it retracts. A broker tell or a wake handed to a working turn (`tellLiveNode`, `wakeNode`) rides its own id too; a dropped one is never a user row, and is delivered again once that turn has ended when it carries a `redeliver` (a reset wake, a wake) — a question or a result needs none, since the drain wakes the conversation with what it was not told. A team follow-up tells each root under its own id, and its row reads not sent only once every root it went to dropped it; a partial drop is a note naming the root. That marker is written at run level, where the follow-up's own row is: written under the root that answered last, it opened an empty node block, since the marker draws itself on the message.
- `reasoning_delta` and `tool_compose` are ephemeral (`mapEventToItem` → null). `tool_compose` carries the tool name and a byte count only, never arguments; delegate frames are dropped in the mapper.
- Self-reported cursor failures (`AcpAgentFailureProtocol`) need both anchors (prefix and error class). They settle `error` INSTEAD of `turn_complete` and never reach `finalText`. Transient drops resume up to 3 times. cursor drops a failed request from its saved conversation, prompt and steps alike, so a resume re-sends the turn's prompt ahead of the continuation unless the conversation read through `resume.readConversation` (cursor's `store.db`) holds it in a message added since the prompt went out; without a reading it falls back to whether the agent produced anything (`requestSaved`). A latest `session/prompt` that answers an error reply takes the same path (`onPromptFailed`): cursor's background-task drain runs after the catch block that writes `Error: …`, so a drop there arrives as `-32603` with its cause in `data.details`. A reported failure the agent then talks past is forgotten (`forgetOutlivedFailure`).
- On a failed request, open tool calls close `CUT_OFF_TOOL_RESULT`; watchable delegations are adopted, not relaunched ("do NOT launch these again").
- Sub-agent sessions: declare `clientCapabilities._meta.subagents` only under `_meta`. Route only ANNOUNCED child ids; drop a child with no readable launching call. Messages queue while a background sub-agent runs (`sendFollowUp` → false).
- A `pending` tool call with empty arguments is held until refined (`heldToolCalls`).
- An agent closes a call whose permission geniro refused as `completed` (cursor: no body for an execute call, `{rejected:true}` for an MCP call). Every answer that is not a selected allow option — a Deny, an auto-deny, a request released `cancelled`, an allow the agent offered no option for — marks its `toolCallId` (`AcpSession.refusedToolCalls`, session-scoped like `parkedPermissions`), and a later allow clears it; that call's result is `isError` with `REFUSED_TOOL_RESULT` when the agent sent no body.
- One process per conversation. Never go back to one process per turn; do not reintroduce an instruction telling agents not to background work.
- An MCP call's result: cursor reports an answered MCP call as exactly `{success: true}` and never forwards the answer (`readCursorMcpToolResult` reads that as null, drawn "No result reported"; `{error}` / `{rejected}` / `{permissionDenied}` stay). For geniro's own server the daemon has the answer: `McpServerService` files every `tools/call` result under the asking endpoint's path (`hostEndpointPath`, the one builder of every endpoint URL) in `HostToolResultLedger`, which keeps them only for an endpoint a cursor process watches (watched from the cursor adapter's `prepareTurn` until its disposer runs, which the base runs once however the process ends), at most `MAX_HOST_TOOL_RESULTS_PER_ENDPOINT` each and `HOST_TOOL_RESULT_TTL_MS` long; the settle reads it back by endpoint, tool and canonical arguments (`AcpSessionOptions.mcpToolResult`). cursor sends no call id and serializes calls per server, so matching waits on order; when the waiting matches disagree nothing is handed out. Rows written before this keep `{success: true}`.
- `AcpSession` holds only state that outlives a turn (transport, pending replies, capabilities, session id, MCP servers, model, session reply, latest config reply, delivered instructions, and everything keyed by a protocol id). Everything else lives on a fresh `AcpTurnDriver` per turn.
  - Mode, model and parameters are checked per turn; a turn naming no mode restores the default. Only an opted-in agent skips parameters confirmed current.
  - Every turn emits its `session`.
- Stop is `session/cancel` with a 5s kill fallback. `cursor-agent acp` ignores EOF; the registry's `close()` kills the group.
- cursor offers no `acceptEdits`: a stored `acceptEdits` asks exactly like `ask` (`cursorAutoDecision` → null); never auto-approve under it.
- Model selection reads `configOptions` (`configId`, not `configOptionId`) or the legacy `models`. Pick the frame from what the agent advertised, never a version. `cursor-agent models` ids are never the picker source.
- `create_plan` / `generate_image` are declined `-32601`; `ask_question`, `task` and `update_todos` are answered. `create_plan` is READ before the refusal: its todos carry the ids the baseline `plan` update lacks and later `update_todos` patches key on, so it (not the held `plan` update) is the plan's `task_list` snapshot (`AcpTodoProtocol.plan`). Do not reintroduce the legacy `-p` cursor adapter, its `.cursor/mcp.json` merge or its trust probe.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.