Skip to content

feat(durable): wire agent session runtime coordination - #98719

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

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

Conversation

@mjnkao

@mjnkao mjnkao commented Jul 1, 2026 •

Copy link
Copy Markdown

What Problem This Solves

This PR wires the durable runtime foundation from PR2 into agent/session/subagent paths so OpenClaw can record durable context for chat sends, agent runs, subagent child runs, parent fan-in, yield progress, and restart/recovery inspection.

The target behavior is: parent agents should have durable child/fan-in state; one failed child should not make sibling completion invisible; and Gateway/session restart should leave inspectable runtime state instead of silent coordinator ambiguity.

Dependency Chain

This is PR3 in the replacement durable runtime stack:

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

This branch is stacked on the refreshed PR2 branch. The upstream PR diff against main is cumulative. For delta-only review after PR2, use:

https://github.com/mjnkao/openclaw/compare/codex/openclaw-durable-runtime-foundation-v2-ready...codex/openclaw-durable-runtime-agent-v2-ready

Summary

Adds:

  • Gateway chat.send and agent.run durable context refs;
  • user-turn transcript durable context propagation;
  • embedded-agent yield progress for resumable parent turns;
  • subagent child-run mirroring and parent fan-in association;
  • task completion contract metadata for durable parent/child lifecycle;
  • status-notice display metadata for durable/yield progress;
  • protocol schema fields for durable context references.

Explicit Non-Scope

  • Planner/product modules.
  • Board-style UI/tools.
  • Projection adapters.
  • Retention/compaction.
  • Postgres/multi-worker lease contention.
  • Durable write controls such as cancel/retry/resume/signal.

Latest Reviewer Follow-Up

Updated on 2026-07-03 after the latest ClawSweeper default prompt guidance finding, durable context terminology cleanup, and proof refresh.

Head: 654dc5c5f9532630a775a6ef5579c531ff25f554.

Addressed ClawSweeper findings:

  • Default durable-disabled prompts again include Larger work: use `sessions_spawn`; completion is push-based. while durable-specific Sub-agent orchestration wording remains gated behind durable policy/runtime enablement.
  • ACP manual-spawn CLI task suppression is limited to the trusted in-process gateway-client backend caller, excludes device-token auth, and still requires persisted ACP child metadata.
  • Device-token backend and operator-write ACP-shaped calls keep CLI task tracking.
  • Reused failed, timeout, and killed terminal session state is cleared only for visible user requests.
  • Heartbeat/cron/internal terminal-session reuse preserves terminal status, timing, runtime, and abort markers.
  • Durable agent/session test fixtures now use task/session-task terminology rather than module-specific work-unit examples; runtime behavior and schema compatibility are unchanged.
  • Earlier QR display, oversized-history idempotency, default prompt compatibility, and durable foundation follow-ups remain fixed on this stacked branch.

Regression coverage added:

  • src/agents/system-prompt.test.ts now asserts the default larger-work sessions_spawn guidance remains present, while existing tests keep durable orchestration wording on enabled paths only.
  • src/gateway/server-methods/agent.test.ts covers trusted ACP suppression, device-token ACP-shaped fallback tracking, operator-write ACP-shaped fallback tracking, plugin-subagent precedence, visible terminal reuse cleanup, and heartbeat terminal-state preservation.
  • src/gateway/server-chat.agent-events.test.ts covers agent event behavior after the Gateway agent-method changes.
  • Durable fan-in/yield/subagent/intake tests cover bounded intake envelopes, yielded parent turns, subagent terminal fan-in, failed continuation visibility, and parent fan-in reopening for later children.
  • Durable, gateway, agent-tool, history-omission, session-utils, and system-prompt shards were rerun to keep PR2/PR3 integration proof current.

Evidence

