Skip to content

feat(durable): add durable session task runtime foundation - #98718

Closed
mjnkao wants to merge 12 commits into
openclaw:mainfrom
mjnkao:codex/openclaw-durable-runtime-foundation-v2-ready
Closed

mjnkao wants to merge 12 commits into
openclaw:mainfrom
mjnkao:codex/openclaw-durable-runtime-foundation-v2-ready

Conversation

@mjnkao

@mjnkao mjnkao commented Jul 1, 2026 •

Copy link
Copy Markdown

What Problem This Solves

This PR adds the opt-in, local-first durable runtime foundation proposed by PR1. The target failure mode is coordinator silence: long-running session/task/subagent work can continue across many steps, branches, and process restarts, but operators and runtime code need a bounded durable projection of which run, step, child, signal, or recovery state is open.

This is not a general-purpose workflow engine and does not include Work module, Workboard UI/tools, Task Flow projection adapters, or product-specific logic.

Dependency Chain

This is PR2 in the replacement durable runtime stack:

  1. PR1: durable session/task runtime RFC v2.
  2. PR2: durable runtime foundation, this PR.
  3. PR3: agent/session/subagent wiring on top of this foundation.

This PR is designed to be reviewable independently as a core foundation slice.

Summary

Adds:

  • durable_runtime_* tables in the shared OpenClaw state DB;
  • SQLite store lifecycle with schema version checks and shared state permission hardening;
  • runtime runs, steps, events, refs, links, timers, and signals;
  • local-first claim/release, heartbeat, recovery, and bounded worker helpers;
  • read-only CLI and Gateway inspection surfaces;
  • generic coordination projection with unsupported write controls disabled;
  • public packages/gateway-protocol schemas, inferred types, lazy validators, and validator tests for durable.coordination.get;
  • Kysely generated types and guardrails for the new schema;
  • public CLI docs for enablement, env vars, storage, and input retention.

Explicit Non-Scope

  • Work module behavior.
  • Workboard UI/tools.
  • Task Flow projection adapters.
  • Retention/compaction policy.
  • Postgres/multi-worker lease contention.
  • Automatic retry/resume policy.
  • Ledger-only write controls.

Latest Reviewer Follow-Up

Updated on 2026-07-03 after the latest ClawSweeper P1/P2 findings and proof refresh.

Head: cb0a5b5a9b0bcb46cd2f15469fd63c4db68d3358.

Addressed ClawSweeper findings:

  • Gateway startup still records the durable startup marker when OPENCLAW_DURABLE_RUNTIME=1, but agent-turn/chat-send/subagent mark-lost reconciliation now runs only with explicit OPENCLAW_DURABLE_WORKER=1.
  • durable.coordination.get now has public protocol params/result/projection schemas, inferred exported types, lazy validators, and validator tests.
  • The Gateway durable handler now uses validateDurableCoordinationGetParams and rejects invalid params before opening durable state.
  • Earlier disabled CLI, future-schema, and recovery-worker findings remain fixed: disabled inspection does not create or migrate shared state; unsupported newer durable schema versions are rejected before durable table DDL/ALTER/backfill; OPENCLAW_DURABLE_RUNTIME=1 alone does not start reconciliation.

Regression coverage added:

  • src/durable/startup.test.ts verifies runtime-enabled startup without the worker flag preserves running runs/steps, while worker-enabled startup marks them lost.
  • packages/gateway-protocol/src/index.test.ts covers the public durable coordination schemas and validators.
  • src/gateway/server-methods/durable.test.ts covers invalid-param rejection before durable state open plus disabled/enabled inspection behavior.
  • src/durable/recovery.test.ts and src/durable/sqlite-store.test.ts cover the explicit worker gate and future-schema guard.

Evidence

Latest validation:

  • node scripts/run-vitest.mjs run packages/gateway-protocol/src/index.test.ts
    • 1 file, 47 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts
    • 2 files, 6 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/startup.test.ts
    • 1 file, 2 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/recovery.test.ts src/durable/sqlite-store.test.ts src/durable/worker.test.ts src/durable/coordination-projection.test.ts
    • 4 files, 24 tests passed.
  • node scripts/generate-docs-map.mjs --check
    • passed with docs/docs_map.md is up to date.
  • npm run tsgo:core
    • passed.
  • git diff --check
    • passed.

