Repository navigation
refactor(tasks): separate committed publication from flow persistence - #144593
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 10:48 PM ET / September 11, 2026, 02:48 UTC (Revision 2). ClawSweeper reviewWhat this changesSeparates publication of committed task state from flow persistence, making completion explicitly synchronize its flow before notifying observers. Merge readiness✅ Ready for maintainer review The refactor remains useful for the linked storage work and is not present on fetched main. No actionable regression was found; the prior review’s empty finding list remains appropriate. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw tracks background tasks and their parent flows in SQLite and in-memory registries. After completion or replacement commits, publication refreshes those registries and notifies observers. flowchart TD
A[Completion or replacement] --> B[SQLite transaction]
B --> C[Publish task mirror and indexes]
C --> D{Operation}
D -->|Completion| E[Synchronize parent flow]
D -->|Replacement| F[Publish committed flow]
E --> G[Notify observers]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +22, Tests +1. Total +23 across 6 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep committed publication free of flow persistence while preserving explicit completion synchronization and atomic replacement ordering. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal refactor rather than a reported user-facing defect; source inspection confirms the implicit flow write it separates. Is this the best way to solve the issue? Yes. Moving the existing implementation and making its two callers explicit removes the suppression option without introducing competing persistence logic or changing stored data. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d6997b6bbf2e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Related: #144592
What Problem This Solves
Committed task publication also initiated flow persistence unless callers supplied a suppression option. That hidden write makes the publication boundary unsuitable for the ongoing asynchronous storage conversion and obscures which owner controls persistence.
Why This Change Was Made
Move committed task mirror/index/observer publication into its own owner. Completion now explicitly preserves the existing sequence: publish the task mirror, synchronize its flow with the existing failure/retry behavior, then emit task observers. Atomic replacement publishes its already-committed flow directly and no longer needs the suppression option. SQLite transaction boundaries and runtime behavior are unchanged.
This is a prerequisite for #144592; task/flow storage and SDK APIs are not yet fully asynchronous.
User Impact
No user-visible behavior or persisted-format change. Storage ownership is explicit, allowing later async orchestration to keep database work outside synchronous post-commit publication callbacks.
Evidence
check:changedpassed.