openclaw-code-agent 3.1.0 → 3.2.1

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.
package/README.md CHANGED
@@ -9,12 +9,34 @@
9
9
  - **Plan -> Review -> Execute**. `plan` is the default launch mode, with `ask`, `delegate`, and `approve` deciding how much plan approval autonomy the orchestrator gets.
10
10
  - **Optional worktree isolation**. New sessions default to `off`; opt into `ask`, `delegate`, `auto-merge`, or `auto-pr` when you want worktree-backed branch isolation and post-run branch handling.
11
11
  - **State-driven decision UX**. `ask` sends explicit action buttons for **Merge locally**, **Create PR**, **Decide later**, and **Dismiss**. The same action-token model now backs both Telegram and Discord interactive callbacks.
12
+ - **Lifecycle-first cleanup**. Worktrees are treated as temporary task sandboxes. The plugin distinguishes `merged` from `released` so different-SHA branches whose content already landed on the base branch can still be cleaned safely.
12
13
  - **Full session lifecycle**. Suspend, resume, fork, interrupt, and recover sessions across restarts with persisted metadata and output.
14
+ - **Explicit goal-task loops**. Opt into verifier-driven repair loops or Ralph-style completion loops when you need iterative autonomous execution toward a specific goal.
13
15
  - **Real operator visibility**. `agent_sessions`, `agent_output`, and `agent_stats` show status, buffered output, duration, and USD cost.
14
16
  - **Two harnesses, one control plane**. Claude Code and Codex share the same tools, routing, notification pipeline, and worktree strategy model while each backend uses its own native execution substrate.
15
17
  - **One continuation primitive**. `agent_respond` is the only way to continue, approve, revise, or redirect an existing session. Forks still go through `agent_launch(..., resume_session_id=..., fork_session=true)`.
16
18
 
17
- Need the version-pinned ACP breakdown? See [docs/ACP-COMPARISON.md](docs/ACP-COMPARISON.md).
19
+ Need the ACPX vs Codex vs code-agent breakdown? See [docs/ACP-COMPARISON.md](docs/ACP-COMPARISON.md).
20
+
21
+ ## Boundaries
22
+
23
+ `openclaw-code-agent` is separate from both OpenClaw's bundled `acpx` runtime plugin and OpenClaw's bundled `codex` plugin.
24
+
25
+ - **ACPX** is OpenClaw's ACP runtime backend for ACP session interoperability.
26
+ - **OpenClaw's bundled `codex` plugin** is the core native Codex provider/harness pair for embedded agent turns.
27
+ - **`openclaw-code-agent`** is the chat orchestration layer that adds plan approval, wake routing, session lifecycle, and worktree/merge/PR policy above its own native Claude Code and Codex harnesses.
28
+
29
+ The shared substrate is often the local `codex` command and Codex App Server, but the responsibilities are different. This plugin is not an ACP server and it does not depend on OpenClaw's bundled Codex provider to expose its own `codex` harness.
30
+
31
+ ## New In 3.2.1
32
+
33
+ `3.2.1` is a maintenance release focused on routing correctness, compatibility metadata, and release/security hygiene around the newer plan-review and worktree model.
34
+
35
+ - **Trusted route resolution for newer OpenClaw contexts**. The plugin now prefers `deliveryContext` and `requesterSenderId` when available, while keeping legacy routing fallbacks for persisted sessions and older fixtures.
36
+ - **Safer verifier execution**. Goal-task verifier commands now drop shell bootstrap hooks like `BASH_ENV` and `ENV` so operator-provided verifier commands run with fewer implicit side effects.
37
+ - **Compatibility and onboarding metadata refresh**. The release raises the external OpenClaw baseline to `v2026.4.14`, verifies against the stable `v2026.4.21` build target, and ships the manifest activation/setup descriptors plus narrower onboarding guidance for first-run setup.
38
+ - **Codex harness policy refresh**. The built-in Codex allowlist now includes `gpt-5.4-pro`.
39
+ - **Stronger security and release hygiene**. Dependency overrides, CI checks, plugin security validation, and release metadata parity checks are all updated to match the shipped package.
18
40
 
19
41
  ## From Prompt To Merged Branch
20
42
 
