Skip to content

feat(durable): add opt-in agent coordination kernel - #97508

Closed
mjnkao wants to merge 3 commits into
openclaw:mainfrom
mjnkao:codex/openclaw-durable-agent-coordination
Closed

mjnkao wants to merge 3 commits into
openclaw:mainfrom
mjnkao:codex/openclaw-durable-agent-coordination

Conversation

@mjnkao

@mjnkao mjnkao commented Jun 28, 2026 •

Copy link
Copy Markdown

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:

  • workflow runs, steps, events, refs, timers, signals, and child links;
  • agent-turn lifecycle checkpoints;
  • read-only Gateway coordination projection;
  • CLI inspection helpers;
  • subagent child-run recording and fan-in state.

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

  • No sidecar DB by default. Durable tables live in the canonical shared state database at state/openclaw.sqlite via resolveOpenClawStateSqlitePath(...).
  • Shared schema lifecycle. Durable tables are added to src/state/openclaw-state-schema.sql and regenerated schema artifacts.
  • Disabled by default. Runtime hooks and Gateway reads require OPENCLAW_DURABLE_WORKFLOWS to be explicitly enabled.
  • Disabled read is non-mutating. durable.coordination.get returns disabled without opening/creating durable state; this has a regression test.
  • No raw subagent task persistence. Subagent coordination metadata stores ids, bounded labels/names, and taskHash; it no longer stores the raw task body.
  • No ledger-only operator controls. The initial CLI surface is read-only inspection; cancel/retry/resume/signal write controls were removed until they can route through the live task/agent runtime contract.
  • Active parent binding. sessions_spawn now 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.
  • Fan-in reopen. Registering a later child now reconciles fan-in immediately and clears stale completedAt when a terminal fan-in step returns to waiting_child.

User Impact

This targets the class of bugs where long-running or branching agent work becomes silent or hard to recover:

  • parent agent waits on subagents but cannot tell which child is still open;
  • one failed child should not block unrelated sibling completion;
  • gateway restart should not erase where a coordinated run was;
  • operators need a bounded timeline/projection instead of scraping sessions or plugin state.

Scope Boundaries

  • Feature is opt-in and experimental.
  • Normal chat turns are unchanged while the flag is off.
  • This does not add CLI write controls, retention/compaction, Postgres, or multi-worker leases.
  • This does not change Task Flow or Workboard semantics yet; it provides primitives they can project onto later.

Evidence

Local proof environment: macOS local worktree, Node v25.8.1, commit 4664e48f67e76f3f488b2f9e2fade3e54183c588, isolated OPENCLAW_STATE_DIR under /var/folders/.../T except for the OpenClaw A runtime smoke below.

Reviewer ask Command / proof Observed result
Parent-run association bug node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/subagent.test.ts src/durable/fan-in.test.ts 2 files, 7 tests passed. New regression verifies same-session overlap links children to requester run id and fallback selects newest parent.
Fan-in reopen bug Same durable test command New regression verifies terminal fan-in step reopens to waiting_child, clears completedAt, and parent returns to waiting while later child runs.
sessions_spawn plumbing node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-tools.config.ts src/agents/tools/sessions-spawn-tool.test.ts 1 file, 53 tests passed.
Subagent lifecycle compatibility node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts 1 file, 8 tests passed.
Typecheck npm run tsgo:core Passed.
SQLite/Kysely guardrail node scripts/check-kysely-guardrails.mjs Kysely guardrails OK.
Format / whitespace npm run format:check -- <8 touched files> and git diff --check Passed.
Build npm run build Passed; generated runtime/UI/plugin artifacts built successfully.
Enabled agent turn + subagent fan-in + CLI/Gateway projection node --import tsx -e '<isolated durable proof script>' Created 3 runs, 4 steps, 15 events. Waiting projection: 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 }.
Gateway durable.coordination.get enabled/disabled Same proof script calling the Gateway handler Enabled response ok: true, projection children succeeded/open counts correct. Disabled response ok: false, INVALID_REQUEST, Durable workflows are disabled.
Redaction / bounded payloads Same proof script inspected parent timeline payloads containsRawPrompt: false, containsRawTask: false; prompt/task bodies are not stored raw in parent timeline payloads.
Fresh schema creation Same proof script on empty isolated state state/openclaw.sqlite created with durable stats { runs: 3, events: 15, steps: 4, openRuns: 0 }; PRAGMA integrity_check returned ok.
Upgrade schema smoke Created DB from origin/main:src/state/openclaw-state-schema.sql, inserted sentinel diagnostic_events row, then opened durable store on this branch Before durable tables: []. After: 7 durable tables (runs, events, steps, refs, links, timers, signals). Sentinel row preserved. PRAGMA integrity_check returned ok.
Real local OpenClaw A update/restart smoke LaunchAgent points to /Users/avo/aicos/providers/openclaw/worktrees/openclaw-x-durable-core/openclaw.mjs with OPENCLAW_DURABLE_WORKFLOWS=1; ./runtime/supervisor/launchd/manage-openclaw-instance.sh local-a restart; then health/stats/agent checks Health returned {"ok":true,"status":"live"}. Logs show gateway ready, [durable/workflows] recorded durable gateway startup, [durable/recovery] started durable recovery worker, Discord bot probe resolved @bo, and channel bo-main resolved. Existing agents list still includes bo plus configured worker agents. Durable stats on existing local-a state returned runs/events without losing old config.

Proof event sequence from the enabled run:

agent.turn.received
agent.turn.running
subagent.child.linked
fan_in.partial
subagent.child.linked
fan_in.partial
subagent.child.terminal
fan_in.partial
subagent.child.terminal
fan_in.ready
agent.turn.succeeded

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

  • Live Gateway restart proof on a running OpenClaw instance, plus any bug fixes found there.
  • Retention/compaction policy for durable events.
  • Task Flow and Workboard projections.
  • Multi-worker lease contention tests.

2026-06-30 Update: Schema Lifecycle And Restart Proof

Additional durable-core proof has been added on top of the earlier implementation slice:

  • explicit durable schema version tracking via durable_schema_migrations;
  • future-schema guard before durable workflow DDL, indexes, or column backfills;
  • regression proving a future-version DB is rejected without mutating durable workflow tables;
  • regression proving durable tables can be added to released pre-durable shared-state shapes while preserving existing rows;
  • official upstream tag upgrade probe against v2026.6.1 and v2026.6.10 schemas;
  • recovery proof for persisted running agent turns after store reopen;
  • Gateway-level proof that an in-flight coordination run remains inspectable through durable.coordination.get after gateway startup reopens shared state.

Latest local validation before push:

  • durable unit matrix: 6 files passed, 23 tests passed;
  • gateway durable matrix: 2 files passed, 6 tests passed;
  • state DB matrix: 3 files passed, 26 passed, 1 skipped;
  • OPENCLAW_LOCAL_CHECK=0 node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo passed;
  • node scripts/generate-kysely-types.mjs --verify passed;
  • node scripts/check-kysely-guardrails.mjs passed;
  • oxfmt --check --threads=1 <changed durable/state/gateway files> passed;
  • git diff --check passed.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed June 30, 2026, 12:19 PM ET / 16:19 UTC.

Summary
The branch adds an opt-in core durable coordination kernel with shared SQLite workflow state, agent/subagent lifecycle recording, read-only CLI and Gateway projections, and schema/upgrade tests.

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.

  • Persistent schema surface: 8 durable tables added. The PR changes the shared state database shape, so fresh-install and upgrade behavior must be accepted before merge.
  • Environment surface: 4 env variables added. New operator flags and timing knobs create setup and support surface even while the feature is opt-in.
  • PR surface: 38 files changed, +7667/-3. The change spans core state, gateway, CLI, agents, generated schema, docs, and tests, which keeps it on the manual maintainer path.

