Repository navigation
fix: fence Session Observer catalog requests - #137243
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 8:16 AM ET / 12:16 UTC. ClawSweeper reviewWhat this changesThe PR prevents an older Session Observer model-catalog request from replacing picker options after the selected agent cycles away and back. Merge readiness⛔ Blocked before merge - 1 item remains Keep open. Current main still permits the same-client A → B → A completion race, while this focused page-owned fence prevents the stale result from changing the Session Observer picker; the member-authored, Priority: P2 Review scores
Verification
How this fits togetherThe Control UI Settings page requests configured models for the selected agent and uses them in the Session Observer picker. Gateway catalog results pass through the shared cache, then the Config page decides whether a completed request may update its current picker state. flowchart LR
A[Selected agent] --> B[Settings Config page]
B --> C[Configured model request]
C --> D[Gateway catalog]
D --> E[Shared catalog cache]
E --> F[Active-request fence]
F --> G[Session Observer picker]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +2, Tests +22. Total +24 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the promise-identity generation fence in the Config page and retain the real-store ordering regression test beside the existing replacement-client coverage. Do we have a high-confidence way to reproduce the issue? Yes — source-reproducible. Deferring the first Main response, selecting Writer, invalidating the public catalog cache, selecting Main again, and resolving the old response last reaches the current-main overwrite predicate. Is this the best way to solve the issue? Yes. The Config page owns picker state, while the shared catalog store only owns cache freshness; promise identity is the narrow generation boundary that distinguishes a retired same-client request from the current one. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e0dad1fc1333. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
bcd94ba to
a0b05f5
Compare
|
Fixed: Session Observer model choices now keep the newest catalog result through cache invalidation and repeated agent selection. |
…36761-session-mode-local-20260903 * commit '58187248c8cafd7b8cfbba3de8d001762fb08b48': improve(testing): add watchOS Gateway upgrade survivor (#137203) improve(ui): structure Devices rows with an actions menu and a facts panel (#137084) test(cli): reuse canonical pairing call guard (#137210) fix(sessions): prevent gateway stalls during large session cleanup (#126035) fix(qa): resolve Slack runtime dependency (#137283) fix: fence Session Observer catalog requests (#137243) fix(memory): make watcher pressure guidance actionable (#137181) test(entry): type the respawn exit mock directly (#137258) fix(release): install first-hop fixtures through the candidate registry (#137286) # Conflicts: # scripts/e2e/lib/upgrade-survivor/assertions.mjs
Prevents stale Session Observer catalog requests from overwriting newer picker results after cache invalidation and repeated agent selection. Refs openclaw#137103.
Refs #137103
Follow-up to #137171.
What Problem This Solves
A Session Observer catalog request could become current again after the selected
agent cycled A -> B -> A. If the first A request completed after the newer A
request, its stale result could overwrite the current picker options.
Root Cause
The completion fence checked the current Gateway client and selected agent, but
those identities are reusable. It did not verify that the completing promise
was still the page's active catalog request.
Fix
Bind success and failure settlement to the current request promise in addition
to the existing Gateway, client, and agent checks. Older generations can no
longer update or reset the picker after a newer request starts.
Regression Coverage
The Config-page owner test uses the real shared catalog store. It keeps the
first Main request pending, completes Writer, invalidates the client catalog as
config.changedandchat.metadata.changeddo, starts a distinct newer Mainrequest, then resolves the original Main request last. The test fails without
the request fence because the stale result replaces Current Main, and passes
with the promise-identity check.
Verification
Session Observer tests, and the 223-test focused UI suite.
fence.
utility model, and completed Session Observer model work.
production-growth item is resolved by the owner-local promise identity fence;
no net-neutral form preserves the explicit generation check.
agent-exec timeout coverage and node command-state classification. Both were
reproduced on current main and repaired by merged PR ci: remove redundant contract runs and costly test work #137220.
Visual Evidence
PR #137171 retains the visible picker recovery screenshots and recording. A new
A -> B -> A recording is omitted here because the Settings route coalesces the
held Main request until cache invalidation, and the browser harness cannot drive
that invalidation plus a third generation without mutating private request
state. The real-store owner test is the closest deterministic proof of this
settlement ordering.