@@ -22,13 +44,42 @@ Need the version-pinned ACP breakdown? See [docs/ACP-COMPARISON.md](docs/ACP-COM
22
44
  2. Review the plan in the same thread before anything touches the repo.
23
45
  3. Let the agent finish in an isolated worktree, then merge or publish the result from chat.
24
46
 
47
+ ### Explicit Goal Tasks
48
+
49
+ Goal tasks are an explicit opt-in path for iterative autonomous work. They do not replace the default `agent_launch` flow.
50
+
51
+ Use the dedicated goal entrypoints:
52
+
53
+ - `/goal ...`
54
+ - `goal_launch(...)`
55
+
56
+ The plugin does not automatically switch into goal mode just because a freeform prompt contains the words `goal task`.
57
+
58
+ Use them when you want the plugin to keep looping toward one concrete outcome:
59
+
60
+ - **Verifier mode** reruns one or more shell checks after each coding turn and keeps iterating until they pass or the iteration budget is exhausted.
61
+ - **Ralph mode** keeps resuming the same task until the agent emits an exact completion promise, with optional verifiers run after completion is claimed.
62
+
63
+ Examples:
64
+
65
+ ```bash
66
+ /goal --workdir /repo --verify "npm test" --verify "npm run lint" Fix the failing auth flow
67
+ /goal --workdir /repo --mode ralph --completion-promise DONE Ship the draft blog post workflow end to end
68
+ goal_launch(goal="Fix the failing auth flow", verifier_commands=["npm test", "npm run lint"], workdir="/repo")
69
+ goal_launch(goal="Ship the draft blog post workflow end to end", goal_mode="ralph", completion_promise="DONE", workdir="/repo")
70
+ ```
71
+
72
+ Once launched, use `goal_status` / `/goal_status` to inspect progress and `goal_stop` / `/goal_stop` to terminate the loop. Goal-task state is persisted so recoverable loops can resume after a gateway restart.
73
+
25
74
  ### Plan First
26
75
 
27
- The differentiator is the plan-review loop. Claude Code and Codex both feed the same review UX now: the plugin receives a structured plan artifact, keeps execution blocked until approval, and resumes the same session with `agent_respond(..., approve=true)`.
76
+ The differentiator is the plan-review loop. Claude Code and Codex both feed the same review UX now: the plugin receives a structured plan artifact, keeps execution blocked until approval, and resumes the same session with `agent_respond(..., approve=true)`. If the user asks for revisions, the revised submission becomes the new actionable review version for that same session, and `approve=true` resolves against that latest version instead of any stale earlier change-request state.
77
+
78
+ > Demo note: the GIFs below were recorded on an older build. They still show the overall flow correctly, but they do not include the newer explicit action buttons and some other current thread controls.
28
79
 
29
80
  <img src="assets/ask-readme.gif" alt="Plan review in ask mode with inline approval controls">
30
81
 
31
- *`ask` mode keeps the human in the loop: the plan lands back in the originating thread, and execution only starts after approval.*
82
+ *`ask` mode keeps the human in the loop: the plan lands back in the originating thread, and execution only starts after approval. The current UI now uses explicit buttons for approval and follow-through, even though the GIF predates that update.*
32
83
 
33
84
  ### Finish Cleanly
34
85
 
@@ -36,7 +87,21 @@ When the task is done, the plugin can leave the branch for review, merge it auto
36
87
 
37
88
  <img src="assets/delegate-readme.gif" alt="Delegated worktree flow with autonomous follow-through">
38
89
 
39
- *The main checkout stays clean. The branch lifecycle happens in the worktree, and the chat thread stays current on what was shipped.*
90
+ *The main checkout stays clean. The branch lifecycle happens in the worktree, and the chat thread stays current on what was shipped. The current UI includes newer buttons and lifecycle affordances that are not visible in this older recording.*
91
+
92
+ ### Worktree Lifecycle
93
+
94
+ Worktree-backed sessions move through product-facing lifecycle states:
95
+
96
+ - `active`: sandbox still in use
97
+ - `pending decision`: waiting for merge / PR / dismiss follow-through
98
+ - `pr_open`: PR exists and the sandbox is being preserved
99
+ - `merged`: branch landed by normal git ancestry
100
+ - `released`: content is already on the base branch even though branch SHAs differ after rebase, squash, or cherry-pick
101
+ - `dismissed`: user intentionally discarded the sandbox
102
+ - `no_change`: session finished without a committed delta
103
+
104
+ For cleanup, use `agent_worktree_cleanup(mode="preview_safe")` to preview what **Clean all safe** would remove, `mode="clean_safe"` to perform that cleanup, and `mode="preview_all"` to review both safe sandboxes and the reasons other worktrees were retained.
40
105
 
41
106
  ## Supported Harnesses
42
107
 
@@ -57,6 +122,20 @@ openclaw plugins enable openclaw-code-agent
57
122
  openclaw gateway restart
58
123
  ```
59
124
 
125
+ This release targets the OpenClaw `v2026.4.14` external plugin contract and is verified against the stable `v2026.4.21` build/test target. `package.json` now carries the plugin API compatibility and build metadata used by modern OpenClaw / ClawHub installs, and `openclaw.plugin.json` now advertises the plugin-owned command activation surface plus the onboarding metadata OpenClaw uses during plugin-config setup. Keep those metadata surfaces in sync when bumping the plugin release baseline.
126
+
127
+ The current manifest descriptors stay intentionally narrow: activation advertises only the chat commands this plugin owns, and setup stays minimal with `requiresRuntime: false`. First-run onboarding is driven by the manifest config schema and `uiHints`, not by provider/backend setup descriptors.
128
+
129
+ ### First-Run Onboarding
130
+
131
+ In OpenClaw's Manual setup flow, the plugin should only ask for three first-run decisions:
132
+
133
+ - `defaultWorkdir`: the repo or workspace path you expect to launch from most often
134
+ - `defaultHarness`: whether your default harness is `claude-code` or `codex`
135
+ - `fallbackChannel`: an optional but recommended fully routable notification target for async updates
136
+
137
+ Everything else stays advanced/manual. In particular, `agentChannels`, per-harness model policy, permission defaults, and worktree policy are intentionally deferred until after the first successful launch.
138
+
60
139
  Add a minimal config block under `plugins.entries["openclaw-code-agent"]` in `~/.openclaw/openclaw.json`:
61
140
 
62
141
  ```json
@@ -66,9 +145,9 @@ Add a minimal config block under `plugins.entries["openclaw-code-agent"]` in `~/
66
145
  "openclaw-code-agent": {
67
146
  "enabled": true,
68
147
  "config": {
148
+ "defaultWorkdir": "/home/user/project",
149
+ "defaultHarness": "claude-code",
69
150
  "fallbackChannel": "telegram|my-bot|123456789",
70
- "planApproval": "ask",
71
- "defaultWorktreeStrategy": "off",
72
151
  "harnesses": {
73
152
  "claude-code": {
74
153
  "defaultModel": "sonnet",
@@ -76,7 +155,7 @@ Add a minimal config block under `plugins.entries["openclaw-code-agent"]` in `~/
76
155
  },
77
156
  "codex": {
78
157
  "defaultModel": "gpt-5.4",
79
- "allowedModels": ["gpt-5.4"],
158
+ "allowedModels": ["gpt-5.4", "gpt-5.4-pro"],
80
159
  "reasoningEffort": "medium"
81
160
  }
82
161
  }
@@ -87,6 +166,12 @@ Add a minimal config block under `plugins.entries["openclaw-code-agent"]` in `~/
87
166
  }
88
167
  ```
89
168
 
169
+ You can leave the advanced settings at their defaults for the first run. The plugin defaults to:
170
+
171
+ - `permissionMode: "plan"`
172
+ - `planApproval: "ask"`
173
+ - `defaultWorktreeStrategy: "off"`
174
+
90
175
  If you run Codex sessions, keep Codex on the ChatGPT auth path:
91
176
 
92
177
  ```toml
@@ -97,6 +182,17 @@ Put that in `~/.codex/config.toml`.
97
182
 
98
183
  Codex approval behavior is fixed to the supported execution path, and OpenClaw handles review gates through `permissionMode` plus `planApproval`.
99
184
 
185
+ ### Harness Availability Guidance
186
+
187
+ OpenClaw's generic plugin onboarding can prompt for `defaultHarness`, but it does not yet have a plugin-specific readiness panel. Use these checks when choosing the default:
188
+
189
+ - `codex`: choose this only when the `codex` command (or your `OPENCLAW_CODEX_APP_SERVER_COMMAND` override) is available and local Codex auth under `~/.codex` is already working
190
+ - `claude-code`: choose this when the bundled Claude SDK/CLI is installed and you expect Claude Code to be the main path on this machine
191
+
192
+ Codex readiness is the easier one to verify locally because the plugin depends on a resolvable command plus local auth files. Claude Code installation is verifiable, but authenticated usability may still require Claude-side login/account setup the first time you launch a session.
193
+
194
+ This is this plugin's own harness selection, not OpenClaw ACPX runtime selection and not the bundled core `codex` provider toggle. The real prerequisites are the local backend commands and local auth state.
195
+
100
196
  Launch a first session:
101
197
 
102
198
  ```bash