Earlier post-rebase validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/recovery.test.ts src/durable/sqlite-store.test.ts src/durable/worker.test.ts src/durable/agent-turn.test.ts src/durable/subagent.test.ts src/durable/fan-in.test.ts
    • 6 files, 36 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.commands.config.ts src/commands/durable.test.ts
    • 1 file, 2 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts
    • 2 files, 4 tests passed.
  • node scripts/generate-docs-map.mjs --check
    • passed with docs/docs_map.md is up to date.
  • git diff --check origin/main HEAD
    • passed.

Live behavior proof remains in docs/specs/durable-runtime-foundation-pr-proof-2026-07-01.md and covers:

  • disabled CLI inspection returning the disabled message without creating durable state files;
  • enabled CLI inspection creating/opening <temp>/state/openclaw.sqlite;
  • disabled Gateway durable inspection rejecting before opening or migrating durable state;
  • enabled Gateway durable inspection reading a real durable projection from the opt-in shared state DB;
  • gateway startup mark-lost reconciliation gated behind explicit OPENCLAW_DURABLE_WORKER=1;
  • invalid durable Gateway params rejected before durable state open.

Full stack typecheck proof is recorded on PR3, which includes this PR2 foundation plus agent/session wiring.

Notes

This PR replaces the foundation portion of #97508 with smaller runtime-oriented naming and a narrower review boundary.

@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 size: XL labels Jul 1, 2026
@clawsweeper

clawsweeper Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 6:23 PM ET / 22:23 UTC.

Summary
Adds an opt-in durable session/task runtime foundation with shared SQLite tables, recovery helpers, read-only CLI and Gateway inspection, protocol schemas, docs, and focused tests.

PR surface: Source +7417, Tests +4196, Docs +309, Generated +318, Other +3. Total +12243 across 60 files.

Reproducibility: not applicable. this is a feature foundation PR rather than a bug report, and review used source inspection plus contributor-supplied positive CLI/Gateway proof.

Review metrics: 3 noteworthy metrics.

  • Durable env surfaces: 13 added. The new flags define runtime enablement, worker behavior, storage, recovery timing, input retention, heartbeat, and orchestration policy before merge.
  • Persistent schema surfaces: 8 tables added. The PR changes the shared state database and therefore needs upgrade, rollback, and data-retention ownership beyond green unit tests.
  • PR surface: 60 files changed, +12260/-17. The foundation spans docs, protocol, CLI, Gateway, state schema, durable runtime code, tests, and generated types, so owner review should stay broad.

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, durable storage schema: src/durable/worker.test.ts, durable storage schema: src/durable/worker.ts, migration/backfill/repair: src/commands/durable.test.ts, and 23 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • [P2] Get maintainer acceptance of the RFC, env, schema, upgrade, and privacy lifecycle before merge.
  • Run broad CI/build proof on the final merge result because the PR spans generated schema, protocol, Gateway, CLI, and durable runtime code.

Risk before merge

  • [P1] This adds 13 durable env knobs plus a public CLI/Gateway/protocol inspection surface, so maintainers need to accept the operator contract before merge.
  • [P1] This adds 8 persistent shared-state tables and schema-version lifecycle code; focused upgrade tests exist, but maintainers still own rollback and shipped-upgrade posture.
  • [P1] Durable intake stores bounded message previews by default and can store full input text when opted in, making the retention and operator-read policy security-sensitive.
  • [P1] This PR is stacked behind RFC docs: propose durable session task runtime RFC v2 #98717 and ahead of agent/session wiring feat(durable): wire agent session runtime coordination #98719; merging the foundation before the architecture boundary is accepted could freeze a core API prematurely.

Maintainer options:

  1. Gate on RFC and lifecycle signoff (recommended)
    Use docs: propose durable session task runtime RFC v2 #98717 as the architecture gate and require explicit maintainer acceptance of the env, schema, upgrade, and privacy contract before merging this foundation.
  2. Accept the opt-in foundation risk
    Maintainers can intentionally land the opt-in foundation as an experimental core substrate if they are comfortable owning future migration and retention policy.
  3. Pause the durable stack
    If the durable runtime boundary is not yet a core priority, pause or close this foundation and keep the discussion in the RFC until the product direction is settled.

