Repository navigation
perf(transcripts): serve public meeting-library pages from the transcript read worker - #165111
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 5:25 PM ET / 21:25 UTC (Revision 2). ClawSweeper reviewWhat this changesMoves 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +15, Tests +68, Docs +9. Total +92 across 16 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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.
|
Merged via squash.
|
…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.
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
hasMoreresult. 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_utterancescontains 24,966 utterances / 7.4 MiB. No supplied slow-hold label isolates this library. The 347session transcript match readholds 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 callerpreparecalls 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.pnpm test src/infra/sqlite-worker-transcripts.test.ts --maxWorkers=1pnpm test src/transcripts/library.async.test.ts --maxWorkers=1pnpm test src/transcripts/library.query-budget.test.ts --maxWorkers=1pnpm test src/transcripts/library.test.ts --maxWorkers=1pnpm test src/transcripts/library.search.test.ts --maxWorkers=1pnpm test src/transcripts/store.test.ts --maxWorkers=1pnpm test src/transcripts/status.test.ts --maxWorkers=1pnpm test src/transcripts/status.metadata.test.ts --maxWorkers=1pnpm test src/transcripts/status.occupancy.test.ts --maxWorkers=1pnpm test src/transcripts/status.provider-reload.test.ts --maxWorkers=1pnpm test src/transcripts/status.producer.test.ts --maxWorkers=1pnpm test src/transcripts/status.producer.shutdown.test.ts --maxWorkers=1pnpm test src/agents/tools/transcripts-tool-read.test.ts --maxWorkers=1pnpm test src/gateway/server-methods/transcripts.test.ts --maxWorkers=1All 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
37235034410exposed 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 existingstore-types.tsleaf; producer return annotations enforce the same shapes. Runtime behavior is unchanged.The original
pnpm check:madge-import-cyclesfailure reproduced locally. After the repair, the fullpnpm check:architecturepassed, including zero runtime-value and static import cycles. The combined focused commandTMPDIR=/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=1passed all 31 tests in 59.00 s wrapper wall time. Core types, targeted oxlint, formatting, andgit diff --checkpassed; 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.