Skip to content

perf(transcripts): serve public meeting-library pages from the transcript read worker - #165111

Merged
steipete merged 2 commits into
mainfrom
steipete/sqlite-meeting-library-worker-pages
Oct 4, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/sqlite-meeting-library-worker-pages

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Public meeting-library pagination still opened and stepped a SQLite reader on the Gateway thread, despite the existing worker path used by transcript tools.

User Impact

Meeting-library pages move their database work off the Gateway thread while preserving ordering, filters, cursors, previews, and response limits. No schema, configuration, stored-data, or update migration is required. This is an execution-placement improvement; no end-to-end latency gain is claimed.

Why This Change Was Made

The existing transcript read operation now owns one bounded page collector and its hasMore result. Public pages project allowlisted source fields and 280-character overview previews before applying their transport budget. Tool reads retain private source facts for authorization and their distinct raw-entry budget. All callers use the new page result.

The host adds current capture state and provider names, checks the final response size, and revalidates request authority after the awaited read. The public host iterator and duplicated collection loop are removed. Export streaming retains its separate snapshot lifetime; the query, date-preparation owner, and indexed utterance count are unchanged.

Evidence

Production observation (2026-10-04): meeting_transcript_utterances contains 24,966 utterances / 7.4 MiB. No supplied slow-hold label isolates this library. The 347 session transcript match read holds concern the agent transcript store and are not attributed to this path.

The supplied synthetic component measurement used 24,966 utterances across 50 meetings and a 50-row page: approximately 15.2 ms of warm synchronous in-memory work, excluding connection opening/admission, serialization, and transport. It is neither a before/after speedup nor a production prediction.

Each page still executes one composed SELECT, now in the existing worker. Caller-thread page-query statements go from 1 to 0, and the caller no longer opens/adopts a private reader or runs its BEGIN/ROLLBACK. The real-worker regression failed before the change (841 caller prepare calls for cold store creation; 68 across the populated cold/warm two-page fixture) and passes after it with zero caller-thread SQLite calls. Separate query-budget tests verify one SELECT, lookahead, and bounded projection without conflating local kernel observations with worker transport proof.

Regressions cover tied timestamps, caller timezone changes, oversized lookahead, large overviews, private source metadata, provider-projection failure and recovery, delayed coherent pages, final response limits, historical/live capture identity, and request revocation/cancellation. Production delta against the PR merge base: +108 / −93 (net +15); tests: +165 / −97 (net +68); docs: +9.

Autoreview: scoped-clean, no accepted/actionable P0–P2 findings. Core typecheck, targeted oxlint, changed-file formatting, git diff --check, and all required ratchets passed: assertion safety, maximum lines, line cap, and database worker access.

The first baseline attempt overlapped gateway asset setup and failed before running tests; the baseline was rerun after setup settled. An initial authorization fixture was corrected to admit a real profile before exercising the post-read revocation check. The three revocation/cancellation cases also fail against the old response code because it discloses the page; they pass with the final guard. No failure was waived.

Focused commands below ran with TMPDIR=/private/tmp/oc-sqlite2/tmp-meeting-library-worker-pages; times are local wall time, including runner overhead. Hosted CI seconds remain pending at handoff.

Command Wall time
pnpm test src/infra/sqlite-worker-transcripts.test.ts --maxWorkers=1 38.03 s
pnpm test src/transcripts/library.async.test.ts --maxWorkers=1 13.07 s
pnpm test src/transcripts/library.query-budget.test.ts --maxWorkers=1 18.28 s
pnpm test src/transcripts/library.test.ts --maxWorkers=1 22.17 s
pnpm test src/transcripts/library.search.test.ts --maxWorkers=1 9.85 s
pnpm test src/transcripts/store.test.ts --maxWorkers=1 14.32 s
pnpm test src/transcripts/status.test.ts --maxWorkers=1 13.03 s
pnpm test src/transcripts/status.metadata.test.ts --maxWorkers=1 9.60 s
pnpm test src/transcripts/status.occupancy.test.ts --maxWorkers=1 14.77 s
pnpm test src/transcripts/status.provider-reload.test.ts --maxWorkers=1 13.06 s
pnpm test src/transcripts/status.producer.test.ts --maxWorkers=1 42.09 s
pnpm test src/transcripts/status.producer.shutdown.test.ts --maxWorkers=1 24.98 s
pnpm test src/agents/tools/transcripts-tool-read.test.ts --maxWorkers=1 18.54 s
pnpm test src/gateway/server-methods/transcripts.test.ts --maxWorkers=1 35.92 s

