Skip to content

improve(postgres): read each chat history page from one database snapshot - #190001

Merged
roboclaw-bot merged 6 commits into
openclaw:mainfrom
etzelm:perf/pg-r2-l3c-history-one-snapshot
Nov 13, 2026
Merged

roboclaw-bot merged 6 commits into
openclaw:mainfrom
etzelm:perf/pg-r2-l3c-history-one-snapshot

Conversation

@etzelm

@etzelm etzelm commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #197313
Related: #188956, #190129 (#188956 tracks the worker queueing in front of chat.history on PostgreSQL, which #190129 addresses)

What Problem This Solves

On PostgreSQL, some chat.history pages open a new read-only transaction for each step of the page read instead of one: a sparse page (few visible replies among many silent ones) takes three BEGIN ... READ ONLY / ROLLBACK round trips over the database bridge, and a Claude CLI session after a provider switch takes seven. When the database is across a network hop, every extra round trip adds to the page's response time.

User Impact

User impact: each chat.history page on PostgreSQL is read from one database snapshot. Sparse pages and Claude CLI sessions after a provider switch now take one transaction for the page instead of three or seven, which makes those pages faster when PostgreSQL is not on loopback: with about 3.4 ms added round trip, median latency drops by 14 to 26 ms for a sparse page and about 40 ms for a Claude CLI session after a provider switch (see Evidence). Pages that already took one transaction read the same rows with the same SQL, but cost more on a loopback database: the history worker spends about 0.25 ms more per request at 1 and 8 clients, which shows as 9.5 to 12.9% lower throughput alone and 13.5% lower at 8 clients with #190129, with higher p95 and p99 (see the pair bench under Evidence). Returned messages and pagination are unchanged, and SQLite is unchanged.

Why This Change Was Made

The history worker runs one task at a time, and no read snapshot outlives a task. The chat.history page task now holds one PostgreSQL REPEATABLE READ READ ONLY snapshot from its first read until the page is assembled. That covers the Claude CLI import check (revision read and, after a provider switch, its tail read) and every page and tail-scan read. Every read still goes through the read scope's admission (acquire), so validation and path checks run per read as before. A failed read rolls the held snapshot back and the next read opens a fresh one. A failed rollback retires the connection, as runPostgresTransactionSync does, and the snapshot uses the same BEGIN and read-snapshot scope.

Scope: this changes the page task only. The pending-input read that the handler issues before the page is its own worker request with its own snapshot, and the history reader cap (#169110) is untouched. It keeps the eager read-only BEGIN (the deferred BEGIN in #188952 was closed unmerged).

Scope: this closes #197313 (one read snapshot per history page). The worker queueing in #188956 is separate and is #190129; the two changes touch different files and are measured on their own. This one removes 2 or 6 read-only transactions (4 or 12 round trips) per affected page with no other behavior change.

Accepted decision: PostgreSQL latency tradeoff

On November 13, 2026, @Patrick-Erichsen instructed landing after the network-hop benefits and measured dense-loopback regressions were disclosed in the review and landing discussion. This records acceptance of the current one-snapshot-per-page proposal and its disclosed tradeoff, including one-client throughput of 159.0 to 138.55 calls/s and p99 of 12.85 to 15.84 ms, and eight-client p99 of 26.26 to 55.06 ms when paired with #190129. It is not a universal performance improvement. The linked discussion is for team reference and requires sign-in.

No code or benchmark data changed for this decision. Existing proof keeps its actual executing revisions and the coverage limits below.

Evidence

Evidence files: https://github.com/etzelm/openclaw/tree/assets/pg-r2-l3c-history-snapshot-evidence/current-source (paths below are relative to it; README.md there describes each file). PostgreSQL 17.11, isolated Gateways built with pnpm build from each tree.

Original experimental acceptance rule (the dense-loopback exception is explicitly accepted above): through a running Gateway, sparse and Claude CLI provider-switch pages read in one page snapshot with the same reads and messages; with a real network hop, their p50 and p95 drop by roughly the saved round trips times the round trip time; pages that already use one snapshot do not change; no metric moves the wrong way.

  • Gateway A/B with a network hop (network-hop/). Base 3c130c7268e (this head's main parent), fix 213409bf (same PR source as the current head). The Gateway reaches PostgreSQL through toxiproxy with 1 ms latency toxics on each stream. Measured SELECT 1 round trip: 0.44 ms without the toxics, 3.77 ms before the runs and 3.85 ms after (network-hop/rtt.txt). The store was seeded through the Gateway's own RPCs. It has a sparse session (1 visible reply, 250 silent replies, 1 visible reply) and a Claude CLI session made by one real chat.send turn through a stub claude binary on PATH (the stream-json stub from test/e2e/qa-lab/runtime/reply-run-plugin-reload.product-proof.e2e.test.ts, no API key), followed by 250 silent replies and a visible one, and then switched to the default OpenAI model with sessions.patch. Both use limit: 2. There were 5 runs per arm in ABBA order (base fix fix base base fix fix base base fix). Each run restores the same database template and boots the arm. It warms, traces 3 calls per session, then runs a 20 s closed-loop chat.history load per session at concurrency 1 and 8 after a 5 s warmup, with statement logging off. A run starts only when the 1-minute load average is below the 32 cores (network-hop/load-gates.txt).

    Read-only transactions per call (network-hop/SUMMARY-snapshots.txt; runs N4 to N10 carry a statement trace, N1 to N3 latency only):

shape arm runs x calls page snapshots page reads pending-input snapshots
sparse session base 4 x 3 3.0 11.0 1.0
sparse session fix 3 x 3 1.0 11.0 1.0
Claude CLI session after a provider switch base 4 x 3 7.0 23.0 1.0
Claude CLI session after a provider switch fix 3 x 3 1.0 23.0 1.0
4 imported Claude Code threads base and fix 7 x 12 1.0 3.0 1.0

Latency, median of the 5 per-run values (range) in ms, no errors in any run (network-hop/SUMMARY-latency.txt, per run in network-hop/runs/*/load-*.json with the 1-minute load recorded at start and end):

shape concurrency arm p50 p95 p99
sparse 1 base 89.54 (86.70 to 100.37) 101.18 (93.17 to 116.49) 115.00 (93.91 to 121.88)
sparse 1 fix 75.69 (71.11 to 85.72) 103.37 (83.60 to 116.78) 112.35 (90.50 to 212.93)
sparse 8 base 171.09 (157.09 to 175.80) 192.44 (168.67 to 233.24) 234.65 (214.77 to 264.21)
sparse 8 fix 144.65 (135.19 to 167.16) 162.76 (153.67 to 248.04) 195.39 (162.52 to 273.79)
Claude CLI after switch 1 base 174.21 (164.71 to 179.52) 234.17 (204.74 to 284.76) 249.55 (211.94 to 421.65)
Claude CLI after switch 1 fix 132.55 (119.25 to 138.00) 171.47 (127.20 to 229.39) 196.63 (136.80 to 269.81)
Claude CLI after switch 8 base 246.90 (245.67 to 277.02) 326.56 (323.03 to 373.99) 356.10 (342.10 to 424.84)
Claude CLI after switch 8 fix 207.56 (198.27 to 219.93) 262.89 (257.81 to 285.03) 274.96 (265.30 to 314.48)

The sparse page saves 2 BEGIN and 2 ROLLBACK round trips, about 15 ms at 3.8 ms each, and its p50 drops by 13.85 ms at concurrency 1 and 26.44 ms at concurrency 8. At concurrency 1 the sparse p95 is flat (101.18 vs 103.37, within the run ranges), and at concurrency 8 it drops by 29.68 ms. The Claude CLI page saves 6 and 6, about 46 ms, and its p50 drops by 41.66 and 39.34 ms and its p95 by 62.70 and 63.67 ms. The runs started below the core count, but the 1-minute load during them ranged from 4.3 to 37.0 because the host is shared. No cell got worse beyond its range.

  • Running Gateway statement trace on loopback (gateway-trace/, previous head 27ab37717af vs its main parent 7c2ff8f775a, same code): sparse session 3.0 vs 1.0 page snapshots (7 x 3 calls per arm, reads 11 = 11); imported Claude Code threads and a 12-session limit: 100 shape stay at 1.0 on both arms. On loopback the latency did not move (gateway-trace/SUMMARY-latency.txt), as expected when a round trip costs well under a millisecond.

  • Regression test (new, live PostgreSQL), red on base and green with the change (tests/conformance-red.log, tests/conformance-green.log). Read-only BEGINs for one page, base vs fix: sparse page 3 vs 1, Claude CLI session after a provider switch 7 vs 1. A third test checks that a failed statement inside the held snapshot is rolled back and the next read works.

  • Live PostgreSQL conformance (PostgreSQL 17.11): the new test plus the bridge, read-facts, reuse, publication, hydration, agent and state database suites, 15 files and 165 tests pass on head 213409bf (tests/conformance-green-new-head.log) and again on head 5af7f878 merged into current main 10592dacdc6 (ci-lanes/conformance-merge-into-main-10592dac.log). Consumer unit tests for the changed modules pass on the previous head, 16 files and 223 tests (tests/unit-fix.log). pnpm check:changed on the previous head merged into main 638a1851e7e (ci-lanes/check-changed-merge-into-current-main.log): typecheck, format, lint (0 errors), Knip (0 unused exports) and the guards pass. The one failure is changelog attributions on existing CHANGELOG/2026.6.8.md and CHANGELOG/2026.7.1.md entries, which fails the same way on that main (ci-lanes/changelog-attributions-current-main.log).

  • CI lanes: the red lanes on head 5af7f878 came from the main that CI merged it into (4ca233c908c), not from this branch, which touches no ui/ files and allocates exactly the 146 test lines it adds.

    • checks-fast-baseline-ratchets failed only test-lines (over by: 50; net delta: +146, ci-lanes/ci-run-42356893636-excerpt.txt). Plain main 4ca233c908c is already over by 50 with no change at all (ci-lanes/test-lines-plain-main-4ca233c9.log), and the CI merge tree reproduces the CI result (ci-lanes/test-lines-ci-merge-5af7f878-into-4ca233c9.log). main reconciled the ceiling in fix(ci): clear inherited test budget and unused export failures #194509. Merged into current main 10592dacdc6, pnpm check:baseline-ratchets passes all 10 checks (test lines slack 21; ci-lanes/baseline-ratchets-merge-into-main-10592dac.log).
    • checks-ui-e2e (1/2) failed one test, ui/src/e2e/gateway-fresh-visit.http.e2e.test.ts:175 ("Matcher did not succeed in time"). It fails the same way on plain main 4ca233c908c (ci-lanes/ui-e2e-gateway-fresh-visit-plain-main-4ca233c9.log) and was fixed on main by fix(ui): fresh-browser checks fail on redesigned startup fallback #194504. Merged into current main, that file passes 3 of 3 (ci-lanes/ui-e2e-gateway-fresh-visit-merge-into-main-10592dac.log), and the other 18 files of that shard pass (ci-lanes/ui-e2e-shard1-files-merge-into-main-10592dac.log; the one WebKit test there needed WebKit installed locally and then passed 2 of 2, ci-lanes/ui-e2e-mcp-fullscreen-webkit-rerun-merge-into-main-10592dac.log).
    • openclaw/ci-gate only aggregates the two lanes above.
  • Pair bench on current main 82210a2bbdb0 (pair-bench/): four builds from one main (main, main + this PR, main + fix(postgres): chat history slows under concurrent reads #190129, main + both), four runs each in interleaved order, PostgreSQL 17.11, closed-loop chat.history at 1, 8, 16 and 32 clients. Gate results on the same main: PostgreSQL conformance 15 files / 165 tests pass with this PR and with both PRs (3 tests fail on plain main); unit 16 / 224 with this PR, 28 / 386 with both (pair-bench/tests/). This store has dense pages only, which already read in one page snapshot on main, so the database work is the same on all four builds (BEGIN 2.00 per call at 1 client, statements per call within 0.1, pgss.tsv). End to end, this PR is slower on it at 1 and 8 clients, alone and together with fix(postgres): chat history slows under concurrent reads #190129. Medians of 4 runs (medians.tsv), p50 / p95 / p99 in ms and calls/s:

clients main + this PR + #190129 + both
1 6.01 / 10.47 / 12.85 / 159.0 6.9 / 11.79 / 15.84 / 138.55 6.31 / 12.75 / 21.33 / 136.4 7.24 / 13.3 / 20.23 / 125.6
8 19.65 / 32.55 / 46.48 / 385.0 20.75 / 37.58 / 54.23 / 348.35 13.84 / 20.29 / 26.26 / 555.25 15.21 / 26.02 / 55.06 / 480.2
16 41.94 / 70.81 / 95.38 / 362.05 40.14 / 66.81 / 89.35 / 361.05 29.21 / 52.3 / 67.81 / 506.85 29.57 / 45.42 / 81.27 / 507.3
32 79.41 / 112.25 / 199.78 / 372.35 79.47 / 113.22 / 202.16 / 376.1 58.09 / 67.92 / 88.81 / 545.0 58.06 / 91.12 / 128.55 / 529.4

Moved the wrong way with this PR, against main: at 1 client p50 +15% (6.90 vs 6.01 ms), p95 +13% (11.79 vs 10.47 ms), p99 +23% (15.84 vs 12.85 ms) and throughput -12.9% (138.55 vs 159.0 calls/s); at 8 clients p50 +6% (20.75 vs 19.65 ms), p95 +15% (37.58 vs 32.55 ms), p99 +17% (54.23 vs 46.48 ms) and throughput -9.5% (348.35 vs 385.0 calls/s); at 32 clients p50, p95 and p99 within 1.2%. Against #190129 alone, with both PRs: at 1 client p50 +15% (7.24 vs 6.31 ms), p95 +4% (13.3 vs 12.75 ms) and throughput -7.9% (125.6 vs 136.4 calls/s); at 8 clients p50 +10% (15.21 vs 13.84 ms), p95 +28% (26.02 vs 20.29 ms), p99 from 26.26 to 55.06 ms (also above main, 46.48 ms) and throughput -13.5% (480.2 vs 555.25 calls/s); at 16 clients p99 +20% (81.27 vs 67.81 ms); at 32 clients p95 +34% (91.12 vs 67.92 ms), p99 +45% (128.55 vs 88.81 ms) and throughput -2.9% (529.4 vs 545.0 calls/s).

Host load: at 8 clients, this PR alone is slower than main in 3 of 4 rounds, but main started those arms at lower load (3.8 to 4.4 vs 5.5 to 10.1, arms.tsv), so these rounds alone do not rule load out. With both PRs it is slower than #190129 alone in 4 of 4 rounds, including round 3 where it started at lower load (6.7 vs 12.8) and round 2 at about equal load (6.1 vs 5.9). In the profiled runs below, this PR started both 8-client runs at lower load than main (6.5 and 8.0 vs 8.6 and 9.3, cpu-profile/run-order-and-load.txt) and was still slower (p50 28.72 and 28.88 vs 26.78 and 28.14 ms, cpu-profile/runs-h8.txt).

The database runs the same statements on all builds; the extra time shows in the history worker. Worker time per request (worker-time.tsv) is 2.043 vs 1.804 ms at 1 client and 2.630 vs 2.373 ms at 8 clients against main, 3.741 vs 3.229 ms at 8 clients against #190129 alone, and equal at 16 and 32 clients. A CPU profile of the history workers at 8 clients (2 runs per build, cpu-profile/; profiling slows every build, so only the difference is used) shows the workers busier by 123 µs per worker request with this PR. Of that, 62 µs is waiting for database replies to the same statements, about 10 µs is garbage collection, and the rest is spread thinly, with no other function moving by more than 6 µs. With statement counts unchanged, the average wait per statement is longer; why was not isolated, and the profile does not separate database time from bridge transport time. The saving on sparse and provider-switch pages, which grows with the database round trip, is measured in network-hop/ above.

Gaps

  • The network hop is simulated with toxiproxy on one host, not a remote database. The saving scales with the real round trip time.
  • This fixes [Feature]: chat.history on PostgreSQL opens up to seven read-only transactions for one history page #197313 only. The worker queueing in [Feature]: chat.history on PostgreSQL queues behind two history workers under concurrent reads #188956 is fix(postgres): chat history slows under concurrent reads #190129, and the two changes touch different files. The acceptance rule above is not met on the pair bench: on a loopback database with dense pages only, this PR costs about 0.24 to 0.26 ms of history worker time per request at 1 and 8 clients alone (throughput -12.9% at 1 client and -9.5% at 8 clients) and about 0.51 ms at 8 clients with fix(postgres): chat history slows under concurrent reads #190129 (throughput -13.5%). The trade is still worth taking when PostgreSQL sits behind a network hop: each snapshot this PR removes saves two round trips (about 7.6 ms at the measured 3.8 ms round trip, 15 ms per sparse page, 46 ms per Claude CLI page after a provider switch), while the added cost on this bench is under 0.6 ms of worker time per request with identical SQL. Whether that cost grows with the round trip was not measured: the profile puts part of it in waiting for replies, so it may. It is not worth it for a loopback database that serves only dense pages. Ending the snapshot right after the last read was not tried: the page code interleaves reads with projection (tail scans project between reads, and reply attachment can read), so there is no single point after the last read without restructuring the page reader.
  • After a provider switch, the Claude CLI import check still reads the tail twice (now inside one snapshot). This is a possible follow-up, as is sharing a snapshot with the pending-input request.

…shot

The chat.history page task in the history worker now holds one PostgreSQL
read-only snapshot from its first read until the page is assembled, covering
the Claude CLI import check and every page and tail-scan read. Each read still
passes read-scope admission; a failed read rolls the snapshot back and the next
read opens a fresh one. SQLite is unchanged.

Related: openclaw#188956
@clawsweeper

clawsweeper Bot commented Nov 1, 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: M labels Nov 1, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: ready, awaiting a maintainer decision.

What this changes

This PR shares one PostgreSQL read-only snapshot across the reads that assemble a chat history page.

Example: Request limit 2 from a conversation containing two visible messages separated by 250 silent replies.

  • Before: The page opens three read-only transactions.
  • After: The page opens one read-only transaction and returns the same two visible messages.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong shipped-entry-point evidence and no discrete correctness finding; overall readiness remains limited by the unresolved performance tradeoff.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Inspected supplied isolated-Gateway RPC outputs and PostgreSQL traces for sparse and Claude CLI provider-switch pages, showing one page snapshot with unchanged read counts and successful two-message responses; network-hop and dense-page benchmarks cover both gains and costs, and the exercised production changes match the reviewed head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Sparse conversations and Claude CLI sessions after a provider switch take extra database round trips when loading history.
Reason: Network-hop gains are demonstrated, but the workload-dependent slowdown needs the owner's performance tradeoff decision.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep open: this PR provides a distinct, demonstrated PostgreSQL history optimization that current main does not provide.

Priority: P2
Reviewed head: 7778e94428df8f276843704197a2cefd2f8ba360
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should this PR accept slower dense-page reads on loopback PostgreSQL in exchange for fewer round trips and faster sparse or provider-switch pages across a network hop?
  • Recommendation: Hold for a cheaper implementation: Keep the PR open while the contributor investigates the dense-page overhead and preserves the demonstrated snapshot savings.
  • Why: The supplied benchmarks establish both the benefit and regression, but the discussion contains no owner acceptance of the worsened metrics required by repository performance policy.

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway sends history requests to a serialized transcript worker, whose admitted database readers assemble messages and pagination before returning the encoded page.

flowchart LR
  A[Gateway history request] --> B[Serialized transcript worker]
  B --> C[Existing read scope]
  C --> D[PostgreSQL read snapshot]
  D --> E[CLI check and page reads]
  E --> F[Messages and pagination]
Loading

Technical review

Best possible solution:

Preserve page-scoped snapshot reuse while removing the dense-page slowdown, unless the PostgreSQL/history owner explicitly accepts that measured tradeoff.

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

Current-main source retains separate read snapshots, and supplied Gateway traces independently demonstrate three or seven transactions for the affected page shapes; no target code was executed during this review.

Is this the best way to solve the issue?

The scoped hold is a focused implementation using existing transaction and reader owners, but its measured dense-page cost prevents an unconditional performance recommendation.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • History page and CLI preparation keeps the original intent (6968a45: Bound history reads and preserve CLI-import identities, pagination, and canonical transcript bytes.)
  • Read-scope connection reuse and nested reads keeps the original intent (6c84ca1: Retain independent readers while preserving exact connection custody, nested-reader isolation, and lifecycle cleanup.)
  • PostgreSQL snapshot facts keeps the original intent (53829f9: Reuse admitted facts within a read-only snapshot without changing write authority or schema ownership.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6c84ca1 adds src/state/openclaw-agent-db-readonly-scope.ts:49 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6c84ca109479; files: src/state/openclaw-agent-db-readonly-scope.ts)
  • Vincent Koc: Raw commit 3d4a0d1 adds src/infra/postgres-sync/transaction.ts:30 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d4a0d1bc1f6; files: src/infra/postgres-sync/transaction.ts)

PR surface

Source +87, Tests +146, Other +2. Total +235 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 96 9 +87
Tests 1 146 0 +146
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 244 9 +235

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:

No label changes.

Label justifications:

  • P2: This improves PostgreSQL conversation loading for specific history shapes without a demonstrated correctness failure or broad outage.
  • merge-risk: 🚨 other: Performance risk: dense-page throughput falls 9.5–12.9% in the supplied benchmark, and tail latency worsens further in some combined-worker-lane scenarios.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • 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.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-11-01T03:23:15.102Z sha a0656ee :: needs maintainer review before merge. :: none
  • reviewed 2026-11-01T03:36:13.899Z sha a0656ee :: needs maintainer review before merge. :: none
  • reviewed 2026-11-01T07:04:42.092Z sha a0656ee :: needs maintainer review before merge. :: none
  • reviewed 2026-11-04T17:32:22.683Z sha 27ab377 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-07T05:47:54.251Z sha 213409b :: needs maintainer review before merge. :: none
  • reviewed 2026-11-07T08:52:36.491Z sha 5af7f87 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-10T17:50:27.145Z sha 7778e94 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-11T17:19:01.073Z sha 7778e94 :: ready, awaiting a maintainer decision. :: none

Reviewed November 11, 2026, 12:50 PM ET / 17:50 UTC (Revision 10).

@etzelm

etzelm commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@etzelm

etzelm commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@etzelm

etzelm commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026
@etzelm

etzelm commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The previous re-review run stopped before producing a review ("Review blob metadata was unavailable"). No change since the last request.

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 8, 2026
@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
etzelm added a commit to etzelm/openclaw that referenced this pull request Nov 11, 2026
@etzelm

etzelm commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

No code change. Rebuilt and retested on current main (82210a2bbdb0), alone and together with #190129, and the body now has the pair benchmark of both changes on one main. The body also reports where this change is slower end to end on that benchmark (dense pages at 1 and 8 clients), with a CPU profile of the history worker and the trade-off.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 11, 2026
@etzelm

etzelm commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

No code change. #188956 is now split: this PR closes #197313 (one read snapshot per history page), and #188956 keeps the history worker sizing that #190129 addresses.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot merged commit 5aca89e into openclaw:main Nov 13, 2026
187 of 190 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…shot (openclaw#190001)

Read each PostgreSQL chat.history page through one worker-owned read-only snapshot, preserving per-read admission, messages and pagination. Keep SQLite unchanged and rollback/retire failed connections through their existing owners.

Patrick-Erichsen instructed landing after disclosure of the network-hop savings and measured dense-loopback throughput/tail-latency regressions; the accepted tradeoff is recorded in the PR.

Validation: fresh independent source review and source-qualified Gateway/PostgreSQL behavioral and benchmark proof at their recorded executing revisions; exact-head CI/security/dependency statuses successful. No universal performance improvement is claimed.

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawtributors PR from a clawtributor gateway Gateway runtime merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: chat.history on PostgreSQL opens up to seven read-only transactions for one history page

3 participants