Latest validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/intake-envelope.test.ts src/durable/agent-turn.test.ts src/durable/subagent.test.ts src/durable/fan-in.test.ts
    • 4 files, 17 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/agent.test.ts
    • 2 files, 358 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-tools.config.ts src/agents/tools/sessions-spawn-tool.test.ts src/agents/tools/gateway-tool.test.ts
    • 2 files, 67 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 focused validation remains recorded in docs/specs/durable-runtime-agent-session-pr-proof-2026-07-01.md, including:

  • Gateway/context/server-methods shard: 6 files, 176 tests passed;
  • agent tools shard: 2 files, 67 tests passed;
  • durable fan-in/subagent/agent-turn shard: 3 files, 14 tests passed;
  • Gateway durable matrix: 2 files, 4 tests passed;
  • QR sensitive pairing display regression: 2 files, 262 tests passed;
  • oversized-history metadata regression shard: 7 files, 549 tests passed;
  • server-chat agent events shard: 1 file, 99 tests passed;
  • Gateway durable/history/session-utils shard: 7 files, 293 tests passed;
  • durable orchestration prompt compatibility shard: 1 file, 92 tests passed;
  • Kysely verify and guardrails checks passed;
  • npm run tsgo:core, npm run tsgo:core:test, and npm run tsgo:prod passed on the stacked branch.

Local Build Note

env CI=true npm run build was attempted locally. Dependency installation and bundled plugin assets completed, then the root tsdown build emitted only heartbeat lines for more than ten minutes and was manually interrupted. This is not recorded as passing build proof; CI or a maintainer machine should still run the full build before merge.

Notes

This PR replaces the agent/session/subagent wiring portion of #97508 with runtime-oriented naming and a narrower dependency chain.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL labels Jul 1, 2026
@clawsweeper

clawsweeper Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 6:00 AM ET / 10:00 UTC.

Summary
The branch wires the durable runtime foundation into Gateway chat/agent/session/subagent flows, adds durable context references and task-completion metadata, updates docs/proof, and adds regression tests.

Reproducibility: yes. for the introduced patch regression: source inspection shows reused terminal sessions now call clearAllCliSessions even when the session id is preserved.

Review metrics: 3 noteworthy metrics.

  • Durable Env Surface: 13 added. New durable environment knobs affect enablement, worker timing, recovery, input retention, and store behavior, so operator compatibility needs maintainer review before merge.
  • Shared-State Schema Surface: 8 tables added. The durable runtime writes coordination data into the canonical shared SQLite state DB, making schema lifecycle and upgrade proof merge-critical.
  • Gateway Protocol Surface: 1 RPC added, 2 request params added. durable.coordination.get plus contextRefs on chat and agent requests become client-visible protocol contracts.

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 30 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦪 silver shellfish
Patch quality: 🧂 unranked krab
Result: blocked until stronger real behavior proof is added.

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

Rank-up moves:

  • [P1] Fix CLI binding preservation for reused terminal sessions and add a focused regression with existing CLI bindings present.
  • [P1] Refresh exact-head gateway agent/durable behavior proof after the fix.
  • Get maintainer acceptance of the stacked durable runtime schema/protocol boundary before final merge review.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Earlier terminal/script proof exists, but the latest 5cb2602 conflict-resolution code change is not covered by exact-head runtime proof and the focused Gateway agent shard was interrupted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P2] Merging the current head would delete provider CLI session bindings when reusing a failed/timeout/killed terminal session, even though the session id is preserved for transcript continuity.
  • [P1] The PR is stacked on open RFC/foundation PRs and adds durable runtime schema, protocol, Gateway, CLI, and env surfaces that require maintainer product and upgrade-boundary acceptance.
  • [P1] Exact-head proof is stale after the latest merge-conflict update: the body names an earlier head, full build proof is still missing, and the focused Gateway agent shard was interrupted.