Stored data model
Persistent data-model change detected: database schema: src/durable/sqlite-store.test.ts, database schema: src/state/openclaw-state-schema.generated.ts, database schema: src/state/openclaw-state-schema.sql, serialized state: src/agents/tools/sessions-spawn-tool.ts, serialized state: src/commands/durable.ts, serialized state: src/state/openclaw-state-db.generated.d.ts, and 16 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Reuse or factor shared state DB private-mode hardening for durable store opens.
  • Return only actually supported durable controls in the Gateway projection.
  • Have maintainers decide the durable-core boundary with docs: propose durable agent coordination kernel #97507 before landing the draft.

Risk before merge

  • [P1] The durable SQLite opener can create the canonical shared state DB and WAL files without the existing private-mode hardening, leaving durable run/session metadata at filesystem umask defaults when this path is first opener.
  • [P1] The Gateway projection advertises cancel/retry/resume/signal controls even though the PR only exposes read-only durable.coordination.get, so downstream clients can show controls that cannot execute.
  • [P1] The PR adds persistent durable schema and env-gated gateway recovery hooks; maintainers still need to explicitly accept the core durable boundary before this draft lands.

Maintainer options:

  1. Fix the hardening and control contract first (recommended)
    Before merge, reuse or factor the shared state DB permission hardening for durable opens and report unsupported write controls as unavailable until live control RPCs exist.
  2. Accept the experimental core risk explicitly
    Maintainers may choose to land the opt-in kernel as an experimental core primitive while owning the shared schema, state, and follow-up API commitments.
  3. Pause for the RFC decision
    Because docs: propose durable agent coordination kernel #97507 is still the architecture decision point, maintainers can keep this draft paused until the durable-core boundary is approved.

Next step before merge

  • [P2] Draft broad core/state feature needs maintainer boundary approval and patch fixes before merge.

Security
Needs attention: The diff has one concrete privacy hardening gap: durable SQLite opens can create shared state files without the existing private-mode helper.

Review findings

  • [P2] Harden the shared state DB open path — src/durable/sqlite-store.ts:596-599
  • [P2] Do not advertise unsupported write controls — src/durable/coordination-projection.ts:270-285
Review details

Best 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:

  • [P2] Harden the shared state DB open path — src/durable/sqlite-store.ts:596-599
    This durable store can be the first code path to create state/openclaw.sqlite, but it only creates the directory and opens DatabaseSync. The existing shared state DB opener hardens the DB, WAL, and SHM files because the state DB contains credentials-adjacent metadata; durable should reuse or factor that permission path before/after open so opt-in durable metadata is not left at umask-dependent file modes.
    Confidence: 0.9
  • [P2] Do not advertise unsupported write controls — src/durable/coordination-projection.ts:270-285
    The projection marks cancel/retry/resume/signal as available based only on durable status, but this PR intentionally exposes only read-only durable.coordination.get and removed CLI write controls. Operator clients reading the documented supported controls can show dead controls that are not routed through the live agent/task runtime, so keep these false or omit them until matching write contracts exist.
    Confidence: 0.87

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865.

Label changes

Label justifications:

  • P2: This is a normal-priority opt-in core feature with important state/runtime implications but no current production regression.
  • merge-risk: 🚨 compatibility: The PR adds shared-state schema tables and new env-gated runtime behavior that must be upgrade-safe for existing state databases.
  • merge-risk: 🚨 session-state: The durable layer records agent turns, subagent links, fan-in state, and recovery markers that can mis-associate or stale session/workflow state if wrong.
  • merge-risk: 🚨 security-boundary: The durable store can create shared SQLite files without the existing private-mode state DB hardening for credentials-adjacent metadata.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 🛠️ actively grinding: The PR author has acted after the latest ClawSweeper review and work remains. Sufficient (logs): The PR body and latest comments include after-fix real OpenClaw runtime restart proof with durable workflows enabled plus isolated Gateway projection and upgrade-smoke output.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and latest comments include after-fix real OpenClaw runtime restart proof with durable workflows enabled plus isolated Gateway projection and upgrade-smoke output.