Next step before merge

  • [P2] Keep on manual maintainer review because the remaining decision is architecture, upgrade, and retention-policy acceptance for a new core runtime surface, not a mechanical repair.

Security
Cleared: No concrete supply-chain, workflow, dependency, or secrets-handling defect was found in the diff, though the durable state and inspection surface remain security-sensitive merge risk.

Review details

Best possible solution:

Sequence this behind the RFC/product boundary, then merge only with explicit maintainer acceptance of the env, schema, privacy, and upgrade lifecycle plus final broad CI/build proof on the merge result.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a feature foundation PR rather than a bug report, and review used source inspection plus contributor-supplied positive CLI/Gateway proof.

Is this the best way to solve the issue?

Unclear as a product decision: the implementation now follows the opt-in shared-SQLite and protocol-validated shape, but the core durable runtime boundary needs maintainer acceptance before it can be called the best fix.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9c4274f94570.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body, comments, and proof doc include after-fix terminal/live outputs for disabled and enabled CLI/Gateway behavior plus file-state checks, which is sufficient for this non-visual CLI/RPC foundation.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body, comments, and proof doc include after-fix terminal/live outputs for disabled and enabled CLI/Gateway behavior plus file-state checks, which is sufficient for this non-visual CLI/RPC foundation.

Label justifications:

  • P2: This is a normal-priority opt-in feature foundation with meaningful maintainer impact but no current production regression or emergency.
  • merge-risk: 🚨 compatibility: New env flags, CLI commands, Gateway RPC, protocol schemas, and shared DB tables can become operator and upgrade contracts once merged.
  • merge-risk: 🚨 session-state: The foundation records and projects durable run, step, child, signal, timer, and recovery state that later session/agent wiring will rely on.
  • merge-risk: 🚨 security-boundary: The runtime stores work metadata and bounded user-message previews in shared state and exposes an operator-readable inspection RPC.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body, comments, and proof doc include after-fix terminal/live outputs for disabled and enabled CLI/Gateway behavior plus file-state checks, which is sufficient for this non-visual CLI/RPC foundation.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body, comments, and proof doc include after-fix terminal/live outputs for disabled and enabled CLI/Gateway behavior plus file-state checks, which is sufficient for this non-visual CLI/RPC foundation.
Evidence reviewed

PR surface:

Source +7417, Tests +4196, Docs +309, Generated +318, Other +3. Total +12243 across 60 files.

View PR surface stats
Area Files Added Removed Net
Source 34 7418 1 +7417
Tests 18 4196 0 +4196
Docs 5 325 16 +309
Config 0 0 0 0
Generated 2 318 0 +318
Other 1 3 0 +3
Total 60 12260 17 +12243

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs run packages/gateway-protocol/src/index.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/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/startup.test.ts.
  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/recovery.test.ts src/durable/sqlite-store.test.ts src/durable/worker.test.ts src/durable/coordination-projection.test.ts.
  • [P1] npm run tsgo:core.

What I checked:

  • PR metadata: Live PR data shows this PR is an open draft external PR at head cb0a5b5 with 60 changed files and an explicit PR2 foundation scope. (cb0a5b5a9b0b)
  • Feature flag and worker gate: Durable runtime is opt-in via OPENCLAW_DURABLE_RUNTIME, and worker behavior additionally requires OPENCLAW_DURABLE_WORKER. (src/durable/config.ts:18, cb0a5b5a9b0b)
  • Startup recovery gating: Gateway startup records a durable startup marker when enabled but only reconciles open agent/chat/subagent runs when the worker flag is also enabled. (src/durable/startup.ts:20, cb0a5b5a9b0b)
  • Recovery worker noop: The periodic durable recovery worker returns a noop unless isDurableWorkerEnabled is true. (src/durable/recovery.ts:825, cb0a5b5a9b0b)
  • Gateway disabled and invalid-param gates: durable.coordination.get rejects disabled runtime and invalid params before opening durable state. (src/gateway/server-methods/durable.ts:13, cb0a5b5a9b0b)
  • Schema version guard: The store creates the durable schema-migration table, checks future-version support, and only then creates durable_runtime_* tables. (src/durable/sqlite-store.ts:342, cb0a5b5a9b0b)

