feat(agents): task system parity — cancelled status, merge mode, activeForm, plan hydration [Phase 3.A]#67514
Conversation
…e, activeForm, hydration
Ports three Hermes todo-tool features that OpenClaw's update_plan
was missing, plus adds plan hydration for post-compaction recovery.
## cancelled status (Hermes parity)
Add "cancelled" as a fourth plan step status. Hermes uses this to
mark steps that were started but abandoned due to failure, keeping
them visible in history instead of silently dropping them.
Ref: Hermes tools/todo_tool.py Status enum.
## merge mode (Hermes parity)
Add optional merge: boolean parameter (default false). When true,
incoming steps update existing ones by matching step text and new
steps are appended. When false, the entire plan is replaced.
Ref: Hermes tools/todo_tool.py write(todos, merge=False).
## activeForm field (Claude Code TodoWrite parity)
Add optional activeForm: string field on plan steps. Shows the
present-continuous form while in_progress (e.g. "Running tests"
instead of "Run tests"). Small schema addition with disproportionate
UX impact for plan rendering.
## Post-compaction plan hydration (Hermes parity)
New src/agents/plan-hydration.ts helper that formats active
(pending/in_progress) plan items for injection after context
compression. The injected text uses factual phrasing ("Your active
plan was preserved...") to avoid triggering the planning-only retry
guard's promise-language detection.
Ref: Hermes run_agent.py:6754-6756 + tools/todo_tool.py:format_for_injection().
Note: the compaction hook point in compact.ts is not wired in this
PR — that requires a follow-up to integrate with the compaction
checkpoint system (#62146). This PR provides the formatter; the
hook wiring is the next step.
Part of GPT 5.4 Enhancement v3 sprint. Tracking: #66345.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15d836e9fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryPorts three Hermes todo-tool features to Confidence Score: 5/5Safe to merge — all prior P1 findings are addressed and no new blocking issues found. The implementation is correct: merge mode is properly gated on a registered runId/context, the single-in_progress invariant is re-checked after merge, duplicate step text is caught at input time, and plan state persists correctly to AgentRunContext. The only remaining finding is a P2 style nit on the activeForm description string. No P0 or P1 issues remain. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/tools/update-plan-tool.ts
Line: 44-47
Comment:
**Redundant / contradictory `activeForm` description**
The two sentences say almost the same thing and partially contradict each other: the first implies the field is only for in_progress, while the second walks that back and says it's accepted on any status. Consider collapsing to a single clear sentence:
```suggestion
description:
'Present-continuous text shown while in_progress (e.g. "Running tests"). ' +
"Accepted on any status but only rendered for in_progress steps.",
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "fix(agents): #67514 P1+P2 — re-validate ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Ports Hermes task-system parity features into OpenClaw’s update_plan tool and introduces a helper for post-compaction plan hydration formatting, to preserve active plan context across turns.
Changes:
- Extend
update_planstep status set to includecancelled, and add optional per-stepactiveForm. - Add a
mergemode intended to update steps by matchingsteptext and appending new steps. - Add
formatPlanForHydration()to format active (pending/in_progress) steps for injection after context compaction.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/agents/tools/update-plan-tool.ts |
Adds cancelled, merge, and activeForm support to the update_plan schema and execution logic. |
src/agents/plan-hydration.ts |
Adds a formatter to produce a stable “active plan preserved” injection string after compaction. |
…rge mode The execute() third param is an AbortSignal/context, not a plan context, so context?.previousPlan was always undefined and merge mode was a no-op. Fall back to replace until PlanStore (#67542) provides previous-plan lookup.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8aee1aa6f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Add plan-hydration.test.ts: tests formatPlanForHydration returns null for empty/all-completed/all-cancelled steps, filters out completed and cancelled steps, includes pending and in_progress with correct markers, and validates preserved plan header format - Add update-plan-tool.parity.test.ts: tests cancelled status is accepted in schema, activeForm field is preserved in output, and merge=true with no previousPlan falls back to replace
Plan-mode rollout series — status updateThis PR is part of a 10-PR plan-mode rollout. The cumulative state ships locally as Series overview + landing order: see #68441 (latest comment). This PR's role in the series: see the original PR description above. Live test status: covered by the cumulative install — all behaviors from this PR are verified in production-like usage on Telegram + webchat. No regressions detected since the live install (2026-04-18). |
📋 Architecture & Status — single source of truth (commit
|
|
To use Codex here, create an environment for this repo. |
| }, | ||
| { additionalProperties: true }, | ||
| { additionalProperties: false }, | ||
| ), |
There was a problem hiding this comment.
UpdatePlanToolSchema now sets additionalProperties: false on each plan step object. That makes the published tool contract stricter than the implementation/tests (e.g. update-plan-tool.test.ts expects extra per-step keys like owner/notes to be tolerated and ignored). If the intent is to keep accepting unknown per-step fields for robustness/backwards-compat, keep additionalProperties enabled/omitted here; otherwise, update the tests/docs to reflect that extra keys are rejected at the schema level.
|
Closing in favor of consolidated PR #68939. Rationale: this branch was 734 commits behind upstream/main and the The full iteration history + decision log lives in |
TL;DR
Ports three Hermes todo-tool features to OpenClaw's `update_plan` tool — `cancelled` status for failed steps, `merge` mode for token-efficient partial updates, and `activeForm` for live progress text — plus a post-compaction plan hydration helper.
Tracking
What this PR does
1. `cancelled` status
Fourth plan step status: `pending → in_progress → completed | cancelled`. Marks steps abandoned due to failure. Without this, GPT-5 either silently drops failed steps or marks them `completed`, distorting the plan history.
2. `merge` mode
`merge: true` updates existing steps by text matching, appends new ones. `merge: false` (default) replaces the entire plan. Token-efficient on long plans — prevents accidental step drops during partial updates.
3. `activeForm` field
Present-continuous text for in-progress steps: `step: "Run tests"`, `activeForm: "Running tests"`. Foundation for plan rendering in CLI/Control UI/messaging.
4. Plan hydration helper
`formatPlanForHydration()` reinjects active plan steps after context compaction. Phrased as factual statement to avoid triggering `PLANNING_ONLY_PROMISE_RE`.
Files changed
Dependencies
What follows