@@ -110,14 +206,15 @@ For multi-workspace or multi-bot setups, configure `agentChannels`. The full rou
110
206
 
111
207
  Prefer fully routable channel strings such as `telegram|123456789` or `telegram|my-bot|123456789`. A bare provider like `telegram` is only a weak fallback; the plugin now repairs topic routing from `originSessionKey` when possible, but explicit channels are still the safer default.
112
208
 
113
- ### Upgrade Note For 3.1.0
209
+ ### Upgrade Note For 3.2.0
114
210
 
115
- `3.1.0` is a maintenance release focused on reliability, explicit session state, and release-tooling hardening.
211
+ If you are upgrading from `3.1.0`, the important behavioral changes are:
116
212
 
117
- - Upgrading archives old or invalid persisted session stores to a timestamped `.legacy-*.json` backup and starts with a fresh index.
118
- - Legacy Codex SDK session entries are archived and not loaded by the App Server backend.
119
- - App Server-backed Codex sessions are now the only supported Codex runtime path.
120
- - Contributors and release automation should use `pnpm verify` as the canonical validation gate.
213
+ - `defaultWorktreeStrategy` is back to `off`, so worktree isolation remains opt-in unless you configure it explicitly.
214
+ - `auto-merge` now attempts one autonomous conflict resolution before escalating.
215
+ - Completion wakes and no-change outcomes are deterministic and carry explicit approval/execution state instead of relying on transcript inference.
216
+ - Worktree cleanup is lifecycle-first and can now classify already-landed branches as `released`, which makes `preview_safe` and `clean_safe` more trustworthy after rebase, squash, or cherry-pick flows.
217
+ - Release validation now checks package/plugin version parity in addition to the normal `pnpm verify` gate.
121
218
 
122
219
  ### Backend Capabilities
123
220
 
@@ -138,10 +235,13 @@ Prefer fully routable channel strings such as `telegram|123456789` or `telegram|
138
235
  | `agent_stats` | Show aggregate usage and cost |
139
236
  | `agent_merge` | Merge a worktree branch back to base |
140
237
  | `agent_pr` | Create or update a GitHub PR |
141
- | `agent_worktree_status` | Show branch, PR, and pending-decision state |
142
- | `agent_worktree_cleanup` | Clean up merged agent branches or dismiss a pending worktree decision |
238
+ | `agent_worktree_status` | Show authoritative lifecycle state, derived repo evidence, cleanup safety, and retained reasons |
239
+ | `agent_worktree_cleanup` | Clean all lifecycle-safe worktrees or dismiss one pending decision without touching live/unsafe worktrees |
240
+ | `goal_launch` | Start an explicit verifier or Ralph-style goal loop |
241
+ | `goal_status` | Show one goal task or list all goal tasks |
242
+ | `goal_stop` | Stop a running goal task |
143
243
 
144
- The chat command surface mirrors the common workflows: `/agent`, `/agent_sessions`, `/agent_output`, `/agent_respond`, `/agent_kill`, and `/agent_stats`.
244
+ The chat command surface mirrors the common workflows: `/agent`, `/agent_sessions`, `/agent_output`, `/agent_respond`, `/agent_kill`, `/agent_stats`, `/goal`, `/goal_status`, and `/goal_stop`.
145
245
 
146
246
  ## Docs
147
247
 
@@ -150,6 +250,7 @@ The chat command surface mirrors the common workflows: `/agent`, `/agent_session
150
250
  | [docs/REFERENCE.md](docs/REFERENCE.md) | Install, config, tools, commands, notifications, routing, worktrees, troubleshooting |
151
251
  | [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Session manager, harness model, notification pipeline, persistence, worktree internals |
152
252
  | [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) | Local setup, repo layout, build/test flow, extension points |
253
+ | [docs/SECURITY.md](docs/SECURITY.md) | Accepted subprocess surfaces, verifier-shell boundary, and current scanner findings |
153
254
  | [docs/ACP-COMPARISON.md](docs/ACP-COMPARISON.md) | Current comparison with OpenClaw core ACP |
154
255
  | [skills/code-agent-orchestration/SKILL.md](skills/code-agent-orchestration/SKILL.md) | Operational skill for orchestrating sessions from an agent |
155
256
  | [CHANGELOG.md](CHANGELOG.md) | Release history |