Maintainer options:

  1. Restore CLI Binding Preservation (recommended)
    Change the clearAllCliSessions guard back to rotation-only behavior and add a terminal reuse regression that includes cliSessionIds/claudeCliSessionId before further merge review.
  2. Refresh Exact-Head Proof
    After the regression fix, rerun the focused gateway agent shard and provide exact-head proof for the durable agent/session wiring plus a full build or CI build confirmation.
  3. Wait For Durable Boundary Decision
    Maintain the draft stack until PR1/PR2 establish the accepted durable runtime schema, protocol, and storage contract that this wiring depends on.

Next step before merge

  • [P1] Human review is needed because the PR has a concrete terminal-session regression plus broad maintainer-owned durable runtime schema/protocol decisions.

Security
Cleared: Dedicated security review found no concrete new dependency, workflow, secret-handling, or third-party execution concern; durable input retention remains an opt-in product/compatibility surface to review.

Review findings

  • [P1] Preserve CLI bindings when reusing a terminal session — src/gateway/server-methods/agent.ts:2262-2263
Review details

Best possible solution:

Fix terminal-session CLI binding preservation, refresh exact-head behavior and upgrade proof, and keep PR3 behind maintainer acceptance of the PR1/PR2 durable runtime boundary.

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

Yes for the introduced patch regression: source inspection shows reused terminal sessions now call clearAllCliSessions even when the session id is preserved.

Is this the best way to solve the issue?

No: the durable wiring may be a plausible product direction, but the current head must preserve existing CLI binding behavior and get maintainer approval for the stacked durable runtime boundary before it is the best fix.

Full review comments:

  • [P1] Preserve CLI bindings when reusing a terminal session — src/gateway/server-methods/agent.ts:2262-2263
    Current main only clears CLI bindings when the session id rotates; terminal recovery that reuses the same failed/timeout/killed session keeps provider CLI bindings so the next call continues the same conversation. This guard now runs for all terminal-state cleanup, so a visible recovery preserves the session id while deleting cliSessionIds/claudeCliSessionId and can fork the provider session. Keep clearAllCliSessions gated to rotation and cover reused terminal rows with CLI bindings.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 36dd9ee3c3c1.

Label changes

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Earlier terminal/script proof exists, but the latest 5cb2602 conflict-resolution code change is not covered by exact-head runtime proof and the focused Gateway agent shard was interrupted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a broad feature PR with a concrete blocking regression and compatibility-sensitive durable runtime surfaces, but it is still draft and not an active shipped outage.
  • merge-risk: 🚨 compatibility: The PR adds env knobs, protocol fields, CLI/Gateway surfaces, and shared-state schema that can affect upgrades and operator setup.
  • merge-risk: 🚨 session-state: The PR changes durable agent/session/subagent identity, fan-in, recovery, and persisted coordination state.
  • merge-risk: 🚨 message-delivery: The PR touches chat.send, agent.run, subagent completion, yield progress, and context propagation paths where mis-association can hide or misroute messages.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Earlier terminal/script proof exists, but the latest 5cb2602 conflict-resolution code change is not covered by exact-head runtime proof and the focused Gateway agent shard was interrupted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/agent.test.ts.
  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/intake-envelope.test.ts src/durable/agent-turn.test.ts src/durable/subagent.test.ts src/durable/fan-in.test.ts.
  • [P1] npm run tsgo:core.
  • [P1] npm run build or equivalent CI build confirmation.

What I checked:

  • Live PR state: this PR is an open draft, mergeable, external-author PR at head 5cb2602 with +14202/-126 across 93 files and existing P2/merge-risk/proof labels. (5cb2602e49a0)
  • Current main lacks the requested durable surface: Current main has no src/durable directory and no hits for OPENCLAW_DURABLE_RUNTIME, contextRefs, or durable.coordination in source/docs/protocol paths, so the central requested feature is not already implemented on main. (36dd9ee3c3c1)
  • Introduced terminal-session regression: The PR head calls clearAllCliSessions whenever shouldClearTerminalState is true; that includes visible reuse of failed/timeout/killed sessions where the session id is intentionally preserved. (src/gateway/server-methods/agent.ts:2262, 5cb2602e49a0)
  • Current-main invariant only clears CLI bindings on rotation: Current main clears terminal lifecycle fields for recovery but only calls clearAllCliSessions when shouldClearRotatedState is true, preserving CLI bindings when a terminal session is reused. (src/gateway/server-methods/agent.ts:2191, 36dd9ee3c3c1)
  • CLI binding fields are deleted by helper: clearAllCliSessions removes cliSessionBindings, cliSessionIds, and claudeCliSessionId, so the changed guard can sever provider CLI conversation continuity. (src/agents/cli-session.ts:102, 36dd9ee3c3c1)
  • Adjacent tests preserve CLI bindings on terminal reuse: Existing tests distinguish rotation, where CLI bindings are cleared, from terminal main reuse with a transcript marker, where cliSessionIds and claudeCliSessionId are preserved. (src/gateway/server-methods/agent.test.ts:896, 36dd9ee3c3c1)

Likely related people:

  • Jerry-Xin: Authored the current terminal session recovery behavior and adjacent subagent completion routing history that this PR touches. (role: introduced related behavior; confidence: high; commits: 6f90ee4cb895, 3e9e1d6321f5; files: src/gateway/server-methods/agent.ts, src/agents/tools/sessions-spawn-tool.ts)
  • yetval: Recently preserved provider-owned CLI sessions across gateway freshness decisions, directly adjacent to the CLI binding preservation regression. (role: recent adjacent contributor; confidence: medium; commits: d9aedc32a131; files: src/gateway/server-methods/agent.ts)
  • steipete: Introduced the shared SQLite state database and recent requester-agent task attribution work that this durable runtime stack builds on. (role: shared state and task/session area contributor; confidence: high; commits: bc848b367f0b, 1fef20c96bdc, f91de52f0d23; files: src/state/openclaw-state-schema.sql, src/agents/tools/sessions-spawn-tool.ts)
  • obviyus: Recent commits in the gateway agent/session path indicate familiarity with current agent RPC and deleted-agent guard behavior. (role: recent gateway area contributor; confidence: medium; commits: 8829dc4aae5b, 35d06e6356a6; files: src/gateway/server-methods/agent.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 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 1, 2026
@mjnkao

mjnkao commented Jul 1, 2026

Copy link
Copy Markdown
Author

Updated after ClawSweeper review:

  • restored pairing QR sensitive-display handling in WebChat with the openclaw_pairing_qr content block while keeping QR content out of persisted transcripts;
  • kept the durable stack opt-in and carried the disabled-CLI no-mutation fix in this stacked branch;
  • updated proof docs and docs map.

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/chat.directive-tags.test.ts -> 2 files, 262 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/fan-in.test.ts src/durable/subagent.test.ts src/durable/agent-turn.test.ts -> 3 files, 14 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.

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

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 1, 2026
@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 commented Jul 2, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Updated PR #98719 after the latest re-review still flagged the ACP spawn-owner and visible-request terminal cleanup invariants.

Changes:

  • limited ACP manual-spawn CLI task suppression to the trusted in-process gateway-client backend caller, excluding device-token auth and still requiring persisted ACP child metadata;
  • restored the visible-request gate for clearing reused failed/timeout/killed terminal session state, so heartbeat/cron/internal reuse preserves terminal status and timing;
  • added focused regressions for device-token backend ACP-shaped calls and heartbeat terminal-state preservation;
  • updated docs/specs/durable-runtime-agent-session-pr-proof-2026-07-01.md with the new evidence.

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/agent.test.ts -> 2 files, 358 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-chat.agent-events.test.ts -> 1 file, 99 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/durable.test.ts src/gateway/server-methods/chat-history-omission-logging.test.ts src/gateway/session-utils.fs.test.ts -> 7 files, 293 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-core.config.ts src/agents/system-prompt.test.ts -> 1 file, 92 tests passed.
  • node scripts/generate-docs-map.mjs --check -> passed.
  • ./node_modules/.bin/oxfmt --check --threads=1 src/gateway/server-methods/agent.ts src/gateway/server-methods/agent.test.ts docs/specs/durable-runtime-agent-session-pr-proof-2026-07-01.md -> passed.
  • git diff --check -> passed.

New head: 89a77c856da959592ae4eb6dac8d57e3b64cd026.

@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 status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed 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 89a77c856da959592ae4eb6dac8d57e3b64cd026 so the Latest Reviewer Follow-Up and Evidence sections match the latest proof already recorded in docs/specs/durable-runtime-agent-session-pr-proof-2026-07-01.md.

This is body/proof metadata only: no code changes. The body now records the trusted ACP suppression boundary, visible-request terminal cleanup gate, heartbeat preservation proof, and latest validation commands.

@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jul 2, 2026
@mjnkao

mjnkao commented Jul 3, 2026 •

Copy link
Copy Markdown
Author

@clawsweeper re-review

Restored the default durable-disabled prompt guidance flagged in the latest review.

Changes:

  • default Tooling hints again include Larger work: use `sessions_spawn`; completion is push-based. when durable orchestration policy is undefined;
  • durable-specific Sub-agent orchestration wording remains gated behind explicit durable policy/runtime enablement;
  • src/agents/system-prompt.test.ts now asserts the default larger-work guidance stays present;
  • updated docs/specs/durable-runtime-agent-session-pr-proof-2026-07-01.md and refreshed the PR body for the new head.

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-core.config.ts src/agents/system-prompt.test.ts -> 1 file, 92 tests passed.
  • node scripts/generate-docs-map.mjs --check -> passed with docs/docs_map.md is up to date.
  • ./node_modules/.bin/oxfmt --check --threads=1 docs/specs/durable-runtime-agent-session-pr-proof-2026-07-01.md -> passed.
  • git diff --check -> passed.

New head: fa337cd73d768a8e95dedde449624986fc5ec912.

@clawsweeper

clawsweeper Bot commented Jul 3, 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. 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 3, 2026
@mjnkao

mjnkao commented Jul 3, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Updated PR #98719 for head 654dc5c5f9532630a775a6ef5579c531ff25f554.

Changes:

  • kept this PR scoped to durable agent/session runtime wiring; no PR4 recovery-worker or broader hardening scope added;
  • aligned durable agent/session test fixtures and proof wording with task/session-task terminology rather than module-specific work-unit examples;
  • left runtime behavior and schema compatibility unchanged, including the existing foundation compatibility field for prior context refs;
  • refreshed the PR body and docs/specs/durable-runtime-agent-session-pr-proof-2026-07-01.md with exact-head validation.

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable/intake-envelope.test.ts src/durable/agent-turn.test.ts src/durable/subagent.test.ts src/durable/fan-in.test.ts -> 4 files, 17 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/agent.test.ts -> 2 files, 358 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-tools.config.ts src/agents/tools/sessions-spawn-tool.test.ts src/agents/tools/gateway-tool.test.ts -> 2 files, 67 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.

@clawsweeper

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

…e-runtime-agent-v2-ready

# Conflicts:
#	src/gateway/server-methods/agent.ts
@mjnkao

mjnkao commented Jul 3, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Merged current origin/main into PR #98719 to clear the live merge conflict at head 5cb2602.

Conflict resolution was limited to src/gateway/server-methods/agent.ts: kept the durable agent-turn imports/lifecycle wiring and preserved upstream Gateway-owned plugin runtime binding (allowGatewaySubagentBinding: true).

Validation:

  • npm run tsgo:core passed.
  • git diff --cached --check passed before commit.
  • Focused Gateway agent Vitest shard was attempted but hung without output and was interrupted before typecheck.

Pushed private first to mjnkao/openclaw-x, then public fork mjnkao/openclaw.

@clawsweeper

clawsweeper Bot commented Jul 3, 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: 🧂 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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 3, 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

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant