Skip to content

fix(gateway): keep transcript reads available during registry refresh - #159208

Merged
steipete merged 3 commits into
mainfrom
deslop/l84-gateway-primary-history
Sep 28, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/l84-gateway-primary-history

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes transcript publications failing when an unrelated agent-registry refresh overlaps an exact read of the current session.

User Impact

Exact transcript reads remain available during auxiliary registry churn. Replaced primary files and retired state owners still prevent delivery. No configuration, schema, permission, migration, or update behavior changes.

Why This Change Was Made

Only RPC, HTTP, and delta display projections consume cross-store lineage. Prepare and revalidate auxiliary sources for those requests; bind exact reads to their primary database through the existing path matcher. Every request retains state admission, cancellation, captured-target, snapshot, physical-file identity, and cleanup checks. No retry or suppressed error is added.

Broadcast tests now hold a real primary-worker reply. Auxiliary registry refresh, churn, or failure must permit publication; retirement of the captured shared-state owner must still refuse it.

READY-TO-LAND. This PR precedes the commands cleanup (#158940). Both PRs remain open, unarmed, and unmerged.

Evidence

Head: f3197c247369024226b9e3ce3c50e4e6e73a0d9c. Independent review has no accepted/actionable P0–P2 finding. Exact-head CI passed: 121 successful jobs, 21 skipped.

  • Deterministic controls hold a successful native message-by-id/count reply, release its settled native resource, and replace the primary inode. The unfenced code returns stale data; the corrected code rejects both replies while retaining native worker cleanup.
  • Broadcast coverage holds a real primary-worker reply: auxiliary registry refresh/churn/failure permits publication, while retirement of the captured shared-state owner refuses it.
  • Retained proof: lifecycle file 25 cases/42s wall; three original 17-file shard runs passed 406 tests each (130/131/128s); 20 standalone Talk fixture runs passed 23 cases each. Clean original-shard replays are recorded as non-reproduction, not repair evidence.
  • Final Blacksmith Testbox proof on the exact green composed CI merge 4f8b8638d269891427f0b7e4bbacad92cac464b6 passed all nine history files (84s), the candidate build (429s), and adjacent command/integration/Doctor cases. Full changed check: all type/guard/dead-export phases passed; the sole unrelated UI line-limit failure was repaired by merged fix(ci): keep chat attachment controls within lint limit #160159, followed by passing full core lint (341s), targeted UI changed checks (448s), 34 attachment tests, and the UI build. Provider blacksmith-testbox, completed lease tbx_01m3jzxt3evb7j4511jf2zrgmk, proof runner.

Earlier exact-head CI measured physical-replacement cases at 0.963s and 0.960s; seven new runtime cases totaled 0.013s. These are case durations, not file wall time. The latest integration keeps the reviewed patch identical and includes existing upstream installer/packaging fixes; no retry, timeout increase, or weakened assertion conceals a failure.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Sep 26, 2026
@steipete
steipete marked this pull request as ready for review September 26, 2026 22:01
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 1:56 AM ET / 05:56 UTC (Revision 16).

ClawSweeper review

What this changes

The branch limits cross-store registry discovery to displayed history and checks the primary SQLite file for exact transcript reads, with worker and broadcast regression coverage.

Merge readiness

✅ Ready for maintainer review

Current main still makes exact transcript reads depend on auxiliary registry discovery. The PR remains a distinct, useful fix; the reviewed patch has no actionable blocking finding.

Priority: P2
Reviewed head: f3197c247369024226b9e3ce3c50e4e6e73a0d9c

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused production changes, distinct lifecycle coverage, reported real-worker proof, and exact-head CI support an above-average review.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): At the production history worker and session-event handler, the captured Testbox report describes a real native worker reply held through injected registry churn and subsequent event publication; source coverage also rejects retired shared state and replaced primary files. The hosted proof log was inaccessible to this reviewer, but that inspection limit does not negate the captured results. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): At the production history worker and session-event handler, the captured Testbox report describes a real native worker reply held through injected registry churn and subsequent event publication; source coverage also rejects retired shared state and replaced primary files. The hosted proof log was inaccessible to this reviewer, but that inspection limit does not negate the captured results. No stored-data contract changes.
Evidence reviewed 8 items Introduced production boundary: The PR selects auxiliary source discovery only for RPC, HTTP, and delta requests, and checks primary file identity for other requests.
Current-main necessity: The current-main production file matches the pre-PR file: every history request still awaits auxiliary source preparation.
Lineage consumer: The worker reader supplies cross-store sources to subagent coordination; its direct message and count branches use the primary transcript reader.
Findings None None.
Security None None.

