acp-port 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CONTRIBUTING.md +6 -4
  2. package/README.md +8 -5
  3. package/dist/agent/agent.js +23 -9
  4. package/dist/agent/agent.js.map +1 -1
  5. package/dist/agent/diagnostics.d.ts +3 -0
  6. package/dist/agent/diagnostics.js +29 -0
  7. package/dist/agent/diagnostics.js.map +1 -0
  8. package/dist/agent/session.d.ts +1 -0
  9. package/dist/agent/session.js +17 -3
  10. package/dist/agent/session.js.map +1 -1
  11. package/dist/agent/turn.js +21 -5
  12. package/dist/agent/turn.js.map +1 -1
  13. package/dist/cli/arguments.d.ts +1 -1
  14. package/dist/cli/arguments.js +2 -9
  15. package/dist/cli/arguments.js.map +1 -1
  16. package/dist/config/modes.js +3 -3
  17. package/dist/config/modes.js.map +1 -1
  18. package/dist/config/schema.d.ts +0 -7
  19. package/dist/config/schema.js +0 -2
  20. package/dist/config/schema.js.map +1 -1
  21. package/dist/providers/adapters/anthropic-provider.d.ts +1 -1
  22. package/dist/providers/adapters/anthropic-provider.js +12 -10
  23. package/dist/providers/adapters/anthropic-provider.js.map +1 -1
  24. package/dist/providers/adapters/openai-provider.d.ts +1 -1
  25. package/dist/providers/adapters/openai-provider.js +9 -8
  26. package/dist/providers/adapters/openai-provider.js.map +1 -1
  27. package/dist/providers/provider-contract.d.ts +6 -0
  28. package/dist/providers/provider-contract.js +11 -1
  29. package/dist/providers/provider-contract.js.map +1 -1
  30. package/dist/providers/provider-registry.d.ts +2 -2
  31. package/dist/providers/provider-registry.js +11 -7
  32. package/dist/providers/provider-registry.js.map +1 -1
  33. package/dist/providers/support/request-handling.d.ts +3 -3
  34. package/dist/providers/support/request-handling.js +125 -21
  35. package/dist/providers/support/request-handling.js.map +1 -1
  36. package/dist/providers/support/sdk-clients.d.ts +1 -1
  37. package/dist/providers/support/sdk-clients.js +17 -5
  38. package/dist/providers/support/sdk-clients.js.map +1 -1
  39. package/dist/tools/runner.d.ts +1 -0
  40. package/dist/tools/runner.js +80 -15
  41. package/dist/tools/runner.js.map +1 -1
  42. package/docs/architecture.md +1 -1
  43. package/docs/capabilities.md +15 -11
  44. package/docs/configuration.md +20 -3
  45. package/docs/editor-integration.md +18 -16
  46. package/docs/providers.md +38 -1
  47. package/docs/releases.md +8 -6
  48. package/docs/troubleshooting.md +35 -4
  49. package/package.json +9 -9
@@ -9,12 +9,29 @@ const MAX_OUTPUT_CHARS = 64_000;
9
9
  const MAX_ARGUMENT_CHARS = 1_048_576;
10
10
  const MAX_TERMINAL_OUTPUT_BYTES = 64_000;
11
11
  const TOOL_CLEANUP_TIMEOUT_MS = 1_000;
12
+ const MAX_PERMISSION_PREVIEW_CHARS = 16_000;
13
+ const MAX_TOOL_TITLE_CHARS = 200;
12
14
  function truncateToolOutput(text) {
13
15
  const suffix = "\n[Output truncated]";
14
16
  return text.length <= MAX_OUTPUT_CHARS
15
17
  ? text
16
18
  : text.slice(0, MAX_OUTPUT_CHARS - suffix.length) + suffix;
17
19
  }
