Repository navigation
Conversation
|
Codex review: found issues before merge. Reviewed June 30, 2026, 12:19 PM ET / 16:19 UTC. Summary PR surface: Source +5081, Tests +2260, Docs +14, Generated +306, Other +3. Total +7664 across 38 files. Reproducibility: not applicable. as a current-main bug repro; the review findings are source-reproducible from the PR head and the current main state DB permission contract. Review metrics: 3 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the opt-in durable core behind the env flag, fix the shared DB permission lifecycle and projection control contract, then make the maintainer architecture decision alongside the RFC. Do we have a high-confidence way to reproduce the issue? Not applicable as a current-main bug repro; the review findings are source-reproducible from the PR head and the current main state DB permission contract. Is this the best way to solve the issue? No: the durable primitive is plausible and well isolated, but this implementation should not bypass shared state permission hardening or advertise write controls that have no live RPC/runtime path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5081, Tests +2260, Docs +14, Generated +306, Other +3. Total +7664 across 38 files. View PR surface stats
Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
4d0cbd3 to
42900b6
Compare
42900b6 to
32b2309
Compare
|
@clawsweeper re-review Updated the implementation branch to remove ledger-only CLI write controls. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
32b2309 to
4664e48
Compare
|
@clawsweeper re-review Updated implementation branch to address the two P1 findings:
The PR body now includes a proof matrix for focused regressions, typecheck, Kysely guardrails, enabled runtime projection, Gateway enabled/disabled behavior, redaction checks, fresh state creation, and upgrade schema smoke. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Update pushed for re-review. This update targets the prior durable-core proof gaps around schema lifecycle, upgrade safety, and restart behavior:
Local validation before push:
Requesting a fresh reviewer-agent look at whether the schema lifecycle, official-tag upgrade, and Gateway restart proof are now sufficient for the durable-core slice. |
|
@clawsweeper re-review Pushed durable-core proof update in db39743. Please re-check schema lifecycle guardrails, official-tag upgrade proof, Gateway restart proof, and the updated validation matrix. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Fixed the ClawSweeper P2 What changed:
Validation:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Replacement durable runtime stack submitted for review:
I am not closing this older PR yet. I will wait for reviewer/ClawSweeper feedback on the new PR stack first, then close or supersede the old PRs once the replacement direction is clear. |
What Problem This Solves
OpenClaw already has strong surfaces for sessions, background tasks, Task Flow, Workboard, subagents, and Gateway channels, but long-running multi-agent work can still become hard to reason about when it spans many steps or branches. The concrete failure mode this PR targets is coordinator silence: a parent turn starts child/subagent work, one child is still running or fails, the gateway restarts, and the operator no longer has a bounded durable projection of which run, child, step, or recovery state is open.
This PR adds an opt-in native durable coordination kernel for that missing layer. It is intentionally not a general-purpose Temporal/Restate clone and does not replace Task Flow/background tasks/Workboard. It gives those existing surfaces a shared local-first ledger for coordination identity, child links, fan-in readiness, restart recovery markers, and read-only observability.
Most useful validation evidence is below: focused regression tests cover the two ClawSweeper P1 state bugs, typecheck/build/guardrails pass, isolated enabled-runtime proof verifies Gateway projection and fan-in behavior, schema upgrade smoke preserves existing data, and a real OpenClaw A instance was updated to this branch and restarted with durable workflows enabled.
Summary
This replaces the cumulative implementation stack from #97468, #97469, and #97476 with one self-contained vertical slice for agent review.
It adds an opt-in native durable agent coordination kernel that records:
The goal is not to replace Task Flow/background tasks/Workboard. This PR gives those surfaces a shared, bounded coordination ledger for restart-safe multi-agent work.
Reviewer Feedback Addressed
state/openclaw.sqliteviaresolveOpenClawStateSqlitePath(...).src/state/openclaw-state-schema.sqland regenerated schema artifacts.OPENCLAW_DURABLE_WORKFLOWSto be explicitly enabled.durable.coordination.getreturns disabled without opening/creating durable state; this has a regression test.taskHash; it no longer stores the rawtaskbody.sessions_spawnnow passes the requester run id into the durable subagent mirror, and the bridge falls back to newest same-session parent only when older call paths do not provide a run id.completedAtwhen a terminal fan-in step returns towaiting_child.User Impact
This targets the class of bugs where long-running or branching agent work becomes silent or hard to recover:
Scope Boundaries
Evidence
Local proof environment: macOS local worktree, Node v25.8.1, commit
4664e48f67e76f3f488b2f9e2fade3e54183c588, isolatedOPENCLAW_STATE_DIRunder/var/folders/.../Texcept for the OpenClaw A runtime smoke below.node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/subagent.test.ts src/durable/fan-in.test.tswaiting_child, clearscompletedAt, and parent returns to waiting while later child runs.sessions_spawnplumbingnode scripts/run-vitest.mjs run --config test/vitest/vitest.agents-tools.config.ts src/agents/tools/sessions-spawn-tool.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.tsnpm run tsgo:corenode scripts/check-kysely-guardrails.mjsKysely guardrails OK.npm run format:check -- <8 touched files>andgit diff --checknpm run buildnode --import tsx -e '<isolated durable proof script>'waiting_child,waitingReason: child, children{ total: 2, running: 1, succeeded: 1, terminal: 1, open: 1 }. Final projection:succeeded/terminal, children{ total: 2, succeeded: 2, terminal: 2, open: 0 }.durable.coordination.getenabled/disabledok: true, projection children succeeded/open counts correct. Disabled responseok: false,INVALID_REQUEST,Durable workflows are disabled.containsRawPrompt: false,containsRawTask: false; prompt/task bodies are not stored raw in parent timeline payloads.state/openclaw.sqlitecreated with durable stats{ runs: 3, events: 15, steps: 4, openRuns: 0 };PRAGMA integrity_checkreturnedok.origin/main:src/state/openclaw-state-schema.sql, inserted sentineldiagnostic_eventsrow, then opened durable store on this branch[]. After: 7 durable tables (runs,events,steps,refs,links,timers,signals). Sentinel row preserved.PRAGMA integrity_checkreturnedok./Users/avo/aicos/providers/openclaw/worktrees/openclaw-x-durable-core/openclaw.mjswithOPENCLAW_DURABLE_WORKFLOWS=1;./runtime/supervisor/launchd/manage-openclaw-instance.sh local-a restart; then health/stats/agent checks{"ok":true,"status":"live"}. Logs showgateway ready,[durable/workflows] recorded durable gateway startup,[durable/recovery] started durable recovery worker, Discord bot probe resolved@bo, and channelbo-mainresolved. Existing agents list still includesboplus configured worker agents. Durable stats on existing local-a state returned runs/events without losing old config.Proof event sequence from the enabled run:
Known unrelated local-a warning during runtime smoke: the configured Telegram token is unauthorized and the gateway auth mode is explicitly
none; both predate this durable slice and do not affect the Discord Bo/durable startup path checked above.Follow-Up PRs If This Boundary Is Accepted
2026-06-30 Update: Schema Lifecycle And Restart Proof
Additional durable-core proof has been added on top of the earlier implementation slice:
durable_schema_migrations;v2026.6.1andv2026.6.10schemas;durable.coordination.getafter gateway startup reopens shared state.Latest local validation before push:
OPENCLAW_LOCAL_CHECK=0 node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfopassed;node scripts/generate-kysely-types.mjs --verifypassed;node scripts/check-kysely-guardrails.mjspassed;oxfmt --check --threads=1 <changed durable/state/gateway files>passed;git diff --checkpassed.