mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:50:43 +00:00
[codex] Consolidate RuntimePlan and Harness V2 package (#71722)
* refactor: centralize runtime plan policy surface * refactor: route embedded attempts through runtime plan * feat: add agent harness v2 lifecycle adapter * docs: document agent harness runtime plan --------- Co-authored-by: Eva <eva@100yen.org> Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -46,6 +46,23 @@ Before a harness is selected, OpenClaw has already resolved:
|
||||
That split is intentional. A harness runs a prepared attempt; it does not pick
|
||||
providers, replace channel delivery, or silently switch models.
|
||||
|
||||
The prepared attempt also includes `params.runtimePlan`, an OpenClaw-owned
|
||||
policy bundle for runtime decisions that must stay shared across PI and native
|
||||
harnesses:
|
||||
|
||||
- `runtimePlan.tools.normalize(...)` and
|
||||
`runtimePlan.tools.logDiagnostics(...)` for provider-aware tool schema policy
|
||||
- `runtimePlan.transcript.resolvePolicy(...)` for transcript sanitization and
|
||||
tool-call repair policy
|
||||
- `runtimePlan.delivery.isSilentPayload(...)` for shared `NO_REPLY` and media
|
||||
delivery suppression
|
||||
- `runtimePlan.outcome.classifyRunResult(...)` for model fallback classification
|
||||
- `runtimePlan.observability` for resolved provider/model/harness metadata
|
||||
|
||||
Harnesses may use the plan for decisions that need to match PI behavior, but
|
||||
should still treat it as host-owned attempt state. Do not mutate it or use it to
|
||||
switch providers/models inside a turn.
|
||||
|
||||
## Register a harness
|
||||
|
||||
**Import:** `openclaw/plugin-sdk/agent-harness`
|
||||
@@ -162,6 +179,16 @@ middleware, but new result transforms should use the runtime-neutral API.
|
||||
The Pi-only `api.registerEmbeddedExtensionFactory(...)` hook has been removed;
|
||||
Pi tool-result transforms must use runtime-neutral middleware.
|
||||
|
||||
### Terminal outcome classification
|
||||
|
||||
Native harnesses that own their own protocol projection can use
|
||||
`classifyAgentHarnessTerminalOutcome(...)` from
|
||||
`openclaw/plugin-sdk/agent-harness-runtime` when a completed turn produced no
|
||||
visible assistant text. The helper returns `empty`, `reasoning-only`, or
|
||||
`planning-only` so OpenClaw's fallback policy can decide whether to retry on a
|
||||
different model. It intentionally leaves prompt errors, in-flight turns, and
|
||||
intentional silent replies such as `NO_REPLY` unclassified.
|
||||
|
||||
### Native Codex harness mode
|
||||
|
||||
The bundled `codex` harness is the native Codex mode for embedded OpenClaw
|
||||
|
||||
@@ -191,7 +191,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
|
||||
| `plugin-sdk/models-provider-runtime` | `/models` command/provider reply helpers |
|
||||
| `plugin-sdk/skill-commands-runtime` | Skill command listing helpers |
|
||||
| `plugin-sdk/native-command-registry` | Native command registry/build/serialize helpers |
|
||||
| `plugin-sdk/agent-harness` | Experimental trusted-plugin surface for low-level agent harnesses: harness types, active-run steer/abort helpers, OpenClaw tool bridge helpers, tool progress formatting/detail helpers, and attempt result utilities |
|
||||
| `plugin-sdk/agent-harness` | Experimental trusted-plugin surface for low-level agent harnesses: harness types, active-run steer/abort helpers, OpenClaw tool bridge helpers, runtime-plan tool policy helpers, terminal outcome classification, tool progress formatting/detail helpers, and attempt result utilities |
|
||||
| `plugin-sdk/provider-zai-endpoint` | Z.AI endpoint detection helpers |
|
||||
| `plugin-sdk/infra-runtime` | System event/heartbeat helpers |
|
||||
| `plugin-sdk/collection-runtime` | Small bounded cache helpers |
|
||||
|
||||
Reference in New Issue
Block a user