Evidence reviewed

PR surface:

Source +5081, Tests +2260, Docs +14, Generated +306, Other +3. Total +7664 across 38 files.

View PR surface stats
Area Files Added Removed Net
Source 26 5083 2 +5081
Tests 8 2260 0 +2260
Docs 1 14 0 +14
Config 0 0 0 0
Generated 2 306 0 +306
Other 1 4 1 +3
Total 38 7667 3 +7664

Security concerns:

  • [medium] Shared SQLite files bypass private-mode hardening — src/durable/sqlite-store.ts:596
    The durable store writes session/run coordination metadata into the canonical state database but does not call the current state DB permission hardening path, so first-open durable files can inherit default filesystem permissions.
    Confidence: 0.88

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/sqlite-store.test.ts src/durable/recovery.test.ts src/durable/coordination-projection.test.ts src/durable/fan-in.test.ts src/durable/executor.test.ts src/durable/subagent.test.ts.
  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts.
  • [P1] node scripts/generate-kysely-types.mjs --verify.
  • [P1] node scripts/check-kysely-guardrails.mjs.
  • [P1] git diff --check.

What I checked:

  • Live PR context: this PR is open, draft, mergeable, at head e95b669; it changes 38 files with 7667 additions and 3 deletions and includes real runtime proof in the body/comments. (e95b669cdb25)
  • Current main lacks the durable implementation: Current main only has docs/gateway/protocol.md under the queried durable/Gateway paths; the new src/durable tree and durable Gateway method are PR-only, so this is not implemented on main. (6cb82eaab865)
  • Durable store creates the shared SQLite DB directly: The PR opens the canonical durable/shared state path after mkdir only, without the existing shared-state permission hardening path. (src/durable/sqlite-store.ts:596, e95b669cdb25)
  • Main state DB permission contract: Current main hardens the default state dir and SQLite database sidecar files because the default state contains credentials-adjacent metadata. (src/state/openclaw-state-db.ts:89, 6cb82eaab865)
  • Projection advertises unsupported write controls: The projection returns canCancel/canRetry/canResume/canSignal from run status even though this slice removed operator write controls. (src/durable/coordination-projection.ts:270, e95b669cdb25)
  • Gateway exposes only read-only durable RPC: The only durable Gateway method registered by the PR is durable.coordination.get with operator.read scope. (src/gateway/methods/core-descriptors.ts:100, e95b669cdb25)

Likely related people:

  • Peter Steinberger: Shortlog/history shows the largest share of recent changes in the gateway agent handler and subagent/session-spawn surfaces that this PR extends. (role: heavy current-main area contributor; confidence: high; commits: 3b2db583cdb1, d6bb36730b50, cfbef8035dd1; files: src/gateway/server-methods/agent.ts, src/agents/subagent-registry-run-manager.ts, src/agents/tools/sessions-spawn-tool.ts)
  • Vincent Koc: Recent current-main commits touch gateway agent handling, tasks, and subagent routing boundaries related to durable coordination. (role: recent adjacent contributor; confidence: medium; commits: e085fa1a3ffd, 7cd0ff2d888f, 53bcd5769ef4; files: src/gateway/server-methods/agent.ts, src/agents/subagent-registry-run-manager.ts)
  • pick-cat: Blame/log attribute the current shared state DB permission hardening helper to this commit author. (role: state DB permission helper author; confidence: medium; commits: eb5fb2aa69f4; files: src/state/openclaw-state-db.ts)
  • Tyler Yust: History includes prior subagent lifecycle and descendant gating work on the paths this PR mirrors into durable state. (role: subagent lifecycle contributor; confidence: medium; commits: 81b93b9ce04b; files: src/agents/subagent-registry-run-manager.ts, src/agents/tools/sessions-spawn-tool.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@mjnkao
mjnkao force-pushed the codex/openclaw-durable-agent-coordination branch from 4d0cbd3 to 42900b6 Compare June 28, 2026 14:56
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 28, 2026
@mjnkao
mjnkao force-pushed the codex/openclaw-durable-agent-coordination branch from 42900b6 to 32b2309 Compare June 28, 2026 15:11

mjnkao commented Jun 28, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Updated the implementation branch to remove ledger-only CLI write controls. openclaw durable is now read-only inspection in this initial slice; live cancel/retry/resume/signal controls are deferred until they can route through the real task/agent runtime contract.

@clawsweeper

clawsweeper Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@mjnkao
mjnkao force-pushed the codex/openclaw-durable-agent-coordination branch from 32b2309 to 4664e48 Compare June 28, 2026 18:08
@mjnkao

mjnkao commented Jun 28, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Updated implementation branch to address the two P1 findings:

  • parent association now uses requester run id from sessions_spawn durable lineage and falls back to newest same-session parent only when no requester run id is available;
  • fan-in now reconciles on later child registration and reopens terminal fan-in state back to waiting_child with completedAt cleared.

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.

@clawsweeper

clawsweeper Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 28, 2026
@mjnkao

mjnkao commented Jun 30, 2026

Copy link
Copy Markdown
Author

Update pushed for re-review.

This update targets the prior durable-core proof gaps around schema lifecycle, upgrade safety, and restart behavior:

  • added explicit durable schema version tracking via durable_schema_migrations;
  • added a future-schema guard before durable workflow DDL, indexes, or column backfills run;
  • added regressions proving future-version DBs are rejected without mutating durable workflow tables;
  • added shared-state compatibility proof for adding durable tables to existing pre-durable OpenClaw state DB shapes;
  • added release-upgrade proof against official upstream tag schemas for v2026.6.1 and v2026.6.10;
  • added recovery proof for persisted running agent turns after store reopen;
  • added Gateway-level proof that an in-flight coordination run remains inspectable through durable.coordination.get after gateway startup reopens shared state.

Local validation before push:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/sqlite-store.test.ts src/durable/recovery.test.ts src/durable/coordination-projection.test.ts src/durable/fan-in.test.ts src/durable/executor.test.ts src/durable/subagent.test.ts — 6 files passed, 23 tests passed
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts — 2 files passed, 6 tests passed
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/state/openclaw-state-db.test.ts src/state/openclaw-state-db.permissions.test.ts src/state/sqlite-query-plan.test.ts — 3 files passed, 26 passed, 1 skipped
  • OPENCLAW_LOCAL_CHECK=0 node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo
  • node scripts/generate-kysely-types.mjs --verify
  • node scripts/check-kysely-guardrails.mjs
  • oxfmt --check --threads=1 <changed durable/state/gateway files>
  • git diff --check

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.

@mjnkao

mjnkao commented Jun 30, 2026

Copy link
Copy Markdown
Author

@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.

@clawsweeper

clawsweeper Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 30, 2026
@mjnkao

mjnkao commented Jun 30, 2026

Copy link
Copy Markdown
Author

Fixed the ClawSweeper P2 ok outcome mapper finding in e95b669.

What changed:

  • Map real SubagentRunOutcome.status === "ok" to durable succeeded.
  • Extend the durable bridge regression so an ok terminal outcome persists child/link metadata and status as succeeded.
  • Add a lifecycle-path regression that exercises sessions_spawn -> agent.wait ok -> subagent registry -> recordDurableSubagentTerminal against a real durable SQLite store, including parent-child link status.

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/subagent.test.ts src/durable/fan-in.test.ts passed: 2 files, 7 tests.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts passed: 1 file, 9 tests.
  • ./node_modules/.bin/oxfmt --check --threads=1 src/durable/subagent.ts src/durable/subagent.test.ts src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts passed.
  • git diff --check passed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 30, 2026
@mjnkao

mjnkao commented Jul 1, 2026

Copy link
Copy Markdown
Author

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.

@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 2, 2026
@mjnkao mjnkao closed this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations docs Improvements or additions to documentation feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant