Skip to content

fix: keep transcript recall from rebuilding archived session rows - #207916

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-session-row-materialize-created-churn-20260919
Nov 29, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-session-row-materialize-created-churn-20260919

Conversation

@steipete

@steipete steipete commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Searching older conversations can rebuild archived session rows even though transcript recall returns only text hits. Those builds can also evict rows from a warm archive page, making the next list request rebuild rows the operator just read.

User Impact

Transcript recall returns the same authorized and ordered hits while leaving archive display rows available to the readers that use them. There is no migration or configuration change.

Why This Change Was Made

The projection's exact-read owner can prepare the requested keys from committed metadata and membership. Recall now uses that path for candidate checks and final hit revalidation, including the physical lookup for the global sentinel. It skips display and placement preparation and leaves page pins, the archive budget, and the shared immutable row builder with display readers.

Production is +18 net lines (25 added, 7 removed), test is +8 (10 added, 2 removed), plus the replay driver. The production additions select metadata-only exact preparation in the existing owner and pass that choice through placement preparation. They add no cache or stored state.

Evidence

Team's supplied November 28 snapshot on 90ab1fad recorded 5,176,265 created, 71,881 rebuilt, 50,980 skipped, and 1,320 reused after about nine hours. Fresh builds were 97.7% of outcomes, about 160/s. The 30 × 5 s CPU set attributed 2.48 s of 32.05 busy seconds to the largest row-refresh chain, with about 1.03 s self time across row and patch freezes. The supplied retained sample shows archive trim demoting rows on the refresh path. These aggregate measurements do not give Team's request breakdown or identify how many builds came from recall.

The isolated Gateway uses 2,500 synthetic sessions (1,018 archived), 995 persisted runs, four agents, 50 loopback operator sockets, run start/end transitions and committed metadata patches. Rotating two requested 100-row pages reproduced 5,000 created and 99 rebuilt over 100 transitions, with 5,000 demotions and no selection resets. The live-only control recorded 0 created and 15 rebuilt over 20 transitions. Both controls produced metadata partition revisions.

The formal replay used two A/A controls followed by five order-balanced A/B pairs. Each arm measured 100 run transitions with 50 archive list and 50 recall calls.

Metric A/A controls Before median (range) After median (range)
Refresh CPU, ms/transition 1.783 / 2.021 1.955 (1.843–2.371) 0.250 (0.235–0.272)
Main-thread CPU, ms/transition 14.156 / 17.136 16.231 (15.069–18.091) 10.155 (9.887–11.020)
Main V8 allocation, MB/transition 8.958 / 9.323 9.232 (8.847–9.369) 4.674 (4.646–4.779)

Created/rebuilt/skipped/reused was 2,574 / 99 / 0 / 0 in both A/A controls, 2,574 / 97–99 / 0 / 0 in every baseline arm, and 0 / 96–98 / 0 / 0 in every candidate arm. Each baseline built 1,300 rows in recall and 1,274 on the list read after eviction, with 2,574 archive demotions in total. Each candidate had zero new builds or demotions. All arms recorded 200 metadata partition revisions and zero selection resets. Ordered decoded list and recall payloads matched byte for byte across all 12 runs after excluding the wall-clock snapshotAt field. The generated databases and workspace differ from Team's storage footprint. No Team access was used.

The word and CJK regression cases preserved the expected visible hit and each failed on the parent with 28 materializations where zero are expected. They pass on the patch. The 48 focused tests also exercise physical-global and mixed-store recall, sharing visibility, ordering, prepared reads, placement and archived rows. The separate unchanged-read case proved the existing IfChanged skip and retained graph identity.

Codex autoreview found zero actionable findings through P3 on the staged candidate at base 793ccbd52f9e55. Core, core-test, formatting and the SQLite worker and dialect checks passed. The initial changed-file run identified replay-driver lint/type errors that passed their targeted reruns after correction. The dead-export failures reproduced on clean main a3fb66462294f and trace to #202209 and #207581. The separate unused-file scan also reproduced on that main revision and traces to #207275. No changed module is imported by the Control UI.

Authorize recall candidates from committed session metadata and membership. Keep archived display rows resident for list readers and preserve physical lookup for global recall.
@clawsweeper

clawsweeper Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts size: M labels Nov 29, 2026
@steipete
steipete marked this pull request as ready for review November 29, 2026 02:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T02:52:47.781361Z 983f35c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. labels Nov 29, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The final head is 983f35c31421a5087fa3790396d1a497e1240545 and the PR description now includes the complete paired results. Please review the exact metadata preparation and the physical-owner, membership, and sharing-revision checks used by transcript recall.

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR prepares transcript recall candidates from committed metadata and membership without materializing archived display rows.

Example: Alternate 50 archive-list requests and 50 transcript recalls over 100 run transitions.

  • Before: The reported baseline created 2,574 display rows and demoted 2,574 archive rows.
  • After: The reported candidate created and demoted zero archive rows while preserving ordered decoded responses.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused existing-owner optimization with relevant regressions and reported production-Gateway comparisons; exact-head CI remains in progress.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The body supplies after-fix results from an isolated production Gateway with real sockets, archived sessions, committed patches, and interleaved recall/list requests; the driver matches that scenario, although raw captures were not linked or independently replayed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Recalling old conversations consumes avoidable CPU and allocation and can evict a warm archive page, forcing the next list request to rebuild it.
Reason: The reported workload demonstrates substantial avoided work with identical responses, and the maintainer-authored direction uses established projection owners.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it removes unnecessary archive-row preparation through the existing owner, and I found no actionable correctness or security defects.

Reviewed head: 983f35c31421a5087fa3790396d1a497e1240545

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway sends transcript queries to the search worker, prepares matching session metadata and membership, and returns authorized, ordered text hits; archive display rows belong to list readers.

flowchart LR
  A[Recall request] --> B[Gateway recall owner]
  B --> C[Transcript search worker]
  C --> D[Candidate session keys]
  D --> E[Exact metadata and membership preparation]
  E --> F[Visibility and physical owner checks]
  F --> G[Ordered transcript hits]
Loading

Technical review

Best possible solution:

Use the existing exact-read owner for metadata-only recall preparation while leaving archive residency and display preparation with display readers.

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

The parent routes recall candidates through full exact-row preparation and archive retention; the PR reports both archived-query regressions failing there with 28 materializations and passing after the change, without an independent run during this review.

Is this the best way to solve the issue?

The change removes unnecessary work at the existing preparation boundary, preserves display-reader defaults, and introduces no competing owner, cache, or persistence format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d847c9ba0e42.

Provenance checked

  • Recall candidate selection keeps the original intent (a320c35: Avoid building and sorting list projections for transcript-only results while preserving physical ownership and visibility.)
  • Final recall disclosure keeps the original intent (b66dc6f: Withhold stale hits and associated page metadata after sharing changes, using the prepared-row publication boundary.)
  • Exact-row archive retention and preparation keeps the original intent (b7f616e: Prepare selected dirty or archived display rows through worker-owned facts while preserving archive behavior.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit a564030 adds src/gateway/server-methods/sessions-search-recall.ts:28 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a564030a2b6e; files: src/gateway/server-methods/sessions-search-recall.ts)
  • Vincent Koc: Raw commit dad8de7 adds src/gateway/session-row-projection-ancestors.ts:90 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dad8de71df0d; files: src/gateway/session-row-projection-ancestors.ts)

PR surface

Source +18, Tests +8, Other +375. Total +401 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 25 7 +18
Tests 1 10 2 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 375 0 +375
Total 6 410 9 +401

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 28, 2026, 10:05 PM ET / November 29, 2026, 03:05 UTC.

@steipete
steipete merged commit 3240312 into main Nov 29, 2026
226 of 229 checks passed
@steipete
steipete deleted the steipete/perf-micro-session-row-materialize-created-churn-20260919 branch November 29, 2026 03:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 29, 2026
…seline

* commit '32403124cae2ccbcfc556e844b218682b133956e': (547 commits)
  perf(gateway): skip session display preparation for transcript recall (#207916)
  test(agents): verify complete bracketed paste payload (#207733)
  test: stop timing out the cron recovery settlement test on slow runners (#207920)
  fix: show when worktree cleanup stopped or will retry (#207883)
  fix: show approval destinations only when the forwarding mode uses them (#207885)
  fix: keep inherited tools when changing agent settings (#207884)
  feat: let Knowledge add someone's email or other alias to a page without rewriting it (#207881)
  fix: stop reporting a child worker as finished when the Gateway loses contact (#207713)
  fix: keep the Activity visibility test stable at midnight (#207847)
  perf(agents): reuse prepared tool catalog executors (#207900)
  fix: show the Gateway command default beside host rules in Devices (#207887)
  fix: verify chat Stop recovery after dashboard pairing (#207888)
  test(activity): check midnight refresh against the elapsed window (#207859)
  test(ui): use one persisted message ID in queued-image handoff (#207861)
  test(agents): release configured MCP fixture resources (#207716)
  fix(workboard): clear CI failures in the session filter editor (#207858)
  perf(ai): reduce allocation in OpenAI Responses streams (#207889)
  chore: stop the Workboard resident-owner CLI test from failing on main (#207898)
  test(agents): isolate endpoint-based overflow classification (#207688)
  chore(doctor): record why the root defaultModel migration stays (#207890)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
…eline

* commit 'eee1e0553d29456424ac367008c3cf080f9866ec': (550 commits)
  fix(acp): deliver bound channel replies to the pending question (#207035)
  fix(cron): keep required reports from going silent when nothing changes (#207044)
  test(sessions): assert participant queue rollback state (#207891)
  perf(gateway): skip session display preparation for transcript recall (#207916)
  test(agents): verify complete bracketed paste payload (#207733)
  test: stop timing out the cron recovery settlement test on slow runners (#207920)
  fix: show when worktree cleanup stopped or will retry (#207883)
  fix: show approval destinations only when the forwarding mode uses them (#207885)
  fix: keep inherited tools when changing agent settings (#207884)
  feat: let Knowledge add someone's email or other alias to a page without rewriting it (#207881)
  fix: stop reporting a child worker as finished when the Gateway loses contact (#207713)
  fix: keep the Activity visibility test stable at midnight (#207847)
  perf(agents): reuse prepared tool catalog executors (#207900)
  fix: show the Gateway command default beside host rules in Devices (#207887)
  fix: verify chat Stop recovery after dashboard pairing (#207888)
  test(activity): check midnight refresh against the elapsed window (#207859)
  test(ui): use one persisted message ID in queued-image handoff (#207861)
  test(agents): release configured MCP fixture resources (#207716)
  fix(workboard): clear CI failures in the session filter editor (#207858)
  perf(ai): reduce allocation in OpenAI Responses streams (#207889)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
…ions suite

* commit '60e80f1c5fd439f7aa4ce33f54985c7efdc30884': (555 commits)
  refactor: remove the bundled GBrain adapter (#207924)
  improve(ui): show optional run limits beside the automation schedule (#201283)
  test(onboarding): inspect recorded output for credential leaks (#207872)
  perf(exec): reduce host memory sampler allocations (#207927)
  test(mcp-relay): isolate the Connected apps fallback locale (#207923)
  fix(acp): deliver bound channel replies to the pending question (#207035)
  fix(cron): keep required reports from going silent when nothing changes (#207044)
  test(sessions): assert participant queue rollback state (#207891)
  perf(gateway): skip session display preparation for transcript recall (#207916)
  test(agents): verify complete bracketed paste payload (#207733)
  test: stop timing out the cron recovery settlement test on slow runners (#207920)
  fix: show when worktree cleanup stopped or will retry (#207883)
  fix: show approval destinations only when the forwarding mode uses them (#207885)
  fix: keep inherited tools when changing agent settings (#207884)
  feat: let Knowledge add someone's email or other alias to a page without rewriting it (#207881)
  fix: stop reporting a child worker as finished when the Gateway loses contact (#207713)
  fix: keep the Activity visibility test stable at midnight (#207847)
  perf(agents): reuse prepared tool catalog executors (#207900)
  fix: show the Gateway command default beside host rules in Devices (#207887)
  fix: verify chat Stop recovery after dashboard pairing (#207888)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit 'ba0a7a5fac3e2f1b642d05502273b98dc75adf4f': (556 commits)
  test(agents): fix provider header filtering coverage (#207732)
  refactor: remove the bundled GBrain adapter (#207924)
  improve(ui): show optional run limits beside the automation schedule (#201283)
  test(onboarding): inspect recorded output for credential leaks (#207872)
  perf(exec): reduce host memory sampler allocations (#207927)
  test(mcp-relay): isolate the Connected apps fallback locale (#207923)
  fix(acp): deliver bound channel replies to the pending question (#207035)
  fix(cron): keep required reports from going silent when nothing changes (#207044)
  test(sessions): assert participant queue rollback state (#207891)
  perf(gateway): skip session display preparation for transcript recall (#207916)
  test(agents): verify complete bracketed paste payload (#207733)
  test: stop timing out the cron recovery settlement test on slow runners (#207920)
  fix: show when worktree cleanup stopped or will retry (#207883)
  fix: show approval destinations only when the forwarding mode uses them (#207885)
  fix: keep inherited tools when changing agent settings (#207884)
  feat: let Knowledge add someone's email or other alias to a page without rewriting it (#207881)
  fix: stop reporting a child worker as finished when the Gateway loses contact (#207713)
  fix: keep the Activity visibility test stable at midnight (#207847)
  perf(agents): reuse prepared tool catalog executors (#207900)
  fix: show the Gateway command default beside host rules in Devices (#207887)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…openclaw#207916)

Authorize recall candidates from committed session metadata and membership. Keep archived display rows resident for list readers and preserve physical lookup for global recall.
vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit '99b4afc696081eda8aefd8e91250c112f53a8a73': (564 commits)
  test(ios): verify send-at-tap feedback and work grouping (#207913)
  test(agents): reject unsuccessful live replay completions (#207724)
  fix(cron): keep a started cron turn running when its job is edited (#207947)
  improve(ui): put waiting for a free agent under automation timing (#201282)
  chore(ui): refresh control ui locales (#207514)
  fix: distinguish unresolved delivery failures from delivery history (#207897)
  test(doctor): require security check in proxy ordering assertion (#207912)
  fix: keep update rollback tests in sync with shipped workers (#207822)
  test(agents): fix provider header filtering coverage (#207732)
  refactor: remove the bundled GBrain adapter (#207924)
  improve(ui): show optional run limits beside the automation schedule (#201283)
  test(onboarding): inspect recorded output for credential leaks (#207872)
  perf(exec): reduce host memory sampler allocations (#207927)
  test(mcp-relay): isolate the Connected apps fallback locale (#207923)
  fix(acp): deliver bound channel replies to the pending question (#207035)
  fix(cron): keep required reports from going silent when nothing changes (#207044)
  test(sessions): assert participant queue rollback state (#207891)
  perf(gateway): skip session display preparation for transcript recall (#207916)
  test(agents): verify complete bracketed paste payload (#207733)
  test: stop timing out the cron recovery settlement test on slow runners (#207920)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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