Repository navigation
fix(tasks): clone only the requested task page - #114277
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 27, 2026, 8:08 AM ET / 12:08 UTC. ClawSweeper reviewWhat this changesThe PR makes Gateway Merge readinessKeep this PR open for maintainer review. The patch has a sound registry-ownership shape and includes credible real Gateway proof, but GitHub currently reports the branch as dirty against Priority: P2 Review scores
Verification
How this fits togetherGateway clients call flowchart LR
A[Gateway client request] --> B[Gateway task-list handler]
B --> C[Task registry page query]
C --> D[Ownership filters and activity order]
D --> E[Clone requested task page]
E --> F[Summaries and next cursor]
F --> G[Gateway response]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +21, Tests +25. Total +46 across 6 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase or resolve the branch onto current Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the changed path is a Gateway Is this the best way to solve the issue? Yes, conditionally: a registry-owned declarative page query is the narrowest maintainable fix because it prevents Gateway callers from receiving retained mutable records merely to filter and sort them. The branch still needs conflict resolution and fresh proof on the actual merged head. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f67bdbbfe0b8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
dcbb6d9 to
2b2c0d4
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper review — exact head 879e1ff removes the stale public taskUpdatedAt export reported by the dependency/dead-code CI shard. Focused tasks tests remain 12/12 and task-registry tests 119/119; targeted oxlint and git diff --check pass. The PR body now points to the exact head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* origin/main: (199 commits) refactor(workboard): tidy Control UI card execution helpers (openclaw#115195) perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281) fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232) fix: restore Fish completion after global CLI options (openclaw#115222) refactor(agents): collapse the client-tool catalog branch (openclaw#115212) fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957) fix(agents): prevent repeated Code Mode output across waits (openclaw#115213) refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245) fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229) fix(cli): reject malformed infer model refs (openclaw#115225) feat(ui): finish the Lobsterdex at 42 with wild variants, squish fix, and blink variance (openclaw#115264) test(migrations): avoid mtime precision in checkpoint fixture (openclaw#115269) test(signal): verify archive limits without malformed tar (openclaw#115270) refactor(sessions): isolate legacy transcript fixtures (openclaw#115231) fix(discord): clear pending launch watchdog (openclaw#115100) fix(agents): stop quadratic subagent prompt rendering (openclaw#115263) fix(memory-core): recover dreaming cron reconciliation (openclaw#115174) fix(qa-lab): filter incompatible channel scenarios (openclaw#115087) fix(android): respect locale in compact labels test(i18n): prove iOS discovery catalog ownership ...
|
Maintainer verification on
Remote proof: https://github.com/openclaw/openclaw/actions/runs/30379013930 |
|
Merged via squash.
|
…224005-host * origin/main: (72 commits) fix: macOS-only Parallels smoke harness regression (#75293) fix(ios): use configured speech language for system voice (#113372) refactor: centralize isolated agent test ownership (#115340) test(ui): stabilize browser route readiness (#115320) fix(cron): clear automation after failed scheduler shutdown (#115316) fix: keep isolated gateway workspaces and skills inside state dir (#114487) docs: document local TTS on macOS, Linux, and Windows (#110230) fix(tasks): clone only the requested task page (#114277) fix(agents): prevent Code Mode resume loss and unbounded preparation (#115314) fix(process): preserve the first process cancellation reason (#115317) fix(nostr): report unavailable ingress when queue open fails (#115313) fix: prevent Slack and Feishu ingress startup leaks (#115295) fix(slack): avoid unsafe emphasis boundaries (#111575) fix: prevent changed checks from expanding into full lint (#115322) fix(codex): stabilize prompts and expose real cache regressions (#115238) refactor(ui): derive page route specs from the route table (#115214) fix(compaction): plan cut points in trigger units (#111886) (#115309) fix: prevent cron and gateway stress-run timeouts (#115241) fix(ci): validate frozen Matrix QA targets (#115298) test(macos): block real process fallthrough (#113337) ... # Conflicts: # CHANGELOG.md
* fix(tasks): clone only paginated task records * fix(tasks): keep page queries registry-owned * fix(tasks): keep update timestamp helper private --------- Co-authored-by: Vincent Koc <[email protected]>
…afea23-host * origin/main: (72 commits) fix: macOS-only Parallels smoke harness regression (openclaw#75293) fix(ios): use configured speech language for system voice (openclaw#113372) refactor: centralize isolated agent test ownership (openclaw#115340) test(ui): stabilize browser route readiness (openclaw#115320) fix(cron): clear automation after failed scheduler shutdown (openclaw#115316) fix: keep isolated gateway workspaces and skills inside state dir (openclaw#114487) docs: document local TTS on macOS, Linux, and Windows (openclaw#110230) fix(tasks): clone only the requested task page (openclaw#114277) fix(agents): prevent Code Mode resume loss and unbounded preparation (openclaw#115314) fix(process): preserve the first process cancellation reason (openclaw#115317) fix(nostr): report unavailable ingress when queue open fails (openclaw#115313) fix: prevent Slack and Feishu ingress startup leaks (openclaw#115295) fix(slack): avoid unsafe emphasis boundaries (openclaw#111575) fix: prevent changed checks from expanding into full lint (openclaw#115322) fix(codex): stabilize prompts and expose real cache regressions (openclaw#115238) refactor(ui): derive page route specs from the route table (openclaw#115214) fix(compaction): plan cut points in trigger units (openclaw#111886) (openclaw#115309) fix: prevent cron and gateway stress-run timeouts (openclaw#115241) fix(ci): validate frozen Matrix QA targets (openclaw#115298) test(macos): block real process fallthrough (openclaw#113337) ... # Conflicts: # CHANGELOG.md
Closes #105425
What Problem This Solves
Fixes an issue where
tasks.listdeep-cloned every retained task record before filtering and pagination, causing memory allocation and garbage-collection work to grow with the full task history.Why This Change Was Made
Filtering and activity ordering now happen inside the task registry through declarative status/agent/session query fields. No caller callback receives authoritative mutable records, and only the bounded requested page is defensively cloned before leaving the registry boundary. Cursor ordering and response summaries remain unchanged.
User Impact
Listing a small page of tasks no longer deep-clones discarded history records, reducing memory and GC overhead for large task archives.
Evidence
listTaskRecordPageno longer acceptsmatchesorcomparecallbacks. Filtering, legacy agent fallback, session ownership matching, and activity ordering are registry-owned; callers receive only cloned page records.origin/main5b58d8540d.structuredClonecalls.node scripts/run-vitest.mjs src/gateway/server-methods/tasks.test.ts— 12/12 passed.node scripts/run-vitest.mjs src/tasks/task-registry.test.ts— 119/119 passed.oxlintandgit diff --checkpassed on exact head879e1ff10a.src/node-host/config.test.tsfailingchmodwithENOENTon a temporary SQLite journal; the touched task files were not in that failure, while 296 files / 3,630 tests in the shard passed. Fresh exact-head checks are allowed to rerun.Real behavior proof
Behavior or issue addressed:
A real Gateway
tasks.listWebSocket request for 25 records must have clone work bounded by the requested page, not by the retained SQLite history size, after the registry owner-boundary correction.Real environment tested:
Windows x64, Node 24.18.0, exact rebased head
879e1ff10a. Two isolated production Gateway runs used real loopback WebSockets, protocol v4 operator connection, and the sharedopenclaw.sqlitetask store. Channels/providers were disabled because they are outside this RPC.Exact steps or command run after this patch:
Each runner seeded SQLite before Gateway startup, opened
ws://127.0.0.1:<port>, completed the real connect handshake, invokedtasks.listwithlimit: 25, counted all process-widestructuredClonecalls during that RPC, and closed the Gateway cleanly.Evidence after fix:
The full Gateway count includes the 25 registry clones plus bounded protocol/event snapshot copies; it remained exactly 75 when retained history doubled. The focused handler regression separately proves the registry owner itself clones exactly the returned page.
Observed result after fix:
Both real Gateway requests returned the same 25-record page and cursor, and total clone count stayed constant as SQLite history doubled from 2,500 to 5,000 records. Filtering and sorting never exposed retained task objects outside the registry.
What was not tested:
This proof used Windows and histories up to 5,000 records. Cross-platform SQLite behavior and larger archives were not benchmarked; ordering/filter/cursor semantics remain covered by the 131 focused tests.