Skip to content

Commit 154a7ed

Browse files
authored
refactor: consume acpx runtime library (#61495)
* refactor: consume acpx runtime library * refactor: remove duplicated acpx runtime files * fix: update acpx runtime dependency * fix: preserve acp runtime error codes * fix: migrate legacy acpx session files * fix: update acpx runtime dependency * fix: import Dirent from node fs * ACPX: repin shared runtime engine * ACPX: repin runtime semantics fixes * ACPX: repin runtime contract cleanup * Extensions: repin ACPX after layout refactor * ACPX: drop legacy session migration * ACPX: drop direct ACP SDK dependency * Discord ACP: stop duplicate direct fallback replies * ACP: rename delivered text visibility hook * ACPX: pin extension to 0.5.0 * Deps: drop stale ACPX build-script allowlist * ACPX: add local development guidance * ACPX: document temporary pnpm exception flow * SDK: preserve legacy ACP visibility hook * ACP: keep reset commands on local path * ACP: make in-place reset start fresh session * ACP: recover broken bindings on fresh reset * ACP: defer fresh reset marker until close succeeds * ACP: reset bound sessions fresh again * Discord: ensure ACP bindings before /new * ACP: recover missing persistent sessions
1 parent 4b2d528 commit 154a7ed

62 files changed

Lines changed: 1258 additions & 7213 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extensions/acpx/AGENTS.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# ACPX Extension Notes
2+
3+
This file applies to work under `extensions/acpx/`.
4+
5+
## Purpose
6+
7+
The bundled ACPX extension is a thin OpenClaw wrapper around the published `acpx` package. Keep reusable ACP runtime logic in `openclaw/acpx`, not in this extension.
8+
9+
## Default Version Policy
10+
11+
- `extensions/acpx/package.json` should point at a published npm release by default.
12+
- Do not leave the extension pinned to a temporary GitHub commit or local checkout once the ACPX release exists.
13+
- Do not leave temporary pnpm build-script allowlist exceptions behind after switching back to a published ACPX package.
14+
15+
## Unreleased ACPX Development Flow
16+
17+
Use this flow when OpenClaw needs unreleased ACPX changes before the ACPX version is published.
18+
19+
1. Make the ACPX code change in the `openclaw/acpx` repo first.
20+
2. In OpenClaw, temporarily point `extensions/acpx/package.json` at the ACPX GitHub commit you need.
21+
3. If pnpm blocks ACPX lifecycle/build scripts for that temporary GitHub-sourced package, temporarily add `acpx` to `onlyBuiltDependencies` in both `package.json` and `pnpm-workspace.yaml`.
22+
4. Refresh the root workspace lock:
23+
- `pnpm install --lockfile-only --filter ./extensions/acpx`
24+
5. Refresh the extension-local npm lock for install metadata:
25+
- `cd extensions/acpx && npm install --package-lock-only --ignore-scripts`
26+
6. Rebuild OpenClaw and restart the gateway before doing live ACP validation.
27+
7. Once ACPX is released, switch `extensions/acpx/package.json` back to the published npm version and refresh the same lockfiles again.
28+
8. Remove any temporary `acpx` build-script allowlist entries that were only needed for the GitHub-sourced development pin.
29+
30+
## Lockfile Notes
31+
32+
- `pnpm-lock.yaml` is the tracked workspace lockfile and must match the ACPX version referenced by `extensions/acpx/package.json`.
33+
- `extensions/acpx/package-lock.json` is useful local install metadata for the bundled plugin package.
34+
- If `extensions/acpx/package-lock.json` is gitignored in this repo state, regenerating it is still useful for local verification, but it will not appear in `git status`.
35+
36+
## Local Runtime Validation
37+
38+
When ACPX integration changes here, prefer this sequence:
39+
40+
1. `pnpm install --filter ./extensions/acpx`
41+
2. `pnpm test:extension acpx`
42+
3. `pnpm build`
43+
4. Restart the local gateway if ACP runtime behavior or bundled plugin wiring changed.
44+
5. If the change affects direct ACP behavior in chat, run a real ACP smoke after restart.
45+
46+
## Direct ACPX Binary Policy
47+
48+
- Prefer the plugin-local ACPX binary under `extensions/acpx/node_modules/.bin/acpx`.
49+
- Do not rely on a globally installed `acpx` binary for OpenClaw ACP validation.
50+
- If the plugin-local ACPX binary is missing or on the wrong version, reinstall it from the version pinned in `extensions/acpx/package.json`.
51+
52+
## Boundary Rule
53+
54+
If a change feels like shared ACP runtime behavior instead of OpenClaw-specific glue, move it to `openclaw/acpx` and consume it from here instead of re-implementing it inside `extensions/acpx`.

extensions/acpx/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

extensions/acpx/openclaw.plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
},
102102
"strictWindowsCmdWrapper": {
103103
"label": "Strict Windows cmd Wrapper",
104-
"help": "Enabled by default. On Windows, reject unresolved .cmd/.bat wrappers instead of shell fallback. Disable only for compatibility with non-standard wrappers.",
104+
"help": "Legacy compatibility field. The current embedded acpx/runtime package uses its own Windows command resolution behavior. Setting this to false is accepted for compatibility and logged as ignored.",
105105
"advanced": true
106106
},
107107
"timeoutSeconds": {
@@ -111,7 +111,7 @@
111111
},
112112
"queueOwnerTtlSeconds": {
113113
"label": "Queue Owner TTL Seconds",
114-
"help": "Reserved compatibility field for future queued embedded prompt ownership.",
114+
"help": "Reserved compatibility field for the older embedded ACPX queue-owner path. Accepted for compatibility and logged as ignored.",
115115
"advanced": true
116116
},
117117
"mcpServers": {

extensions/acpx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "OpenClaw ACP runtime backend",
55
"type": "module",
66
"dependencies": {
7-
"@agentclientprotocol/sdk": "0.18.0"
7+
"acpx": "0.5.0"
88
},
99
"openclaw": {
1010
"extensions": [

extensions/acpx/src/acp-error-shapes.ts

Lines changed: 0 additions & 153 deletions
This file was deleted.

extensions/acpx/src/acp-jsonrpc.ts

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)