All 181 tests passed across 14 files. The unchanged capture-status producer suite covers 45 lifecycle/provenance cases and accounts for the longest warm suite; the new tests reuse existing real-worker fixtures.

Initial-head CI: run 37235034410 failed in the architecture check; the repair and validation are recorded below. Dependency review passed with no dependency changes requiring review.

Landing CI repair

CI run 37235034410 exposed a static import cycle introduced by worker-side projection: the read kernel called the projection module, whose type imports led back to the kernel and the full transcript store. The entry and notes contracts now live in the existing store-types.ts leaf; producer return annotations enforce the same shapes. Runtime behavior is unchanged.

The original pnpm check:madge-import-cycles failure reproduced locally. After the repair, the full pnpm check:architecture passed, including zero runtime-value and static import cycles. The combined focused command TMPDIR=/private/tmp/oc-sqlite2/tmp-meeting-library-worker-pages pnpm test src/infra/sqlite-worker-transcripts.test.ts src/transcripts/library.async.test.ts src/transcripts/library.query-budget.test.ts --maxWorkers=1 passed all 31 tests in 59.00 s wrapper wall time. Core types, targeted oxlint, formatting, and git diff --check passed; fresh scoped autoreview found no actionable P0–P2 findings. The architecture failure also caused the aggregate CI gate to fail and sibling jobs to be cancelled; no CI rerun was requested.

@clawsweeper

clawsweeper Bot commented Oct 4, 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 docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 4, 2026
@steipete
steipete marked this pull request as ready for review October 4, 2026 21:10
@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 Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 5:25 PM ET / 21:25 UTC (Revision 2).

ClawSweeper review

What this changes

Moves meeting-library pagination into the existing transcript read worker while preserving public previews, filters, cursors, response limits, and live capture presentation.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main still performs public meeting-library pagination on the Gateway thread. The reviewed head resolves the import-cycle problem, and no actionable introduced defect was found.

Priority: P2
Reviewed head: e151db7f19916b0643993013e3491a5f35d3d69a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused worker cutover with meaningful regression coverage and a narrow import-cycle repair; no blocking patch defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified repository-admin author qualifies for the trusted-author exemption. Supplemental real-worker regressions exercise public library pagination and caller-thread SQLite exclusion; authorization cases check refusal after revocation or cancellation. No stored-data contract changes, migration, or new permission grant were introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified repository-admin author qualifies for the trusted-author exemption. Supplemental real-worker regressions exercise public library pagination and caller-thread SQLite exclusion; authorization cases check refusal after revocation or cancellation. No stored-data contract changes, migration, or new permission grant were introduced.
Evidence reviewed 9 items Pinned introduction: Reviewed the merge-base-to-head patch, rather than endpoint drift. Base-only changes and the stale test merge were not attributed to this PR.
Still necessary on main: The fetched main version of listTranscriptLibrary still consumes store.iterateReadEntries and performs host-side collection and projection. The existing worker-backed tool reads therefore do not supersede this public-page cutover; no merged replacement was established.
Bounded worker collection: Public pagination now requests the existing worker operation with public projection. The collector retains lookahead without decoding that row, measures projected entries, and returns entries plus hasMore; the host checks the complete response after presentation.
Findings None None.
Security None None.

How this fits together

The meeting library reads saved meeting transcripts from OpenClaw’s shared SQLite store for Gateway clients and agent tools. The worker collects bounded pages, while the host adds current capture information and authorizes disclosure.

flowchart TD
  A[Library request and filters] --> B[Transcript read worker]
  C[Saved meeting archive] --> B
  B --> D[Bounded page and public previews]
  D --> E[Live capture and provider presentation]
  E --> F[Current authority and response limit checks]
  F --> G[Library response or refusal]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +15, Tests +68, Docs +9. Total +92 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 9 108 93 +15
