Skip to content

[codex] Fix commitments safety and coverage - #75302

Merged
clawsweeper[bot] merged 4 commits into
mainfrom
codex/commitments-safety-tests
May 1, 2026
Merged

clawsweeper[bot] merged 4 commits into
mainfrom
codex/commitments-safety-tests

Conversation

@vignesh07

Copy link
Copy Markdown
Member

Summary

Fixes the commitments follow-up safety issues found after the initial feature landed:

  • Honor heartbeat.target: "none" for due commitments, including the runner path that wakes extra due sessions.
  • Stop storing or replaying raw source conversation text in commitment delivery prompts; legacy source fields are stripped on read/write.
  • Run due-commitment heartbeat turns without OpenClaw tools and add CLI bundle-MCP coverage for disableTools.
  • Bound hidden extraction queue growth before spending extractor tokens.
  • Expire stale pending/snoozed commitments instead of leaving them pending forever.
  • Add missing coverage: store/runtime/heartbeat unit tests, full-chain integration, heartbeat policy E2E, QA Lab scenario, and Docker E2E lane registration/package harness.

Root Cause

The first commitments implementation correctly scoped inferred records to agent/channel, but heartbeat delivery treated due commitments as a special case that could bypass internal-only heartbeat delivery. The delivery prompt also carried raw source text forward into a later heartbeat turn, and the hidden extraction queue had no backpressure. Expired records were filtered out of due lists without transitioning their stored status.

Validation

Local targeted proof:

pnpm test src/commitments/runtime.test.ts src/commitments/store.test.ts src/commitments/extraction.test.ts src/commands/commitments.test.ts src/infra/heartbeat-runner.commitments.test.ts src/commitments/commitments-full-chain.integration.test.ts src/commitments/commitments-heartbeat-policy.e2e.test.ts src/agents/cli-runner/prepare.test.ts test/scripts/docker-e2e-plan.test.ts extensions/qa-lab/src/scenario-catalog.test.ts extensions/qa-lab/src/coverage-report.test.ts
node scripts/check-docker-e2e-boundaries.mjs
pnpm exec oxfmt --check --threads=1 src/agents/cli-runner/prepare.test.ts src/agents/cli-runner/prepare.ts src/agents/cli-runner/types.ts src/auto-reply/get-reply-options.types.ts src/auto-reply/reply/agent-runner-execution.ts src/commands/commitments.test.ts src/commitments/config.ts src/commitments/runtime.test.ts src/commitments/runtime.ts src/commitments/store.test.ts src/commitments/store.ts src/commitments/types.ts src/infra/heartbeat-runner.commitments.test.ts src/infra/heartbeat-runner.ts src/commitments/commitments-full-chain.integration.test.ts src/commitments/commitments-heartbeat-policy.e2e.test.ts test/scripts/docker-e2e-plan.test.ts scripts/e2e/commitments-safety-docker-client.ts scripts/lib/docker-e2e-scenarios.mjs
git diff --check

The new QA Lab scenario and Docker lane are intentionally PR/CI proof. I did not run the Docker lane locally.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Apr 30, 2026
@vignesh07
vignesh07 marked this pull request as ready for review April 30, 2026 23:21
@vignesh07
vignesh07 force-pushed the codex/commitments-safety-tests branch from 9ead7b2 to 0b4a34f Compare April 30, 2026 23:25
@vignesh07

Copy link
Copy Markdown
Member Author

@clawsweeper autofix

@clawsweeper

clawsweeper Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed for ClawSweeper automerge.

What this changes:

The PR hardens inferred commitments by honoring heartbeat target: "none", removing raw source text from stored/delivered commitments, disabling tools for due-commitment heartbeat turns, bounding hidden extraction queue growth, expiring stale commitments, and adding docs, QA, Docker, and unit/integration coverage.

Automerge follow-up:

No ClawSweeper repair job is needed: the prior narrow blocker was repaired on the PR branch, review findings are empty, and the remaining action is exact-head CI/automerge gating.

Security review:

Security review cleared: Security review cleared: the diff hardens prompt/data handling and tool disabling, adds tests/docs/Docker coverage, and does not add third-party dependencies, workflow permission expansion, secret exposure, package lifecycle hooks, or downloaded code execution.

Review details

Best possible solution:

Keep this PR as the canonical commitments hardening path and let exact-head CI plus the existing automerge/maintainer gates decide landing once the remaining in-progress checks finish.

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

Yes. Seed a due commitment for a session whose heartbeat config has target: "none" and run runHeartbeatOnce; current main even has a test asserting that this still delivers externally, which is the behavior this PR reverses.

Is this the best way to solve the issue?

Yes. The PR fixes the behavior at the commitments/heartbeat and CLI tool-disabling boundaries, strips legacy data through the store layer, and adds focused coverage without moving extension-owned policy into core.

What I checked:

  • Current-main target-none gap: Current main unconditionally loads due commitments in heartbeat preflight and the existing commitment test asserts delivery even when heartbeat target is none. (src/infra/heartbeat-runner.ts:681, a102f4dede6a)
  • Current-main raw source replay: Current main includes sourceUserText and sourceAssistantText in the heartbeat prompt payload. (src/infra/heartbeat-runner.ts:631, a102f4dede6a)
  • PR-head commitment delivery gate: The PR diff adds canHeartbeatDeliverCommitments, uses it for normal preflight and extra due-session wakeups, replaces raw source text with source IDs, and passes disableTools: true plus an empty skill filter for due-commitment heartbeat turns. (src/infra/heartbeat-runner.ts:201, d224d82b4ba9)
  • PR-head store/runtime hardening: The PR diff strips legacy source text on read/write, stops storing new raw source text, marks stale active commitments expired, and adds a queue cap before extractor tokens are spent. (src/commitments/store.ts:84, d224d82b4ba9)
  • Previous review blocker repaired: The PR head now adds @deprecated JSDoc tags for the legacy source-text fields, matching the repository deprecated-JSDoc guard's requirement for comments beginning with legacy/deprecated markers. (src/commitments/types.ts:38, d224d82b4ba9)
  • Exact-head PR state: Public GitHub API reports this PR open, non-draft, mergeable, automerge-labeled, and on head d224d82 with the protected maintainer label still present. (d224d82b4ba9)

Likely related people:

  • steipete: Git blame and feature-history search point the commitments store/runtime, heartbeat-runner commitments path, CLI runner preparation path, and plugin CLI backend type surface to merged current-main work by Peter Steinberger, especially commit 11a56db; 90419df is also recent adjacent CLI runner maintenance. (role: introduced behavior and recent adjacent maintainer; confidence: high; commits: 11a56db5c1e2, 90419df6633f; files: src/commitments/store.ts, src/commitments/runtime.ts, src/commitments/types.ts)

Remaining risk / open question:

  • Exact-head CI was still in progress at inspection, with no completed failures yet.

Codex review notes: model gpt-5.5, reasoning high; reviewed against a102f4dede6a.

@vignesh07

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label Apr 30, 2026
@clawsweeper

clawsweeper Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

🦞🦞
ClawSweeper automerge is enabled for this PR.

I added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

Draft PRs stay fix-only until GitHub marks them ready for review. A maintainer can pause this with /clawsweeper stop.

@clawsweeper clawsweeper Bot added the clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge label Apr 30, 2026
@clawsweeper

clawsweeper Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

🦞🦞
ClawSweeper autofix is enabled for this PR.

I added clawsweeper:autofix and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

This is fix-only: I will not merge this PR. Tiny claw oath.

@clawsweeper

clawsweeper Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🦞🦞
Thanks, ClawSweeper. ClawSweeper picked up the repair feedback.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper marker: fix-required (finding=review-feedback sha=0b4a34fa20c76caa100cd8965d2b46666a7152d1)
Action: dispatched repair-cluster-worker.yml for jobs/openclaw/inbox/automerge-openclaw-openclaw-75302.md in autonomous mode.
Model: gpt-5.5

I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow fix.

@clawsweeper

clawsweeper Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 reef update

Thanks for the contribution here. ClawSweeper was able to repair this branch in place, which keeps the original PR as the clean canonical path.

Source PR: #75302
Validation: pnpm check:changed
This keeps attribution in the original current: commits, review context, and changelog notes all stay visible.

fish notes: model gpt-5.5, reasoning medium; reviewed against b5a7fc7.

@vignesh07

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@vignesh07 vignesh07 removed the clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge label May 1, 2026
@clawsweeper

clawsweeper Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🦞🦞
Thanks, ClawSweeper. ClawSweeper picked up the repair feedback.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper marker: fix-required (finding=review-feedback sha=b5a7fc7bff0e13e5837d95e5766d16e46028a435)
Action: dispatched repair-cluster-worker.yml for jobs/openclaw/inbox/automerge-openclaw-openclaw-75302.md in autonomous mode.
Model: gpt-5.5

I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow fix.

@clawsweeper

clawsweeper Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 reef update

Thanks for the contribution here. ClawSweeper gave this branch a little current boost so the original PR can stay the canonical swim lane instead of opening a replacement.

Source PR: #75302
Validation: pnpm check:changed
Contributor credit stays right here with this PR's history and changelog context. no lost treasure, no mystery bubbles.

fish notes: model gpt-5.5, reasoning medium; reviewed against d224d82.

@clawsweeper
clawsweeper Bot force-pushed the codex/commitments-safety-tests branch from b5a7fc7 to d224d82 Compare May 1, 2026 00:59
@clawsweeper

clawsweeper Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🦞🦞
ClawSweeper automerge is enabled for this PR.

I added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

Draft PRs stay fix-only until GitHub marks them ready for review. A maintainer can pause this with /clawsweeper stop.

@clawsweeper
clawsweeper Bot merged commit b277ae3 into main May 1, 2026
100 checks passed
@clawsweeper

clawsweeper Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

🦞🦞
Thanks, ClawSweeper. ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=d224d82b4ba9254bcc7493dc5d732a3923424d3d)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-05-01T01:14:08Z

The automerge loop is complete.

@clawsweeper
clawsweeper Bot deleted the codex/commitments-safety-tests branch May 1, 2026 01:14
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
* fix commitments safety and coverage

* Repair commitments safety PR review blockers

* fix(clawsweeper): address review for automerge-openclaw-openclaw-75302 (1)

* Repair commitments safety PR review blocker

---------

Co-authored-by: clawsweeper-repair <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix commitments safety and coverage

* Repair commitments safety PR review blockers

* fix(clawsweeper): address review for automerge-openclaw-openclaw-75302 (1)

* Repair commitments safety PR review blocker

---------

Co-authored-by: clawsweeper-repair <[email protected]>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix commitments safety and coverage

* Repair commitments safety PR review blockers

* fix(clawsweeper): address review for automerge-openclaw-openclaw-75302 (1)

* Repair commitments safety PR review blocker

---------

Co-authored-by: clawsweeper-repair <[email protected]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix commitments safety and coverage

* Repair commitments safety PR review blockers

* fix(clawsweeper): address review for automerge-openclaw-openclaw-75302 (1)

* Repair commitments safety PR review blocker

---------

Co-authored-by: clawsweeper-repair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: anthropic extensions: openai maintainer Maintainer-authored PR scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant