Repository navigation
fix: let concurrent sessions recall memory within a shared limit - #99105
fuller-stack-dev merged 7 commits into
Conversation
|
Codex review: blocked before merge. Reviewed September 15, 2026, 11:22 PM ET / September 16, 2026, 03:22 UTC (Revision 22). ClawSweeper reviewWhat this changesAllow independent conversations to recall memory concurrently within a shared limit derived from the existing subagent setting, with startup, reload, and diagnostics coverage. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful, bounded fix absent from current main and the latest release. The prior capacity and diagnostics findings are resolved; no new actionable defect was found. Priority: P2 Review scores
Verification
How this fits togetherActive Memory retrieves context before OpenClaw builds a conversational reply. The Gateway publishes scheduling limits to the shared command queue, which admits recall helpers separately from their waiting parent runs. flowchart LR
A[Concurrent conversations] --> B[Active Memory recall]
C[Existing subagent limit] --> D[Gateway startup and reload]
D --> E[Shared recall queue]
B --> E
E --> F[Bounded recall helpers]
F --> G[Context for parent reply]
Decision needed
Why: A clean technical review does not release an expressly retained human-owned landing hold. Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +106. Total +111 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one finite recall budget under the existing Gateway publisher, separate from parent occupancy, while preserving configured limits and existing cancellation semantics. Do we have a high-confidence way to reproduce the issue? Yes, from source: independent recalls share an unconfigured one-wide lane while their recall deadlines continue running. The supplied baseline scheduling fixture reports the resulting short-recall timeouts; this read-only review executed no target code. Is this the best way to solve the issue? Yes. Publishing capacity through the existing queue owner avoids unbounded per-agent lanes and parent-child capacity cycles; the maintainer discussion has already settled that design. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 472a5e958dec. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (21 earlier review cycles; latest 8 shown)
|
|
Live behavior proof from a production install (the per-agent lane change has been running there since 2026-07-02 as an equivalent patch, and since 2026-07-05 as this branch's commit cherry-picked into a v2026.6.10 backport build): with two agents in one Slack room receiving near-simultaneous traffic, a 2026-07-03 verification pass counted 82 recall-path log lines across the session with zero lane-wait pileups and zero recall timeouts; lane keys of the form |
1f27cfb to
6cd1e78
Compare
6cd1e78 to
9a92d0f
Compare
|
Status refresh from the production install running this change: the per-agent recall lane has now been live for three weeks (since 2026-07-02) with no cross-agent stalls observed, while current master still routes every agent's recall through the single shared "active-memory" lane (types.ts ACTIVE_MEMORY_RECALL_LANE), so the serialization this fixes is still present. The branch remains mergeable against master with checks green, and it composes cleanly with the recent recall refactors (recall-context preparation, recall fast mode). Happy to rebase or adjust if a maintainer wants a different shape. |
9a92d0f to
28fdf5b
Compare
|
Append-only correction published at The final change uses one fixed shared recall lane, published at Gateway startup and reload from Evidence: the actual publisher/recall/controller/queue fixture fails 4 of 11 cases on the unchanged publisher and passes all 11 on the corrected source. With a 14-second helper and two 1.5-second helpers, same-agent and different-agent bursts complete at 14, 1.5 and 3 seconds under the unchanged 15-second end-to-end budget. FIFO, a 12-request aggregate cap, explicit 1, queued cancellation/expiry, active unwind, reload shrink/expansion, parent progress, and authority/project separation are covered. Focused regressions pass 54 tests; lint and formatting pass. The focused type rerun passes after restoring canonical ambient declarations to the external proof config.
The independent validator exercised 12 valid scenarios with 41 launches plus one invalid-input probe. Clauses 1–4 and 6 pass; literal clause 5 remains fail because a later equal-text request uses successful-result caching. The report and original contract are preserved unchanged. The settled product contract distinguishes per-admission run-local reuse from the existing successful-result cross-turn query cache, so this is classified as contract ambiguity rather than a queue regression. Concurrent distinct admissions and changed authority/project are separately proven. This report is not universally clean. Isolated runs: same-fixture proof, corrected focused types, independent scenarios, identity follow-up. Independent code autoreview is scoped-clean with no P0–P2 findings. These are controlled provider/clock measurements, not authenticated model or memory-search speed claims. The exact 15-second callback-order edge remains a separate finding. Required exact-head CI is pending, and native preparation/landing has not started. Signed artifact links expire September 22; retained manifests and local originals preserve hashes for republication. |
|
@clawsweeper re-review Append-only head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Addressed the diagnostics finding in the latest review at The frozen correction at tree node scripts/run-vitest.mjs src/gateway/server-methods/diagnostics.test.ts
node scripts/run-vitest.mjs src/gateway/server-lanes.test.ts src/process/command-queue.scoped-lanes.test.tsReduced raw results for readers unable to access the artifact host: Proof run. Downloaded raw archive SHA256 The earlier CI failures and original source-blind clause 5 failure/cache adjudication remain recorded. Canonical alias-wrapper fixture repairs are now incorporated. Required CI on this exact head is pending; native preparation and merge remain gated. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Merged as 03b0a5b. Required exact-head CI 35048763715 and native preparation passed at Revision 22's artifact-access limitation belonged to the review host. The supervising maintainer inspected the retained raw scheduling evidence and released the landing hold. Historical controlled-provider limits and the clause 5 cache finding/adjudication remain in the Evidence section. One ordinary head-pinned squash completed after the earlier merge-commit request was rejected by repository policy. That rejected request and its recovery records are preserved separately. No admin merge, auto-merge, force-push, or check bypass was used. |
…nclaw#99105) Keep recall work in its session lane while enforcing the shared helper limit. Preserve queued admission, successful-result cache reuse, and the diagnostic method inventory. Thanks @gorkem2020. Co-authored-by: Gorkem Erdogan <[email protected]> Co-authored-by: Jason (Json) <[email protected]>
What Problem This Solves
Fixes short Active Memory recalls timing out behind a slow recall from another session, including when both sessions use the same agent.
User Impact
Independent conversations can recall concurrently within a finite helper budget. The existing
agents.defaults.subagents.maxConcurrentvalue sets that budget, including an explicit value of 1. The recall deadline stays unchanged. Heavy legitimate bursts can still exhaust the bounded budget and time out.Why This Change Was Made
Gateway startup and reload now publish capacity for one shared
active-memorylane. Its capacity is separate from main and subagent slots because a parent can hold one of those slots while awaiting recall. This adds one bounded helper budget; it does not pool recall with subagent occupancy.Gorkem Erdogan (
gorkem2020) supplied the original report and implementation. Its live-deployment observations are historical motivation, not validation of this published head. The original per-agent direction helped different agents but still serialized several sessions of one agent and lacked an aggregate helper cap. This append-only correction preserves that contributor history and report. There is no new setting, unbounded lane family, retry, or longer timeout.Related: #149180 corrects admitted input and redundant recall independently. The queue defect remains after that correction.
Evidence
Current head:
1192fd6991456a7d9f50b2215ddbf16f6692010e, incorporating canonical0679c8793048c8e6a34d66b908a4f7e9e438ad8f. The append-only update preserves all four file blobs and the full authored delta from1c4a062b5e3f4f0aeeef9b748987a467a6cd58ce. This retains the three reviewed files from83c626942d89d663baf02f227cbe86efa51f2ea7plus the accepted one-line diagnostics expectation correction. Production code is unchanged. Historical proof labels and the original clause 5 report/adjudication remain unchanged. The current exact-head CI passed, including required gate 104650996173. Native preparation passed at this exact head. Merged as03b0a5b8ab9fefde4863e17e6b40bfdbe6ebfafethrough one authorized ordinary head-pinned squash. The landed tree and full authored diff were verified. Final pre-dispatch read found 238 settled checks with none pending or failing.The actual Gateway publisher, recall orchestration, lane controller and command queue pass the same 11-case fixture that fails on the unchanged publisher. With one 14-second helper and two 1.5-second helpers, the corrected cap-2 run finishes at 14, 1.5, and 3 seconds for both same-agent and different-agent sessions. Baseline yields
ok/timeout/timeout.Controls cover explicit 1, FIFO, 12 requests sharing one finite cap, queued expiry/cancellation, active cancellation retaining capacity through unwind, cap shrink/reload, authority/project separation and a parent holding the subagent lane. The provider and clock are controlled, so these are admission/scheduling measurements, not authenticated model/search-speed claims.
The earlier
7543e9c3CI run failed on the missing diagnostics expectation and the alias-wrapper fixture. The one-line diagnostics correction passed 25 focused tests on frozen tree093e608036950a97d3ad43e6a3f84245e0da2134: diagnostics 5, Gateway lanes 9, scoped lanes 11. Isolated proof run, Node 24.20.0; scoped autoreview has no P0-P2 findings. The final published patch is byte-identical to that accepted candidate. Earlier failed runs remain historical evidence.Focused regressions: 54 pass. Changed-file lint and formatting pass. Focused types pass after fixing an external proof config that omitted canonical ambient declarations; no product change was needed. Independent autoreview is scoped-clean with no P0-P2 findings. Exact-head required CI is green. ClawSweeper Revision 22, pinned to this head, found no new actionable code defect. Its before-merge items concern the supervising maintainer release and its host's inability to open raw artifacts. The release is now granted; the supervising review retained and inspected the raw proof. There are no inline threads or reviews. The independent operator validator passes clauses 1–4 and 6. Literal clause 5 remains fail for post-completion equal-text caching. Its unchanged report and original contract are retained alongside the supervising orchestrator’s interpretation of the established successful-result cache contract. Concurrent distinct admissions and authority/project separation pass separately. This is not an unqualified clean validator report.
Proof run: https://crabbox.openclaw.ai/portal/runs/run_d9384cc8f547 . Focused types: https://crabbox.openclaw.ai/portal/runs/run_56181607e844 . Safe red/green observations, artifact manifest, original contract, independent report and cache adjudication are linked in the proof comment.
An exact 15-second timer-ordering case can start then abort at the boundary. It is a separate finding and this PR does not claim a stronger absolute admission-deadline contract.
Historical
1c4a062bCI completed with a failed aggregate. All five diagnostics cases passed; its failures were yield/resume root assertions reporting 2 and 1, and 12 alias/refusal cases stopped by duplicate-fixtureEEXIST. Root holders and caller phases remain unknown; the two counts do not establish a drain transition. Landed #149558 is incorporated with lifecycle-specific body assertions, retained teardown leak checking and idempotent dependency setup. Both actual setup calls remain before the recorder. It does not erase the old gates or attribute their retained roots. #149506 remains independently owned.Canonical movement was assessed against actual proof inputs. The later KNN join-order repair is not executed by the controlled search delays or combined helpers that emit
NONE; these captures establish scheduling behavior, not current real-search latency. Shared task-tracking extraction adds an awaited preparation boundary while preserving ordinary admission identity; the fixture does not exercise paused-task resume or channel-context leases. Original combined captures also do not validate newer bounded-reader cutoff/error behavior or measure fresh preparation latency. No proof rerun or new queue behavior was added for this refresh.