Tests 6 165 97 +68
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 282 190 +92

Review metrics

Metric Value Why it matters
Production versus test growth Production +108/−93 (net +15); tests +165/−97 (net +68) Production growth supports worker-safe projection and shared page collection while removing the host iterator; tests cover placement, pagination, limits, and disclosure guards.

Technical review

Best possible solution:

Keep one worker-owned bounded page collector, with host-owned live presentation and current authorization immediately before disclosure.

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

Yes, current-main source establishes the caller-thread SQLite pagination path, and the PR supplies a focused real-worker regression for its removal. This review did not execute a runtime reproduction.

Is this the best way to solve the issue?

Yes, reusing the existing transcript worker and collector is a focused solution that preserves the separate export snapshot lifetime and host-owned presentation.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded execution-placement improvement for meeting-library reads, with no demonstrated urgent outage or latency claim.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified repository-admin author qualifies for the trusted-author exemption. Supplemental real-worker regressions exercise public library pagination and caller-thread SQLite exclusion; authorization cases check refusal after revocation or cancellation. No stored-data contract changes, migration, or new permission grant were introduced.

Evidence

What I checked:

  • Pinned introduction: Reviewed the merge-base-to-head patch, rather than endpoint drift. Base-only changes and the stale test merge were not attributed to this PR. (e151db7f1991)
  • Still necessary on main: The fetched main version of listTranscriptLibrary still consumes store.iterateReadEntries and performs host-side collection and projection. The existing worker-backed tool reads therefore do not supersede this public-page cutover; no merged replacement was established. (src/transcripts/library.ts:88, a44817cd89af)
  • Bounded worker collection: Public pagination now requests the existing worker operation with public projection. The collector retains lookahead without decoding that row, measures projected entries, and returns entries plus hasMore; the host checks the complete response after presentation. (src/transcripts/store-read.ts:466, e151db7f1991)
  • Authorization before disclosure: The handler rechecks retained request authority and current archive visibility synchronously before respond. Added cases await the real store read, revoke request authority or archive visibility, or cancel the request, and assert that no page is returned. Existing coverage also rejects restricted archive readers. (src/gateway/server-methods/transcripts.ts:76, e151db7f1991)
  • Focused worker regression: The new production-facade regression reads cold and warm pages through the real worker while observing caller-thread SQLite activity; it checks tied-date pagination and omission of private source metadata. The body reports failing baseline observations and passing after-fix results. Tests were inspected but not executed during this read-only review. (src/infra/sqlite-worker-transcripts.test.ts:166, e151db7f1991)
  • Re-review repair: GitHub’s exact-head commit response confirms that the latest commit moves entry and notes type contracts into store-types.ts and adjusts producer annotations without changing runtime operations. The prior review retained no findings or published rank-up moves. (src/transcripts/store-types.ts:4, e151db7f1991)

Likely related people:

  • steipete: 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 (1 earlier review cycle)
  • reviewed 2026-10-04T21:17:43.013Z sha af8f378 :: needs maintainer review before merge. :: none

Move the entry and notes data contracts to the existing leaf types module so worker-side projection does not depend on the full store. Preserve the producer shapes and runtime behavior.

Validation: reproduced the static import cycle before the fix; pnpm check:architecture, 31 focused worker/library tests, core types, targeted lint, formatting, diff check, and scoped autoreview passed.
@steipete
steipete merged commit 65bfe17 into main Oct 4, 2026
125 of 127 checks passed
@steipete
steipete deleted the steipete/sqlite-meeting-library-worker-pages branch October 4, 2026 21:34
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…ript read worker (openclaw#165111)

* perf(transcripts): serve meeting-library pages from the read worker

* fix(transcripts): keep read projection contracts acyclic

Move the entry and notes data contracts to the existing leaf types module so worker-side projection does not depend on the full store. Preserve the producer shapes and runtime behavior.

Validation: reproduced the static import cycle before the fix; pnpm check:architecture, 31 focused worker/library tests, core types, targeted lint, formatting, diff check, and scoped autoreview passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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