Repository navigation
fix(tasks): keep session lists available during unrelated activity - #138738
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 4, 2026, 8:57 PM ET / September 5, 2026, 00:57 UTC. ClawSweeper reviewWhat this changesThe PR uses the existing session index to select background tasks, maintains requester membership throughout the task lifecycle, and adds coverage for unrelated activity without changing pagination or access rules. Merge readiness✅ Ready for maintainer review Keep open as a focused, still-needed fix: the pinned current main still scans unrelated tasks for session pages. No blocking introduced defect was found, and the maintainer-authored PR is protected from automatic cleanup. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s task registry tracks background work for the session Tasks panel and the global task ledger. Gateway list requests select registry records, apply session and access checks, and return bounded task summaries. flowchart TD
A[Task creation and updates] --> B[Task registry and session index]
C[Session or global list request] --> D[Select indexed or global candidates]
B --> D
D --> E[Filter and order bounded page]
E --> F[Check revisions and current access]
F --> G[Task summaries or retry response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +11, Tests +255, Other 0. Total +266 across 8 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the shared session index rather than another cache or retry layer, retaining exact access predicates, global cursor revisions, and ACP generation scope; the small production increase implements those boundaries. Do we have a high-confidence way to reproduce the issue? Yes, from source: list a session with one matching task among 65 records while another task updates on each event-loop turn; current main yields through unrelated records and exhausts revision retries. The PR contains that regression scenario, but this review did not execute it. Is this the best way to solve the issue? Yes. Reusing the lifecycle-owned index repairs unnecessary scan work at its source without introducing per-session revision state, another cache, or more frontend retries; large candidate sets intentionally retain existing consistency safeguards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4012f13f27d4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users opening a session’s background-task list can receive “Task activity did not stabilize” while unrelated tasks are active, even when the session has only one related task.
Why This Change Was Made
Session pages scanned the whole registry and yielded between batches, allowing unrelated activity to invalidate every attempt. They now select candidates from the existing in-memory related-session index, completed for requester, owner and child keys. Exact agent/session predicates, global cursor revisions and fresh authorization remain authoritative.
ACP generation discovery explicitly keeps its previous owner-or-child candidate set. Create, update, restore, atomic publication and deletion use the same index owner, with persistence succeeding before publication. No stored representation, SQLite schema/index, configuration or RPC contract changes.
Production changes are +27/−16 lines (net +11), including the ownership check needed to preserve ACP generation semantics. Tests add 255 lines; the assertion baseline shrinks by one after removing an unnecessary cast.
User Impact
Session task lists avoid scanning unrelated registry entries. Large candidate sets and global lists retain cooperative yielding and revision checks.
Evidence
The Gateway proof uses isolated synthetic task fixtures and real authorization/session storage. This is a deterministic correctness and scan-work reduction proof, not a production latency benchmark. Regression introduction is not attributed. Hosted exact-head CI remains a separate landing gate.