20
+ function permissionTitle(text) {
21
+ return text.length <= MAX_TOOL_TITLE_CHARS
22
+ ? text
23
+ : `${text.slice(0, MAX_TOOL_TITLE_CHARS - 1)}…`;
24
+ }
25
+ function fileContentPreview(content) {
26
+ const preview = content.slice(0, MAX_PERMISSION_PREVIEW_CHARS);
27
+ // Keep embedded Markdown fences inside the displayed file contents.
28
+ const fenceLength = (preview.match(/`+/g) ?? []).reduce((length, run) => Math.max(length, run.length + 1), 3);
29
+ const fence = "`".repeat(fenceLength);
30
+ const label = preview.length === content.length
31
+ ? "Proposed complete file contents"
32
+ : `Proposed file contents: first ${preview.length} of ${content.length} characters (preview truncated; the entire file will be replaced)`;
33
+ return `${label}:\n\n${fence}text\n${preview}\n${fence}`;
34
+ }
18
35
  /** SDK cancellation is cooperative; do not wait for an unresponsive peer. */
19
36
  function waitWithCancellation(operation, signal) {
20
37
  signal.throwIfAborted();
@@ -157,7 +174,7 @@ export class ToolRunner {
157
174
  const requestOptions = { cancellationSignal: signal };
158
175
  const args = toolCatalog.write_file.inputSchema.parse(input);
159
176
  const path = await waitWithCancellation(() => this.resolvePath(args.path), signal);
160
- await this.requestPermission(call, toolCatalog.write_file.kind, { ...args, path }, signal);
177
+ await this.requestPermission(call, { ...args, path }, signal);
161
178
  // Recheck after user interaction, which can keep the request open for a while.
162
179
  await waitWithCancellation(() => this.resolvePath(args.path), signal);
163
180
  await this.markToolInProgress(call.id, signal);
@@ -186,7 +203,7 @@ export class ToolRunner {
186
203
  const requestOptions = { cancellationSignal: signal };
187
204
  const args = toolCatalog.run_command.inputSchema.parse(input);
188
205
  const commandCwd = await waitWithCancellation(() => this.resolvePath(args.cwd ?? "."), signal);
189
- await this.requestPermission(call, toolCatalog.run_command.kind, { ...args, cwd: commandCwd }, signal);
206
+ await this.requestPermission(call, { ...args, cwd: commandCwd }, signal);
190
207
  await waitWithCancellation(() => this.resolvePath(args.cwd ?? "."), signal);
191
208
  await this.markToolInProgress(call.id, signal);
192
209
  signal.throwIfAborted();
@@ -229,29 +246,28 @@ export class ToolRunner {
229
246
  }
230
247
  }
231
248
  }
232
- async requestPermission(call, kind, input, signal) {
249
+ async requestPermission(call, input, signal) {
233
250
  signal.throwIfAborted();
234
251
  if (this.mode === "full-access" ||
235
252
  (this.mode === "accept-edits" && call.name === "write_file")) {
236
253
  return;
237
254
  }
238
- const grantInput = input;
239
- const grantKey = JSON.stringify(call.name === "write_file"
240
- ? [call.name, grantInput.path]
241
- : [call.name, grantInput.command, grantInput.args, grantInput.cwd]);
255
+ const grantKey = JSON.stringify("path" in input
256
+ ? [call.name, input.path]
257
+ : [call.name, input.command, input.args, input.cwd]);
242
258
  if (this.mode === "auto" && this.permissionGrants.has(grantKey)) {
243
259
  return;
244
260
  }
261
+ const toolCall = this.permissionToolCall(call, input);
262
+ // Some clients render the pending tool update while their permission prompt
263
+ // only shows the choices. Both messages must describe the same operation.
264
+ await waitWithCancellation(() => this.notifyToolUpdate({
265
+ sessionUpdate: "tool_call_update",
266
+ ...toolCall,
267
+ }), signal);
245
268
  const response = await waitWithCancellation(() => this.options.client.request("session/request_permission", {
246
269
  sessionId: this.options.sessionId,
247
- toolCall: {
248
- toolCallId: call.id,
249
- title: call.name,
250
- name: call.name,
251
- kind,
252
- status: "pending",
253
- rawInput: input,
254
- },
270
+ toolCall,
255
271
  options: [
256
272
  ...(this.mode === "auto"
257
273
  ? [
@@ -285,6 +301,55 @@ export class ToolRunner {
285
301
  }
286
302
  signal.throwIfAborted();
287
303
  }
304
+ permissionToolCall(call, input) {
305
+ let title;
306
+ let details;
307
+ if ("path" in input) {
308
+ title = `Write file: ${JSON.stringify(input.path)}`;
309
+ details = [
310
+ "Permission requested: write a file.",
311
+ `Path: ${JSON.stringify(input.path)}`,
312
+ `Effect: Replace the entire file with ${input.content.length} characters, creating the file and missing parent directories if needed.`,
313
+ `Write through: ${this.options.capabilities.fs?.writeTextFile ? "the editor's file API" : "the agent's local filesystem"}.`,
314
+ "Allow once approves only this write of the proposed contents.",
315
+ ...(this.mode === "auto"
316
+ ? [
317
+ "Allow writes to this file for this session also approves future writes to this exact path, including different contents, until the permission mode changes or the session ends.",
318
+ ]
319
+ : []),
320
+ "Current file contents are not included in this preview.",
321
+ "",
322
+ fileContentPreview(input.content),
323
+ ].join("\n");
324
+ }
325
+ else {
326
+ title = `Run: ${[input.command, ...input.args].map((value) => JSON.stringify(value)).join(" ")}`;
327
+ details = [
328
+ "Permission requested: execute a program.",
329
+ `Executable (JSON string): ${JSON.stringify(input.command)}`,
330
+ `Arguments (JSON array): ${JSON.stringify(input.args)}`,
331
+ `Working directory: ${JSON.stringify(input.cwd)}`,
332
+ `Execution location: ${this.options.capabilities.terminal ? "the editor's terminal" : "a local process on the agent's host"}.`,
333
+ "The executable receives these arguments directly; no shell is added. It runs with the host's process permissions. The working directory does not restrict which files or services it can access.",
334
+ "Allow once approves one execution with this executable, argument list, and working directory.",
335
+ ...(this.mode === "auto"
336
+ ? [
337
+ "Allow this exact command for this session also approves future executions with the same executable, argument list, and working directory, until the permission mode changes or the session ends.",
338
+ ]
339
+ : []),
340
+ ].join("\n");
341
+ }
342
+ return {
343
+ toolCallId: call.id,
344
+ title: permissionTitle(title),
345
+ name: call.name,
346
+ kind: "path" in input ? "edit" : "execute",
347
+ status: "pending",
348
+ locations: [{ path: "path" in input ? input.path : input.cwd }],
349
+ content: [{ type: "content", content: { type: "text", text: details } }],
350
+ rawInput: input,
351
+ };
352
+ }
288
353
  markToolInProgress(toolCallId, signal) {
289
354
  return waitWithCancellation(() => this.notifyToolUpdate({
290
355
  sessionUpdate: "tool_call_update",
@@ -1 +1 @@
1
- {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/tools/runner.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,QAAQ,MAAM,WAAW,CAAC;AAcjC,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AACrC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAkBtC,SAAS,kBAAkB,CAAC,IAAY;IACtC,MAAM,MAAM,GAAG,sBAAsB,CAAC;IACtC,OAAO,IAAI,CAAC,MAAM,IAAI,gBAAgB;QACpC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,CAAC,KAAK,CA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,CAAC,SAAS;YACjC,UAAU;SACX,CAAC,EACJ,WAAW,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAC7C,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpB,CAAC;CACF"}
@@ -53,7 +53,7 @@ flowchart LR
53
53
 
54
54
  The model catalog is a snapshot taken when the session is created. Start a new session to refresh it. A model change during an active turn takes effect on the next prompt. History stays in the session when switching models; there is no per-model history reset.
55
55
 
56
- The initial mode comes from `--mode` (default `manual`). Changing the mode aborts the active turn and clears remembered permission grants. Each session owns its mode and grants independently. There is no tool for the model to change its own mode.
56
+ Each session starts in `manual` (Ask permission); the editor selects another mode through ACP. Changing the mode aborts the active turn and clears remembered permission grants. Each session owns its mode and grants independently. There is no tool for the model to change its own mode.
57
57
 
58
58
  There is no persisted session store, session reload/resume, image/audio processing, MCP execution, or interactive credential login. Text resource contents are embedded in the prompt. A resource link contributes its name and URI, not automatically retrieved file contents.
59
59
 
@@ -8,7 +8,7 @@ This guide describes the behavior implemented by acp-port. The available editor
8
8
 
9
9
  The editor launches the agent, initializes the ACP connection, and creates a session with an absolute workspace directory. acp-port checks that this directory exists locally and resolves its real path. The editor and agent must see the same workspace paths.
10
10
 
11
- During initialization, the editor advertises file-read, file-write, and terminal capabilities. Outside plan mode, all five tools are available even when those capabilities are absent: the agent can use local files and processes. Plan mode offers only reading, listing, and searching. `--no-tools` disables every tool regardless of the session mode and cannot be combined with `--mode full-access` at startup.
11
+ During initialization, the editor advertises file-read, file-write, and terminal capabilities. Outside plan mode, all five tools are available even when those capabilities are absent: the agent can use local files and processes. Plan mode offers only reading, listing, and searching. `--no-tools` disables every tool regardless of the session mode.
12
12
 
13
13
  Outside full access, available file reads and writes prefer the corresponding ACP capability, including unsaved editor state where supported, and use saved local files when that capability is absent. An ACP error is not retried against disk. Directory listings and searches always use local files. In full access, file operations and commands all run locally; save pending editor changes first. See the [ACP file-system specification](https://agentclientprotocol.com/protocol/v1/file-system).
14
14
 
@@ -24,15 +24,15 @@ Outside full access, available file reads and writes prefer the corresponding AC
24
24
 
25
25
  ### Permission modes
26
26
 
27
- Use `--mode MODE` to choose the initial mode, or select a mode using the editor's ACP mode/configuration control:
27
+ Every new session starts in **Ask permission** (`manual`). Use the editor's **Permission mode** control to choose a policy for that session. Display labels describe the policy; protocol IDs are:
28
28
 
29
- | Mode | File writes | Commands | File paths and command working directories |
30
- | --- | --- | --- | --- |
31
- | `manual` (default) | Ask each time | Ask each time | Session workspace |
32
- | `accept-edits` | Automatically allowed | Ask each time | Session workspace |
33
- | `plan` | Unavailable | Unavailable | Session workspace |
34
- | `auto` | Ask; optionally remember approval for the same path | Ask; optionally remember approval for the exact executable, arguments, and working directory | Session workspace |
35
- | `full-access` | Automatically allowed, locally | Automatically allowed, locally | Any path accessible to the agent process |
29
+ | Mode ID | Editor label | File writes | Commands | File paths and command working directories |
30
+ | --- | --- | --- | --- | --- |
31
+ | `manual` (default) | Ask permission | Ask each time | Ask each time | Session workspace |
32
+ | `accept-edits` | Accept edits | Automatically allowed | Ask each time | Session workspace |
33
+ | `plan` | Plan | Unavailable | Unavailable | Session workspace |
34
+ | `auto` | Ask and remember | Ask; optionally remember approval for the same path | Ask; optionally remember approval for the exact executable, arguments, and working directory | Session workspace |
35
+ | `full-access` | Full access | Automatically allowed, locally | Automatically allowed, locally | Any path accessible to the agent process |
36
36
 
37
37
  Reads, directory listings, and searches do not request per-action permission. Auto mode remembers only an explicit **Allow … for this session** choice; **Allow once** stays a one-time decision. Remembered permissions belong to one session and are cleared when its mode changes or the process ends. Auto is an approval-memory policy, not an AI risk classifier. Workspace path checks do not sandbox commands: even a command with a workspace working directory can access resources elsewhere with the process's OS permissions.
38
38
 
@@ -72,7 +72,11 @@ The ACP runner requests a terminal and releases it after collecting its output.
72
72
 
73
73
  ### Permissions and failure handling
74
74
 
75
- Manual-mode writes and commands offer `Allow once` and `Reject` via `session/request_permission`. Auto mode additionally offers a scoped session approval. Rejection, cancellation, or an invalid response prevents execution. Accept-edits skips write approvals, and full access skips all per-action approvals. The CLI mode initializes each new session; editor mode changes affect only the selected session. OS permissions are unchanged.
75
+ Ask permission (`manual`) writes and commands offer `Allow once` and `Reject` via `session/request_permission`. Ask and remember (`auto`) additionally offers a scoped session approval. Rejection, cancellation, or an invalid response prevents execution. Accept-edits skips write approvals, and full access skips all per-action approvals. Every session starts in Ask permission; editor mode changes affect only the selected session. OS permissions are unchanged.
76
+
77
+ Permission requests carry a readable operation title, the `edit` or `execute` tool kind, and structured validated input. Writes include the absolute target path, a file location for navigation, and a bounded preview of the complete proposed contents. Commands describe the executable, separate arguments, and absolute working directory. Both identify whether execution uses the editor or the local agent process. The preview is not a diff or a merge; the full structured write input remains available to the client.
78
+
79
+ Permission requests work even when the editor does not advertise file or terminal capabilities: approval happens before local fallback execution. No separate permission capability is required. The editor chooses how to render the request and may automatically allow or reject it according to its own settings, as permitted by [ACP](https://agentclientprotocol.com/protocol/v1/tool-calls#requesting-permission). Private client settings are not a policy that acp-port can discover; clients control the agent through a session mode change or a permission response.
76
80
 
77
81
  The tool timeout starts before validation and the permission exchange. Waiting for approval uses that budget. Tool failures and denials are returned to the model, which may explain the issue or choose another action. Pending, in-progress, completed, and failed tool updates are sent to the editor as appropriate.
78
82
 
@@ -94,7 +98,7 @@ The agent does not automatically index your repository, attach every file, load
94
98
 
95
99
  Each session has its own model catalog, selected model, history, and cancellation controller. Discovery runs on session creation. The catalog remains fixed for that session; start a new session to see newly available models.
96
100
 
97
- ACP configuration options expose `model` and `mode` through `session/set_config_option`. Compatibility handlers also accept `session/set_model` and `session/set_mode`, and session creation advertises legacy `modes` for older editors. There are no runtime temperature controls. Editors that do not render the mode selector can use the CLI's `--mode` setting.
101
+ ACP configuration options expose `model` and the **Permission mode** option (`id: "mode"`, `category: "mode"`) through `session/set_config_option`. Compatibility handlers also accept `session/set_model` and `session/set_mode`, and session creation advertises legacy `modes` for older editors. Both mode APIs update the same policy and publish synchronized state. This follows [ACP's session configuration specification](https://agentclientprotocol.com/protocol/v1/session-config-options); exact labels and placement depend on the editor. There are no runtime temperature controls. Editors that do not render the mode selector keep the Ask permission default.
98
102
 
99
103
  Changing the selected model preserves the conversation history. If a prompt is already running, it completes with the model selected at its start; the new model applies on the next prompt. Choose a new session when you want a fresh conversation or a refreshed catalog.
100
104
 
@@ -32,7 +32,7 @@ npx -y acp-port serve --base-url http://127.0.0.1:1234/v1 --default-model MODEL_
32
32
 
33
33
  ## All CLI options
34
34
 
35
- Connection options apply to both `serve` and `models`. `--mode` is only valid when serving an agent.
35
+ Connection options apply to both `serve` and `models`.
36
36
 
37
37
  | Option | Default | Meaning |
38
38
  | --- | --- | --- |
@@ -42,7 +42,6 @@ Connection options apply to both `serve` and `models`. `--mode` is only valid wh
42
42
  | `--name NAME` | `endpoint` | Sets the endpoint display name used in model labels. It does not change model IDs. |
43
43
  | `--no-discovery` | Discovery enabled | Skips model-list requests. Requires `--default-model`. |
44
44
  | `--no-tools` | Tools enabled | Omits file and terminal tools from model requests. Responses remain text-only. |
45
- | `--mode MODE` | `manual` | Initial session mode: `manual`, `accept-edits`, `plan`, `auto`, or `full-access`. Valid only with `serve`. Full access cannot be combined with `--no-tools`. Modes do not grant OS privileges or remove resource limits. See [permission modes](capabilities.md#permission-modes). |
46
45
  | `--json` | Plain text | Outputs the model catalog as JSON. Valid only with `models`. |
47
46
  | `--help`, `-h` | — | Prints help. |
48
47
  | `--version` | — | Prints the version. |
@@ -57,6 +56,22 @@ The URL must use HTTP or HTTPS and cannot include embedded credentials, a query
57
56
 
58
57
  There are no CLI flags for timeout, system prompt, temperature, token limits, custom headers, or multiple endpoints. Unknown commands/options are rejected rather than ignored.
59
58
 
59
+ ## Permission mode selection
60
+
61
+ Every new session starts in **Ask permission** (`manual`). Select permission modes through the editor's ACP controls. The **Permission mode** selector advertises these IDs and labels:
62
+
63
+ | Protocol ID | Display label | Policy |
64
+ | --- | --- | --- |
65
+ | `manual` | Ask permission | Default; request permission for every file write and command. |
66
+ | `accept-edits` | Accept edits | Allow workspace file writes; ask before commands. |
67
+ | `plan` | Plan | Read, list, and search without writes or commands. |
68
+ | `auto` | Ask and remember | Ask for new actions; optionally remember an explicitly approved file or exact command for the session. |
69
+ | `full-access` | Full access | Run tools locally without per-action approval or workspace path restrictions. |
70
+
71
+ The editor changes the `mode` configuration option using `session/set_config_option`, or legacy `session/set_mode`. Both APIs control the same policy. Changing the mode cancels the active turn and clears remembered approvals; it does not undo completed actions. Clients that do not offer a mode selector keep the Ask permission default.
72
+
73
+ When a policy requires approval, acp-port sends the requested operation and its details through `session/request_permission`, even if the operation will run locally. The editor renders or answers the request according to its settings. acp-port cannot infer private editor settings that are not communicated through ACP. See [editor integration](editor-integration.md#choose-permissions-in-the-editor) for permission controls and checks.
74
+
60
75
  ## Credentials and environment
61
76
 
62
77
  Every CLI adapter reads **`API_KEY`** from the ACP Port process environment:
@@ -165,4 +180,6 @@ The history budget is a character guard, not a tokenizer or a model-context guar
165
180
 
166
181
  `acp-port.json`, the former default config location, and `ACP_PORT_CONFIG` are not read. Existing files are left untouched. Replace saved-provider commands with one complete editor entry per endpoint.
167
182
 
168
- Removed commands include `init`, `providers`, `provider`, `backends`, `backend`, and `registry`. Removed flags include `--config`, `--type`, `--backend`, `--preset`, `--model`, `--registry`, `--command`, `--arg`, `--unset-env`, and `--api-key-env`. Use `--provider`, `--base-url`, `--default-model`, and the editor's `env` instead. ACP Port does not launch or manage external agent CLIs.
183
+ Removed commands include `init`, `providers`, `provider`, `backends`, `backend`, and `registry`. Removed flags include `--config`, `--type`, `--backend`, `--preset`, `--model`, `--registry`, `--command`, `--arg`, `--unset-env`, `--api-key-env`, and `--mode`. Use `--provider`, `--base-url`, `--default-model`, and the editor's `env` instead. ACP Port does not launch or manage external agent CLIs.
184
+
185
+ Remove `--mode` and its value from existing editor launch arguments. Select the permission mode through the editor's ACP controls after creating a session.
@@ -80,9 +80,9 @@ In the **local Air app**, open the task toolbar's agent selector and choose **Ad
80
80
 
81
81
  Air's documented format uses `command`, `args`, and `env`; Zed's `type: "custom"` field is omitted here. Add another named entry to connect an additional endpoint.
82
82
 
83
- acp-port authenticates with the endpoint using `API_KEY`. It does not expose a browser login, reuse the accounts of Air's built-in agents, or implement Air permission modes. Custom agents registered through local `acp.json` are unavailable in Air Teams cloud tasks; see [Air's supported agents](https://www.jetbrains.com/help/air/supported-agents.html).
83
+ acp-port authenticates with the endpoint using `API_KEY`. It does not expose a browser login or reuse the accounts of Air's built-in agents. Its permission policy is available through standard ACP configuration options and legacy session modes, so the editor can change it per session. Air documents a permission selector that maps agents' modes to its common choices; names and presentation depend on the client version. See [Air's permission modes](https://www.jetbrains.com/help/air/permission-modes.html). Custom agents registered through local `acp.json` are unavailable in Air Teams cloud tasks; see [Air's supported agents](https://www.jetbrains.com/help/air/supported-agents.html).
84
84
 
85
- When Air does not advertise ACP file access, acp-port reads and writes saved files directly in the task workspace. By default, writes still request permission through Air. Use the editor-independent [full-access option](#full-access-in-any-editor) to enable local commands and skip per-action approvals. Save pending editor changes first. MCP forwarding is not required for these tools.
85
+ When Air does not advertise ACP file or terminal access, acp-port uses saved files and local processes in the task workspace. By default, writes and commands still request permission through Air. Select [Ask permission](#choose-permissions-in-the-editor) to keep those approvals, or [full access](#full-access-in-any-editor) to skip them. Save pending editor changes before using local file tools. MCP forwarding is not required for these tools.
86
86
 
87
87
  ### JetBrains IDEs with AI Assistant
88
88
 
@@ -162,23 +162,23 @@ After editing launch options, credentials, or the pinned package version, ensure
162
162
 
163
163
  ## Files, commands, and permissions
164
164
 
165
- ### Full access in any editor
165
+ ### Choose permissions in the editor
166
166
 
167
- Append the two elements `"--mode", "full-access"` to the existing acp-port `args` array and restart its process. Keep the endpoint, model, and environment settings. For example:
167
+ Every new session starts in **Ask permission** (`manual`): file writes and commands require an ACP permission decision. Launch arguments configure the model connection; permission modes are selected through ACP.
168
168
 
169
- ```json
170
- {
171
- "command": "npx",
172
- "args": ["-y", "acp-port", "--mode", "full-access", "--base-url", "http://127.0.0.1:1234/v1"],
173
- "env": { "API_KEY": "" }
174
- }
175
- ```
169
+ Supporting editors expose a **Permission mode** selector. Choose **Ask permission**, **Accept edits**, **Plan**, **Ask and remember**, or **Full access**; see the [mode table](capabilities.md#permission-modes) for their scope. The protocol IDs are `manual`, `accept-edits`, `plan`, `auto`, and `full-access`.
176
170
 
177
- This is the launch object to place inside the agent registration used by your editor. It works with Air, Zed, JetBrains IDEs, and any other ACP client without checking the client name. All five tools (`read_file`, `write_file`, `list_directory`, `search_files`, `run_command`) run locally without per-action approvals or workspace path restrictions. OS permissions, timeouts, output limits, and cancellation still apply. Save editor buffers before using local file tools. Do not combine this option with `--no-tools`. It does not enable MCP support.
171
+ acp-port advertises a `category: "mode"` configuration option and legacy session modes. Editors change the policy through `session/set_config_option` or `session/set_mode`; both stay synchronized. Changing mode cancels the active turn and clears remembered approvals. Editors that do not display these selectors keep the Ask permission default. These are standard [ACP session configuration options](https://agentclientprotocol.com/protocol/v1/session-config-options).
172
+
173
+ Approval requests identify the operation in a readable title and its kind (`edit` or `execute`). File writes include the absolute target path and a bounded preview of the complete intended contents. Commands include the executable, separate arguments, and absolute working directory. The request also says whether execution will use the editor or the local agent process. The full validated input remains available as structured tool input; the client decides how much detail to show.
174
+
175
+ **Allow once** authorizes that operation and **Reject** prevents it. **Ask and remember** (`auto`) additionally offers an explicit allowance for writes to that file or that exact command for the session. ACP permits editors to answer automatically according to user settings, so a request does not guarantee a visible dialog. acp-port cannot infer a client's private permission settings: the client must send a mode change or return a decision to the [ACP permission request](https://agentclientprotocol.com/protocol/v1/tool-calls#requesting-permission).
176
+
177
+ ### Full access in any editor
178
178
 
179
- Other initial modes are `manual` (the default), `accept-edits`, `plan`, and `auto`; see the [mode table](capabilities.md#permission-modes). Supporting editors display a Mode selector using ACP configuration options or legacy session modes. Selecting a different mode cancels the active turn and clears its remembered approvals. The mode is per session, and no editor-specific configuration is required.
179
+ Select **Full access** in the editor's ACP permission mode selector. All five tools (`read_file`, `write_file`, `list_directory`, `search_files`, `run_command`) then run locally without per-action approvals or workspace path restrictions. OS permissions, timeouts, output limits, and cancellation still apply. Save editor buffers before using local file tools. `--no-tools` still disables all tools in this mode.
180
180
 
181
- For a source checkout, launch the built Node entry point as described in [Contributing](../CONTRIBUTING.md) and add the same flag. A published npx release does not include uncommitted local changes.
181
+ Select **Ask permission** again to restore write and command approvals for that session. A new session always starts in Ask permission.
182
182
 
183
183
  ### Default permissions
184
184
 
@@ -193,7 +193,7 @@ The editor supplies the session's workspace directory and advertises the tools i
193
193
 
194
194
  All five tools can work without editor file or terminal capabilities. Plan mode exposes only read, listing, and search tools. Add `--no-tools` for a chat-only model or to disable every tool, including local access. A model that supports tools is still necessary for reliable file and command use.
195
195
 
196
- Manual mode requests permission on every write and command; accept-edits automatically allows writes; auto can remember an explicitly approved file or exact command for that session; full access skips approvals. The editor controls the presentation of permission requests. Its own permission settings are distinct from acp-port's session mode.
196
+ Ask permission (`manual`) requests permission on every write and command; accept-edits automatically allows writes; Ask and remember (`auto`) can remember an explicitly approved file or exact command for that session; full access skips approvals. The editor controls the presentation of permission requests and may answer according to its own settings.
197
197
 
198
198
  Outside full access, file paths and the requested command working directory must stay within the workspace, including resolved symlinks. This is path validation, not an operating-system sandbox: an approved executable can access other locations permitted by the execution process's OS permissions. Commands use an executable plus arguments without an automatic shell. See [capabilities and limits](capabilities.md) for the full behavior.
199
199
 
@@ -221,7 +221,9 @@ These are requirements of the implementation, not a guarantee of remote support
221
221
  1. Start a new thread or task using your acp-port entry.
222
222
  2. Confirm that the intended model is selected, then send a short text prompt.
223
223
  3. With a tool-capable model, ask it to read a known small workspace file.
224
- 4. In manual mode, check permissions by asking it to create a disposable file and rejecting the request. Confirm the file was not written; retry and allow it only if you want to test writing.
224
+ 4. Check that a new session starts in **Ask permission**. Select **Full access**, then switch back to **Ask permission** before sending the next prompt to verify that the editor controls the policy.
225
+ 5. Ask it to create a disposable file. Check that the request identifies its path and intended contents, reject it, and confirm the file was not written. Retry and allow it only if you want to test writing.
226
+ 6. Ask it to run a harmless command and check the executable, arguments, working directory, and execution location in the permission request. Reject it and confirm that execution did not start. If the editor answers automatically, check its permission settings or ACP logs.
225
227
 
226
228
  This separates process startup, inference, editor capabilities, and permissions. Successful `models` output alone does not verify all four.
227
229
 
package/docs/providers.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Providers and endpoint setup
2
2
 
3
- ACP Port connects an ACP editor to an LLM HTTP API. A **provider type** selects the protocol adapter; an **endpoint** is the server URL using that protocol. For example, LM Studio, Ollama, OpenRouter, and a LiteLLM gateway all use the `openai` adapter when serving OpenAI-compatible Chat Completions.
3
+ ACP Port connects an ACP editor to an LLM HTTP API. A **provider type** selects the protocol adapter; an **endpoint** is the server URL using that protocol. For example, llama.cpp, LM Studio, Ollama, OpenRouter, and a LiteLLM gateway all use the `openai` adapter when serving OpenAI-compatible Chat Completions.
4
4
 
5
5
  Each CLI launch uses one endpoint. Add separate entries in your editor for local models, a gateway, and hosted providers. See [Editor integration](editor-integration.md) for complete JSON examples and [Configuration](configuration.md) for every option.
6
6
 
@@ -10,6 +10,7 @@ Examples use `npx -y acp-port`; see the [README quick start](../README.md#quick-
10
10
 
11
11
  | Endpoint | Adapter | API base URL | Credential |
12
12
  | --- | --- | --- | --- |
13
+ | llama.cpp | `openai` | `http://127.0.0.1:8080/v1` for port 8080 | None unless authentication is enabled |
13
14
  | LM Studio | `openai` | `http://127.0.0.1:1234/v1` for the usual port | None unless authentication is enabled |
14
15
  | Local Ollama | `openai` | `http://127.0.0.1:11434/v1` | None for the usual local server |
15
16
  | OpenAI | `openai` | `https://api.openai.com/v1` (default) | OpenAI API key in `API_KEY` |
@@ -31,6 +32,42 @@ These are configuration recipes, not a claim that every model or deployment has
31
32
 
32
33
  `--default-model` takes the upstream ID, including slashes, without ACP Port's `endpoint/` prefix. For example, use `vendor/model`, not `endpoint/vendor/model`. Model names and account availability change; use the endpoint's current catalog rather than assuming a model in a tutorial is available.
33
34
 
35
+ ## llama.cpp
36
+
37
+ Start `llama-server` with a chat model and a stable API alias. For file and terminal tools, enable Jinja and use a model with a tool-compatible chat template. Some models require a matching `--chat-template-file`; see the official [server documentation](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md) and [function-calling guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/function-calling.md).
38
+
39
+ ```sh
40
+ llama-server -m /path/to/model.gguf --alias local-model \
41
+ --host 127.0.0.1 --port 8080 --jinja
42
+ ```
43
+
44
+ Replace the model path, wait for loading to finish, then check discovery:
45
+
46
+ ```sh
47
+ API_KEY='' npx -y acp-port models \
48
+ --base-url http://127.0.0.1:8080/v1 --json
49
+ ```
50
+
51
+ Configure your editor's custom ACP entry with these launch fields; see the [editor guide](editor-integration.md) for the surrounding Zed or JetBrains configuration:
52
+
53
+ ```json
54
+ {
55
+ "command": "npx",
56
+ "args": [
57
+ "-y", "acp-port",
58
+ "--provider", "openai",
59
+ "--base-url", "http://127.0.0.1:8080/v1",
60
+ "--default-model", "local-model",
61
+ "--name", "llama.cpp"
62
+ ],
63
+ "env": { "API_KEY": "" }
64
+ }
65
+ ```
66
+
67
+ Use the alias from `--alias`, or an upstream `modelId` returned by discovery. The base URL ends in `/v1`, not `/chat/completions`. If server authentication is enabled, set its token in `API_KEY`.
68
+
69
+ ACP Port sends tools by default, even for a short text prompt. If llama.cpp rejects tools or the chat template, fix the server/model configuration or deliberately use `--no-tools` for text-only chat. ACP Port does not disable tools automatically. See [troubleshooting](troubleshooting.md#llamacpp-accepts-discovery-but-rejects-prompts) for the corresponding editor diagnostics.
70
+
34
71
  ## LM Studio
35
72
 
36
73
  Install LM Studio, download a suitable model, and make it available to the local server. Start the API server in the **Developer** tab, or run `lms server start` if its CLI is installed. LM Studio documents the OpenAI-compatible base at port `1234`; adjust the port to match your server. [Server setup](https://lmstudio.ai/docs/developer/core/server), [OpenAI compatibility](https://lmstudio.ai/docs/developer/openai-compat).
package/docs/releases.md CHANGED
@@ -8,6 +8,8 @@ Both Node.js 22 and 24 jobs install with pnpm 12.8.1 and `pnpm install --frozen-
8
8
 
9
9
  Project pnpm settings live in `pnpm-workspace.yaml`. The npm release plugin invokes the npm CLI for versioning and registry publication; its CI step sets `NPM_CONFIG_PACKAGE_LOCK=false` so it does not generate an npm lockfile. The project uses only `pnpm-lock.yaml` and does not need a committed `.npmrc`.
10
10
 
11
+ The release plugins require Node.js 22.22.2 or later in the 22.x line, or 24.15.0 or later. Keep `conventional-changelog-conventionalcommits` on 9.x while semantic-release uses `@semantic-release/release-notes-generator` 14.x and `conventional-changelog-writer` 8.x: preset 10.x replaces its templates with render functions and requires the newer writer. See the [preset's breaking changes](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-conventionalcommits/CHANGELOG.md#1000-2026-06-26).
12
+
11
13
  Dependabot updates the GitHub Actions pins weekly. Package dependency updates are not scheduled through Dependabot because its [pnpm 12 multi-document lockfile issue](https://github.com/dependabot/dependabot-core/issues/15904) remains open and GitHub's [supported versions](https://docs.github.com/en/code-security/reference/supply-chain-security/supported-ecosystems-and-repositories) currently list pnpm through v10. Update package dependencies with pnpm and commit both the manifest and lockfile changes until this format is supported.
12
14
 
13
15
  After both check jobs succeed, semantic-release analyzes commits since the last release tag. When those commits warrant a release, it:
@@ -68,7 +70,7 @@ For an existing package that you maintain, configure npm trusted publishing in t
68
70
 
69
71
  The filename is `ci.yml`, without `.github/workflows/`. The release job has no GitHub environment. Direct publishing must be allowed: stage-only permission would require manual promotion and does not match this automatic pipeline. OIDC publishes from a public repository generate npm provenance automatically. See [npm's trusted publishing setup](https://docs.npmjs.com/trusted-publishers/).
70
72
 
71
- The initial release of this project is **0.1.0**, already set in `package.json`. semantic-release does not support configuring a first release below 1.0.0. Publish 0.1.0 once from a maintainer's local checkout, then tag that published commit so subsequent automated releases have a baseline. Without that tag, the first qualifying workflow release would be **1.0.0**. See the [semantic-release initial version policy](https://semantic-release.org/support/faq/#can-i-set-the-initial-release-version-of-my-package-to-001).
73
+ The initial release of this project is **0.2.0**, already set in `package.json`. semantic-release does not support configuring a first release below 1.0.0. Publish 0.2.0 once from a maintainer's local checkout, then tag that published commit so subsequent automated releases have a baseline. Without that tag, the first qualifying workflow release would be **1.0.0**. See the [semantic-release initial version policy](https://semantic-release.org/support/faq/#can-i-set-the-initial-release-version-of-my-package-to-001).
72
74
 
73
75
  Before the first publication, record the initial changes in `CHANGELOG.md`, review and commit the source on the default branch, and push it with `[skip ci]` in the commit message to avoid starting a release before the baseline exists. The repository currently uses `master`:
74
76
 
@@ -89,16 +91,16 @@ pnpm publish --access public
89
91
  After publication succeeds, verify the registry version, then create and push the tag on that same commit:
90
92
 
91
93
  ```sh
92
- npm view acp-port@0.1.0 version --registry=https://registry.npmjs.org
93
- git tag v0.1.0
94
- git push origin v0.1.0
94
+ npm view acp-port@0.2.0 version --registry=https://registry.npmjs.org
95
+ git tag v0.2.0
96
+ git push origin v0.2.0
95
97
  ```
96
98
 
97
- Do not tag a failed publication or change the source between publishing and tagging. Create the initial GitHub Release from `v0.1.0` if desired; subsequent GitHub Releases and changelog entries are automatic.
99
+ Do not tag a failed publication or change the source between publishing and tagging. Create the initial GitHub Release from `v0.2.0` if desired; subsequent GitHub Releases and changelog entries are automatic.
98
100
 
99
101
  Once the package exists, configure the trusted publisher above before merging another release-worthy commit. If a GitHub `NPM_TOKEN` secret was added earlier, remove it and revoke the token. Granular-token direct publication is being removed in January 2027; the workflow's optional token fallback is unnecessary for the recommended OIDC path. A stage-only token would require a different workflow and manual approval. See [npm's token deprecation notice](https://docs.npmjs.com/about-access-tokens/#direct-publishing-is-being-deprecated).
100
102
 
101
- With `v0.1.0` in the default branch's history, a `fix:` release becomes **0.1.1**, a `feat:` release becomes **0.2.0**, and a breaking change becomes **1.0.0** under the current rules. semantic-release does not apply special version-zero breaking-change rules. Verify a subsequent OIDC release. After it works, npm's publishing settings can disallow traditional tokens. Keep the README's initial release-status note accurate only after publication is verified.
103
+ With `v0.2.0` in the default branch's history, a `fix:` release becomes **0.2.1**, a `feat:` release becomes **0.3.0**, and a breaking change becomes **1.0.0** under the current rules. semantic-release does not apply special version-zero breaking-change rules. Verify a subsequent OIDC release. After it works, npm's publishing settings can disallow traditional tokens. Keep the README's initial release-status note accurate only after publication is verified.
102
104
 
103
105
  ## Preview and verify a release
104
106
 
@@ -4,6 +4,16 @@
4
4
 
5
5
  Start by identifying the failing boundary: resolving the npm package, launching the agent, discovering models, creating an ACP session, making an inference request, or executing an editor tool. Model discovery and inference are separate operations; success at one does not prove the other works.
6
6
 
7
+ ## Where errors appear in the editor
8
+
9
+ When a prompt fails, ACP Port sends an **acp-port error** message to the conversation before returning the failed request. Editors that advertise ACP session notices also receive an error notice; its placement depends on the editor. The conversation message uses the same standard ACP text updates as model responses, so notice support is optional. Cancellation does not produce a failure message.
10
+
11
+ If discovery leaves no usable model, the session-creation error includes the discovery diagnosis. If `--default-model` allows the session to continue after discovery fails, the warning appears on the first prompt, as a notice when supported or a conversation message otherwise. Launch failures that occur before an ACP session exists still require the editor's agent logs or a terminal check.
12
+
13
+ Provider diagnostics include HTTP status when available and specific guidance for recognized authentication, connection, timeout, model, context-size, and chat-template failures. Raw response bodies, prompts, and API keys are not copied into these messages. Unrecognized failures retain general guidance to check the server logs.
14
+
15
+ If a request fails or is cancelled before any answer or tool activity, its prompt is removed from the model history so retrying does not produce consecutive user messages that strict chat templates reject. Partial answers and tool activity remain in history.
16
+
7
17
  ## Establish a working baseline
8
18
 
9
19
  Run these commands in a terminal with Node.js 22.12 or later and npm/npx installed. No repository checkout is needed for a published release; see the [quick start](../README.md#quick-start) for release availability.
@@ -41,7 +51,7 @@ For source development, follow [CONTRIBUTING.md](../CONTRIBUTING.md). A publishe
41
51
 
42
52
  Check the server is running, its API base URL is correct, and the runtime hosting acp-port can reach it. The base URL is the API root, such as `http://127.0.0.1:1234/v1`, not a full `/chat/completions` URL. Anthropic's default root is `https://api.anthropic.com`; use the root expected by the native Messages API adapter.
43
53
 
44
- For a local server, ensure a model is downloaded and available through that server's API. For a gateway, verify that the supplied key can list models and that the gateway exposes a compatible model-list route. Discovery has a maximum 10-second budget and reports a generic warning instead of a raw API response.
54
+ For a local server, ensure a model is downloaded and available through that server's API. For a gateway, verify that the supplied key can list models and that the gateway exposes a compatible model-list route. Discovery has a maximum 10-second budget and reports a categorized diagnostic instead of a raw API response.
45
55
 
46
56
  If model listing is unavailable but you know the exact inference ID, use:
47
57
 
@@ -77,7 +87,28 @@ Check the model supports the selected adapter's streaming chat API. The catalog
77
87
 
78
88
  If ordinary text works but requests with tools fail, add `--no-tools` and restart the agent. This disables file and terminal tools; it does not add tool support to the model. Prefer a model/server combination with reliable function calling when you need edits or commands.
79
89
 
80
- The editor may show `Provider endpoint request failed. Check its API key, model, URL, and server logs.` This is intentionally generic: raw SDK/API error bodies can contain request data. Look at the endpoint's own logs or make a minimal request using its official API tools to distinguish authentication, access, quota, protocol, and model errors. Sanitize logs before sharing them.
90
+ Use the diagnostic in the editor to choose the next check:
91
+
92
+ | Diagnostic | What to check |
93
+ | --- | --- |
94
+ | Cannot connect | Start the server and verify its host/port is reachable from the agent process. |
95
+ | HTTP 401 or 403 | Check the editor's `API_KEY` and its permissions for this endpoint/model. |
96
+ | HTTP 404 or model not found | Check the API base path and the exact upstream model ID. |
97
+ | HTTP 400 or 422 | Check request compatibility, including the model's chat template and tool support. |
98
+ | Context size exceeded | Start a new session, reduce attached text, or adjust the server's supported context size. |
99
+ | HTTP 429 | Check quota/rate limits and retry later. |
100
+ | HTTP 503 or model still loading | Wait for the model/server to become ready, then retry. |
101
+ | Invalid JSON or interrupted stream | Check that the URL serves the selected streaming API and inspect server logs. |
102
+
103
+ These messages are safe summaries, not raw server errors. Check the endpoint's own logs when the summary does not identify the cause; sanitize logs before sharing them.
104
+
105
+ ### llama.cpp accepts discovery but rejects prompts
106
+
107
+ Discovery only tests model listing. ACP Port normally includes function tools in every inference request, so a server can list its model successfully and reject even a simple greeting because of tool/template configuration.
108
+
109
+ If the diagnostic mentions `--jinja`, restart `llama-server` with Jinja enabled and a tool-compatible model/template. A template error can require a matching `--chat-template-file`, not just enabling Jinja. For text-only use, add `--no-tools` to ACP Port's editor arguments and restart the agent; this removes file and terminal actions. Tools are never disabled automatically after a failure.
110
+
111
+ Use a base such as `http://127.0.0.1:8080/v1`, and use the server's model alias or discovered upstream ID as `--default-model`. Wait for model loading to finish. If the conversation exceeds the server's context size, start a new session or adjust the server's context configuration. The [llama.cpp recipe](providers.md#llamacpp) includes complete launch fields.
81
112
 
82
113
  ### Slow model or interrupted stream
83
114
 
@@ -93,10 +124,10 @@ There is no `--timeout` flag. See the [runtime defaults](configuration.md#runtim
93
124
  | The model says it has no file tools | Check `--no-tools` is absent and use a model/server with function calling support. File tools work through ACP or directly against the local workspace. Older builds hid them when the editor did not advertise file access; rebuild or update and restart the agent process. |
94
125
  | No command tool | Check `--no-tools` is absent and the session is not in plan mode. Other modes use the editor terminal or a local process automatically. |
95
126
  | Local file reads miss recent edits | Without the editor's file API, reads use saved disk contents. Save the editor buffer before asking the agent to read or edit the file. |
96
- | `Path must stay inside the workspace` | Default mode restricts paths to the session workspace. `--mode full-access` permits paths outside it, subject to OS permissions. |
127
+ | `Path must stay inside the workspace` | Default mode restricts paths to the session workspace. Selecting Full access in the editor permits paths outside it, subject to OS permissions. |
97
128
  | `Path resolves outside the workspace` or an unresolved-symlink error | The target or its ancestor is an external or dangling symlink. Use a valid in-workspace target. |
98
129
  | `Permission denied` | The editor rejected or cancelled the request, or returned something other than `allow_once`. The write or command was not executed by that call. |
99
- | Repeated write or command approvals | Select accept-edits to allow workspace writes, auto to remember explicit scoped session grants, or full-access to skip all approvals. Use the editor mode selector or `--mode MODE` at launch. |
130
+ | Repeated write or command approvals | Select accept-edits to allow workspace writes, auto to remember explicit scoped session grants, or full-access to skip all approvals. Use the editor's ACP permission mode selector. |
100
131
  | A mode change stopped the response | Mode changes cancel active work and clear remembered approvals so the old policy cannot continue. Send the next prompt under the new mode. |
101
132
  | Local access reports `EACCES` or `EPERM` | The agent process's OS permissions still apply, including in full access. Check the file's permissions and the account/environment running acp-port. |
102
133
  | A tool times out while awaiting approval | The 120-second tool budget includes the permission dialog. Review a fresh request; approving an expired request does not resume it. |