Repository navigation
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 October 6, 2026, 9:43 AM ET / 13:43 UTC (Revision 7). ClawSweeper reviewWhat this changesThe PR bounds model-loading waits during catalog-to-Gateway session copies, propagates request cancellation, and adds deadline, cancellation, fallback, and durable retry coverage. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main and the latest release retain the reported unbounded waits. The prior review’s timing request is satisfied, the supplied production-path proof is sufficient, and no actionable patch defect remains. Priority: P2 Review scores
Verification
How this fits togetherSession catalog continuation copies a plugin-provided conversation snapshot into a new Gateway session. Model availability checks precede atomic session creation, transcript import, and adoption recording. flowchart TD
A[Continue catalog snapshot] --> B[Authorize source and creation]
B --> C[Get provider snapshot]
C --> D[Observe model catalog]
E[Shared deadline and cancellation] --> D
D --> F[Atomic session and history import]
D --> G[Retryable unavailable response]
F --> H[Record adoption and return session]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +84, Tests +263. Total +347 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep catalog publication under its existing owner while request-owned observations settle promptly and failed copies leave no durable artifacts. Do we have a high-confidence way to reproduce the issue? Yes: current-main source exposes two unbounded catalog observations, and the supplied negative control reports pending deadline and cancellation cases. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes: bounding the two request-owned observations preserves shared publication, ordinary fallback, atomic initialization, and existing authorization guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1a5524f70f5c. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
ed73f17 to
ba6ebd8
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed as 05838d8. Thanks @ericcaiwx-star! |
Share the monotonic catalog deadline across creation, continuation, and session patch handlers. Return retryable UNAVAILABLE for affected targets without a late commit, retaining ordered bulk outcomes and live commit guards. Remove the unused import loader and preserve catalog-independent import and re-import. Follow-up to #165989 and #166089.
…6089) After openclaw#165989 bounded model-catalog waits in `sessions.create`, the Gateway-copy branch of `sessions.catalog.continue` still had two request-owned catalog reads with no deadline or cancellation: the preferred-model availability check and the create-time catalog loader. With catalog publication stalled, continuing a catalog thread into a Gateway session could hang past the 20 s create policy and past the requester's connection. Both reads now follow the same bounded, cancellable policy. Proof: a built Gateway with a local provider whose catalog publication stalls. Base was still pending at 60 s; this change returns a retryable UNAVAILABLE at 20.0 s. A requester disconnect settles the server side in about 2 s with no session or transcript written. A healthy continuation still succeeds and keeps the preferred model. The regression test fails on base and passes here. Fixes openclaw#166084. Co-authored-by: Ayaan Zaidi <[email protected]>
Share the monotonic catalog deadline across creation, continuation, and session patch handlers. Return retryable UNAVAILABLE for affected targets without a late commit, retaining ordered bulk outcomes and live commit guards. Remove the unused import loader and preserve catalog-independent import and re-import. Follow-up to openclaw#165989 and openclaw#166089.
After #165989 bounded model-catalog waits in `sessions.create`, the Gateway-copy branch of `sessions.catalog.continue` still had two request-owned catalog reads with no deadline or cancellation: the preferred-model availability check and the create-time catalog loader. With catalog publication stalled, continuing a catalog thread into a Gateway session could hang past the 20 s create policy and past the requester's connection. Both reads now follow the same bounded, cancellable policy. Proof: a built Gateway with a local provider whose catalog publication stalls. Base was still pending at 60 s; this change returns a retryable UNAVAILABLE at 20.0 s. A requester disconnect settles the server side in about 2 s with no session or transcript written. A healthy continuation still succeeds and keeps the preferred model. The regression test fails on base and passes here. Fixes #166084. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 05838d8)
Share the monotonic catalog deadline across creation, continuation, and session patch handlers. Return retryable UNAVAILABLE for affected targets without a late commit, retaining ordered bulk outcomes and live commit guards. Remove the unused import loader and preserve catalog-independent import and re-import. Follow-up to #165989 and #166089. (cherry picked from commit c3c55ea)
Closes #166084
What Problem This Solves
Continuing a catalog snapshot into a Gateway session could wait indefinitely while model-catalog publication was still pending. The copy path observed the catalog twice: once while assessing the source model and again during atomic session creation.
User Impact
Catalog continuation now settles within the existing Gateway request budget instead of hanging. A deadline, request cancellation, or connection closure returns retryable
UNAVAILABLE; the operator can retry without a partial session, imported history, or adoption event.Why This Change Was Made
sessions.createpolicy while leaving response headroom.atomicInitialization, authorization, commit guards, and catalog/history ownership unchanged.No protocol, schema, configuration, catalog-worker, import, patch, or cross-agent ownership change is included.
Evidence
Exact base:
08229175e9b5d9133a6739d360a4fa1269ef3a2cExact head:
ba6ebd82fa53e302e1dcd785c805916dd8e10f66Pre-fix negative control on the exact base:
Exact-head focused proof:
The focused proof covers the first wait, one monotonic budget across both waits despite a wall-clock jump, request and connection cancellation, no import/adoption after failure, ordinary fallback, and a successful clean retry.
Public-handler durable-behavior proof:
The added
sessions.catalog.continuecase invokes the public handler with a stalled real prepared-catalog owner, cancels the request, receives retryableUNAVAILABLE, and verifies that the SQLite session-key set is unchanged and provider history was not read. It then retries through the same public handler and verifies the real durable session entry, imported external-content transcript, andadoptedstate event. It does not mock session creation, SQLite persistence, transcript import, or adoption recording. The case itself ran in 404ms on the final combined run.Exact-head real transport proof:
This one-shot proof started a real Gateway and connected a real
GatewayClientover loopback WebSocket. It held the real prepared-model replacement owner, sentsessions.catalog.continue, waited until the server entered that owner, disconnected the client, and awaited Gateway close/drain before releasing the owner. At that completion gate, the non-dashboard SQLite session-key set was unchanged and provider history reads remained zero. A second Gateway and client then retried successfully; publicsessions.listandchat.historyreturned the durable copied session and wrapped external-content transcript. The temporary proof file was removed after the run and is not part of the patch.Both review-reported polling sites now use owned completion gates: the integration test awaits entry into the prepared-catalog reader, and the request/connection tests attach their settlement assertion before abort and await it directly. No real-time polling remains in the changed tests.
Broader continuation-handler regression:
Atomic rollback and retry-owner proof:
Combined exact-head regression across the changed continuation owner, public handler, durable import harness, atomic initialization, and
sessions.createcatalog wait:Changed-file gates:
The unskipped run passed all patch-related format, lint, ratchet, boundary, production typecheck, and core-test typecheck gates. Its only failure was the full-tree Knip baseline for
extensions/voice-call/src/types.ts: CallBrief; that untouched export is present identically on exact-baseupstream/main.GitHub CI for the exact head passed: all 36 executed jobs succeeded,
checks-node-changedcompleted in 4m28s (268s), andpr-fail-fastcompleted successfully.Maintainer runtime validation
Validated unchanged head
ba6ebd82fa53e302e1dcd785c805916dd8e10f66in an isolated Node 24.16.0 Docker Gateway, using a configured local session-catalog/provider fixture. Its copy result suppliespreferredModel; a held asynchronous provider discovery during config reload keeps the real model-runtime publication owner pending. Requests use authenticated loopback WebSocket RPC, not direct handler invocation.08229175e9b5d9133a6739d360a4fa1269ef3a2c, unchanged on current mainbff90d69144ceec82e75f92d59c3a29ec7876351):sessions.catalog.continueremained pending at the 60-second observation cap.UNAVAILABLEafter 20.040 seconds, with the catalog-still-loading message.UNAVAILABLEat 2.061 seconds. Session/transcript table counts were unchanged and no provider history read occurred.sessions.listreported the requestedcatalog-proof/preferredmodel with a user model override.bounds preferred-model assessment before creating a Gateway sessionfailed on the production revert baseline because the result was stillpending. On the candidate, all 11 tests insession-catalog-gateway-copy.test.tspassed; wrapper wall time 23.16 seconds (--maxWorkers=1).openai/gpt-5-minirun through the candidate Gateway completed withstatus: ok,thinkingLevel: low, configured output budget 4096, and 625 output tokens. The first-run onboarding response took precedence over the requested marker; this verifies successful live inference, not exact prompt adherence.No overlap with Pash/Sarah changes. Credit remains with ericcaiwx-star for the fix and regression coverage. No additional source changes were necessary. The stale-base check found no main drift on the five changed files.