Likely related people:

  • steipete: Visible git history and shortlog show the largest number of commits on gateway run-loop, protocol, and server-method surfaces touched by this PR. (role: heavy gateway/CLI area contributor; confidence: high; commits: 4fec8073b12b, a65ab607c746, 1c26e806ffa3; files: src/cli/gateway-cli/run-loop.ts, packages/gateway-protocol/src/index.ts, src/gateway/server-methods.ts)
  • vincentkoc: Visible history includes recent changes on the queried state/protocol/gateway paths, and prior area history ties this handle to shared state and gateway review work. (role: recent adjacent contributor; confidence: medium; commits: e085fa1a3ffd; files: src/state/openclaw-state-db.ts, packages/gateway-protocol/src/index.ts, src/cli/gateway-cli/run-loop.ts)
  • Tak Hoffman: Shortlog and visible history show multiple commits in the gateway/protocol area, including runtime availability and catalog work adjacent to operator inspection surfaces. (role: adjacent gateway/runtime contributor; confidence: medium; commits: f5643544c286, 9c7823350bf6, 9e1a13bf4c6a; files: packages/gateway-protocol/src/index.ts, src/gateway/server-methods.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.

@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: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 1, 2026
@mjnkao

mjnkao commented Jul 1, 2026

Copy link
Copy Markdown
Author

Updated after ClawSweeper review:

  • moved the durable CLI feature-flag gate before opening the store, so disabled durable inspection does not create or migrate state/openclaw.sqlite;
  • added src/commands/durable.test.ts for disabled text and JSON no-mutation behavior;
  • added docs/cli/durable.md with CLI, env, storage, and retention contract;
  • updated Gateway/protocol docs to state disabled durable RPCs reject before opening or migrating durable state;
  • added source CLI command proof and Gateway handler proof to the PR body and proof doc.

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.commands.config.ts src/commands/durable.test.ts -> 1 file, 2 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts -> 2 files, 4 tests passed.
  • node scripts/generate-docs-map.mjs --check passed.
  • git diff --check passed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 1, 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 commented Jul 1, 2026

Copy link
Copy Markdown
Author

Additional real behavior proof for the durable runtime foundation follow-up:

Disabled CLI inspection does not create state:

STATE_DIR=/tmp/openclaw-durable-proof.PS98ys
Durable runtime is disabled. Set OPENCLAW_DURABLE_RUNTIME=1 to inspect durable runtime state.
after-disabled:

The follow-up filesystem check printed no files under the temp state dir. Enabled inspection then creates the shared state DB as expected:

Durable runtime store: /tmp/openclaw-durable-proof.PS98ys/state/openclaw.sqlite
runs=0 open=0 steps=0 events=0
after-enabled:
STATE_DIR/state/openclaw.sqlite

Disabled Gateway inspection rejects before opening durable state:

{"ok":false,"code":"INVALID_REQUEST","message":"Durable runtime is disabled.","hasResult":false}

Enabled Gateway inspection after creating a proof run returns the durable projection:

{"ok":true,"runtimeRunId":"run_gateway_proof"}

Focused validation:

node scripts/run-vitest.mjs run --config test/vitest/vitest.commands.config.ts src/commands/durable.test.ts
# 1 file, 2 tests passed

node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts
# 2 files, 4 tests passed

node scripts/generate-docs-map.mjs --check
# passed

git diff --check
# passed

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 1, 2026
@mjnkao

mjnkao commented Jul 2, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Updated PR #98718 with a fresh 2026-07-02 reviewer recheck proof at commit 519bae5c34ed.

Proof now appears in both places ClawSweeper asked reviewers to keep current:

  • PR body Evidence section;
  • docs/specs/durable-runtime-foundation-pr-proof-2026-07-01.md.

The refreshed proof shows:

  • disabled CLI inspection returns the disabled message and creates no files;
  • enabled CLI inspection opens <temp>/state/openclaw.sqlite and reports empty stats;
  • disabled Gateway durable inspection rejects before creating files;
  • enabled Gateway durable inspection returns run_gateway_proof_20260702 from the opt-in shared state DB.

Validation rerun after the proof refresh:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.commands.config.ts src/commands/durable.test.ts -> 1 file, 2 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts -> 2 files, 4 tests passed.
  • node scripts/generate-docs-map.mjs --check -> passed.
  • git diff --check -> passed.

@clawsweeper

clawsweeper Bot commented Jul 2, 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-runtime-foundation-v2-ready branch from 519bae5 to 3e39e28 Compare July 2, 2026 08:36
@mjnkao

mjnkao commented Jul 2, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Updated PR #98718 after the latest review findings.

Changes:

  • fixed P1 recovery safety gate: startDurableRecoveryWorker now requires the documented OPENCLAW_DURABLE_WORKER opt-in, so OPENCLAW_DURABLE_RUNTIME=1 alone does not start reconciliation;
  • fixed P1 future-schema guard: unsupported newer durable schema versions are rejected before any durable_runtime_* table DDL, ALTER, or backfill work;
  • rebased onto upstream origin/main commit 133ce01e4a, resolving the base conflict;
  • updated PR body and docs/specs/durable-runtime-foundation-pr-proof-2026-07-01.md.

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/recovery.test.ts src/durable/sqlite-store.test.ts src/durable/worker.test.ts src/durable/agent-turn.test.ts src/durable/subagent.test.ts src/durable/fan-in.test.ts -> 6 files, 36 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.commands.config.ts src/commands/durable.test.ts -> 1 file, 2 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts -> 2 files, 4 tests passed.
  • node scripts/generate-docs-map.mjs --check -> passed.
  • git diff --check origin/main HEAD -> passed.

@clawsweeper

clawsweeper Bot commented Jul 2, 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.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Jul 2, 2026
@mjnkao

mjnkao commented Jul 2, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Updated PR #98718 after the latest P1/P2 review findings.

Changes:

  • gated gateway-startup mark-lost reconciliation behind explicit OPENCLAW_DURABLE_WORKER=1, while preserving the startup record path for OPENCLAW_DURABLE_RUNTIME=1;
  • added public packages/gateway-protocol schemas, inferred exported types, lazy validators, and validator tests for durable.coordination.get;
  • switched the Gateway durable handler to validateDurableCoordinationGetParams and reject invalid params before opening durable state;
  • updated docs/specs/durable-runtime-foundation-pr-proof-2026-07-01.md with the new proof.

Validation:

  • node scripts/run-vitest.mjs run packages/gateway-protocol/src/index.test.ts -> 1 file, 47 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts -> 2 files, 6 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/startup.test.ts -> 1 file, 2 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/recovery.test.ts src/durable/sqlite-store.test.ts src/durable/worker.test.ts src/durable/coordination-projection.test.ts -> 4 files, 24 tests passed.
  • node scripts/generate-docs-map.mjs --check passed.
  • npm run tsgo:core passed.
  • git diff --check passed.

@clawsweeper

clawsweeper Bot commented Jul 2, 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. labels Jul 2, 2026
@mjnkao

mjnkao commented Jul 2, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Refreshed the PR body for current head cb0a5b5a9b0bcb46cd2f15469fd63c4db68d3358 so the Latest Reviewer Follow-Up and Evidence sections match the latest proof already recorded in docs/specs/durable-runtime-foundation-pr-proof-2026-07-01.md.

This is body/proof metadata only: no code changes. The body now records the gateway startup worker gate, public protocol validators, invalid-param-before-open handling, and latest validation commands.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 2, 2026
@mjnkao

mjnkao commented Jul 7, 2026

Copy link
Copy Markdown
Author

Superseded by #101828, which restates the durable-core scope with a clearer RFC/root-cause/test-plan review gate.

The new PR keeps this stack durable-core-only: Workboard/TaskFlow and product workflow surfaces are out of scope. Closing this older PR to avoid review confusion; implementation PRs will follow sequentially after #101828 is reviewed.

@mjnkao mjnkao closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant