Repository navigation
fix(commitments): make dismissal atomic and truthful - #117591
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 4:28 PM ET / 20:28 UTC. ClawSweeper reviewWhat this changesThe branch makes commitment dismissal return only the active records SQLite actually changes, reports skipped IDs and a nonzero exit for partial failures, sanitizes affected human terminal output, and documents the JSON result contract. Merge readinessKeep this PR open for normal maintainer handling. The prior documentation finding is resolved, and the current patch correctly makes the CLI report the IDs actually transitioned by SQLite; no new actionable patch defect was found. The protected Priority: P2 Review scores
Verification
How this fits togetherCommitments are scheduled follow-up records held in OpenClaw’s shared SQLite state database. The commitments CLI submits requested IDs to that store, then renders the authoritative outcome for terminal users or JSON-consuming scripts. flowchart LR
A[Operator dismissal request] --> B[Commitments CLI]
B --> C[Normalize unique IDs]
C --> D[Immediate SQLite write transaction]
D --> E[Actually transitioned IDs]
E --> F[Human or JSON result]
F --> G[Script exit status]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +26, Tests +153, Docs +26. Total +205 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the documented authoritative-result design after ordinary required-check and maintainer gates, keeping successful JSON raw while making partial and no-op dismissals explicit failures. Do we have a high-confidence way to reproduce the issue? Yes — current main always reports normalized input IDs as dismissed after calling a store function that only updates active rows. The branch adds focused regressions for missing, inactive, duplicate, and competing requests. Is this the best way to solve the issue? Yes — returning the transaction’s authoritative IDs repairs the state owner rather than reconstructing success downstream, and the added CLI documentation makes the new observable contract explicit. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6c9cb8e04d4d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Directly inspectable production behaviorThe reviewed commit was exercised through the production registered Commander path against an isolated real SQLite store. Human output was sanitized without altering raw JSON, nonexistent and terminal commitments were truthfully reported, and a real two-process race admitted exactly one successful dismissal: {
"listHumanSanitized": true,
"listJsonRawPreserved": true,
"invalidStatusSanitized": true,
"nonexistentDismissTruthful": true,
"terminalDismissTruthful": true,
"mixedDismissTruthful": true,
"dismissHumanSanitized": true,
"dismissJsonRawPreserved": true,
"skippedDismissSanitized": true,
"missingDismissJsonTruthful": true,
"richThemeAnsiPreserved": true,
"independentProcessRace": [
{ "label": "A", "code": 0, "json": { "dismissed": ["cm_real_os_process_race"] } },
{ "label": "B", "code": 1, "json": { "dismissed": [], "notDismissed": ["cm_real_os_process_race"] } }
]
}The actual production JSON-routing wrapper was additionally verified with separate real stdout/stderr PTYs: failure JSON stayed parseable and ANSI-free on stdout while the terminal reset went to stderr. Four focused owner/caller shards passed all 84 tests. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* fix(commitments): report atomic dismissals truthfully * docs(commitments): explain dismissal JSON results --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where operators dismissing missing or already-terminal follow-up commitments were told every requested dismissal succeeded even when SQLite changed nothing. Commitment filters, database paths, and identifiers could also place terminal control sequences into human-readable CLI output.
Why This Change Was Made
The existing synchronous SQLite transaction now returns exactly the active commitment IDs it actually transitioned, preserving normalized first-seen request order. The CLI uses that authoritative result for truthful complete and partial outcomes, rejects unsuccessful requests, and sanitizes every affected human-readable value without changing successful JSON output, heartbeat behavior, storage schema, or SQL boundaries.
User Impact
Operators receive accurate dismissal results, clear explanations and nonzero exits for missing or already-terminal commitments, deterministic duplicate-free batches, and safe terminal output. Concurrent CLI processes cannot both claim ownership of the same dismissal; machine-readable successful responses continue to preserve the original raw IDs.
Evidence
Directly inspectable production evidence from the registered Commander path, an isolated real SQLite database, and two independent operating-system processes:
{ "listHumanSanitized": true, "listJsonRawPreserved": true, "nonexistentDismissTruthful": true, "terminalDismissTruthful": true, "mixedDismissTruthful": true, "dismissHumanSanitized": true, "dismissJsonRawPreserved": true, "missingDismissJsonTruthful": true, "richThemeAnsiPreserved": true, "independentProcessRace": [ { "label": "A", "code": 0, "json": { "dismissed": ["cm_real_os_process_race"] } }, { "label": "B", "code": 1, "json": { "dismissed": [], "notDismissed": ["cm_real_os_process_race"] } } ] }The production JSON-routing wrapper also passed against independent real stdout/stderr pseudo-terminals: failure stdout contained valid escape-free JSON and terminal reset bytes appeared only on stderr. The complete public evidence is available in #117591 (comment).