How this fits together

The Gateway reads stored session transcripts through a background worker and uses the results for history views and session events. Cross-store registry facts help display subagent lineage; direct message reads use their primary session database.

flowchart LR
  A[Transcript request] --> B{Request type}
  B -->|Displayed history| C[Cross-store lineage]
  B -->|Exact read| D[Primary session database]
  C --> E[History worker]
  D --> E
  E --> F[Current-owner checks]
  F --> G[History result or event]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +14, Tests +145. Total +159 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 25 11 +14
Tests 3 173 28 +145
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 198 39 +159

Review metrics

Metric Value Why it matters
Production and test delta production +14 lines, tests +145 lines The production growth adds primary-file validation; the larger test delta covers broadcast and replacement boundaries.

Technical review

Best possible solution:

Land the scoped read path after normal native gates, preserving primary database lifetime checks and cross-store lineage checks where display needs them.

Do we have a high-confidence way to reproduce the issue?

Yes. Current-main source always prepares the registry for exact reads, and the real-worker broadcast test defines a focused registry-failure and refresh scenario; I did not execute it in this read-only review.

Is this the best way to solve the issue?

Yes. The change removes the unrelated registry dependency from direct reads while retaining primary-file, shared-state, and display-lineage checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1fe560c198c2.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded transcript-read availability race during unrelated registry activity.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): At the production history worker and session-event handler, the captured Testbox report describes a real native worker reply held through injected registry churn and subsequent event publication; source coverage also rejects retired shared state and replaced primary files. The hosted proof log was inaccessible to this reviewer, but that inspection limit does not negate the captured results. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. At the production history worker and session-event handler, the captured Testbox report describes a real native worker reply held through injected registry churn and subsequent event publication; source coverage also rejects retired shared state and replaced primary files. The hosted proof log was inaccessible to this reviewer, but that inspection limit does not negate the captured results. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-27T07:22:02.433Z sha 34e9f1f :: needs changes before merge. :: none
  • reviewed 2026-09-27T09:13:38.378Z sha 03ecf8a :: blocked before merge. :: none
  • reviewed 2026-09-27T19:45:39.241Z sha 9c58f1508bfe6de3f48f6061b448ace111c0666e :: needs maintainer review before merge. :: none
  • reviewed September 27, 2026, 4:15 PM ET / 20:15 UTC (Revision 11) sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-09-27T22:38:34.295Z sha 83a6c8211a09f0f22332871eb64aaf0f1406d2a5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-27T23:43:49.739Z sha b07e769 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T02:16:49.875Z sha f3197c2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T03:22:15.662Z sha f3197c2 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from b347cf4 to dacd0a8 Compare September 27, 2026 00:11
@openclaw-barnacle openclaw-barnacle Bot added the channel: whatsapp-web Channel integration: whatsapp-web label Sep 27, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 27, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 27, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 27, 2026
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from dacd0a8 to a6e3e1f Compare September 27, 2026 02:37
@clawsweeper clawsweeper Bot removed the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Sep 27, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 27, 2026
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from a6e3e1f to 34e9f1f Compare September 27, 2026 06:52
@openclaw-barnacle openclaw-barnacle Bot removed the channel: whatsapp-web Channel integration: whatsapp-web label Sep 27, 2026
@clawsweeper clawsweeper Bot removed merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Sep 27, 2026
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from 34e9f1f to 03ecf8a Compare September 27, 2026 09:02
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from 03ecf8a to 9c58f15 Compare September 27, 2026 19:34
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from 9c58f15 to 83a6c82 Compare September 27, 2026 22:30
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 27, 2026
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from 83a6c82 to b07e769 Compare September 27, 2026 23:33
Prepare auxiliary store discovery only for history views that consume cross-store lineage. Preserve primary authority and cleanup checks for every request, and dispose Talk test resources even when publication rejects.
@steipete
steipete force-pushed the deslop/l84-gateway-primary-history branch from b07e769 to f3197c2 Compare September 28, 2026 02:07
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
@steipete
steipete merged commit 00a85fd into main Sep 28, 2026
224 checks passed
@steipete
steipete deleted the deslop/l84-gateway-primary-history branch September 28, 2026 06:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…openclaw#159208)

* fix(gateway): keep transcript reads available during registry refresh

Prepare auxiliary store discovery only for history views that consume cross-store lineage. Preserve primary authority and cleanup checks for every request, and dispose Talk test resources even when publication rejects.

* fix(gateway): retain primary file identity through history delivery

* test(gateway): gate broadcasts on primary history replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant