Skip to content

refactor(sessions): move title reads off main and drop redundant SQL - #169177

Merged
steipete merged 6 commits into
mainfrom
dbasync/sessclass-b
Oct 11, 2026
Merged

steipete merged 6 commits into
mainfrom
dbasync/sessclass-b

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Historical dashboard title generation still read SQLite on the Gateway thread, and transcript suffix replacement reread a derived prefix already established by the current writer transaction.

User Impact

Historical title reads use the existing worker path. Transcript suffix replacement uses one fewer SQL statement without changing canonical transcript validation, retained payloads, ordering, permissions, or update behavior.

Why This Change Was Made

Reuse readSessionTitleFieldsFromTranscriptAsync for durable and incognito title sources. For suffix replacement, compare the previous and replacement projections already derived from the canonical bytes in this transaction instead of selecting the same surviving derived rows again.

Removed check and accepted edge: unsupported direct edits to derived active-prefix rows are repaired by projection reconciliation; each suffix replacement no longer checks for them independently. The exact canonical-byte check still rejects stale replacement after an intervening append.

Main-thread audit

Audited 62 files / 167 original T1 call sites in the assigned S–Z session scope. Result: 61 files / 165 T1 sites. One SQL call deleted; one startup-only native probe reclassified T2; one actual Gateway title flow moved to its existing worker. No entire file was falsely marked worker-only. The shared title reader remains available to released synchronous callers, so moving this flow does not erase its shared lexical inventory site.

hasPendingCanonicalSessionValidation is native only for startup/Doctor admission. Runtime authorization and prepared-row callers supply PendingCanonicalValidation.source and bypass the native probe; the other caller is the mutation worker.

The remaining sites are real mixed native/worker code. They include released synchronous SessionManager/SDK contracts, process-held unbound incognito stores, final sharing/disclosure and workspace deletion authority, and native target discovery. Eliminating them requires the corresponding SDK/incognito/discovery owner cutover; renaming kernels would hide existing main-thread access. The retained authority checks protect real user data or effects and are intentionally preserved under the lane's escape hatch.

SQL measurements

Three alternating pairs; figures are median [min–max]. All native SQL executions, including transaction and admission statements, are counted. Requests count observed logical broker/worker/resource requests.

Metric Base Candidate
Warmed all-thread statements / turn 336.9 [336.7–341.6] 337.1 [334.4–341.9]
Warmed requests / turn 89.3 [89.3–89.7] 89.4 [89.1–89.8]
Warmed MAIN statements / turn 0 [0–0] 0 [0–0]
Whole-workload statements 9,755 [9,749–9,770] 9,749 [9,745–9,754]
Whole-workload requests 1,697 [1,695–1,697] 1,700 [1,699–1,710]

Warmed differences (+0.06% statements, +0.11% requests) are below the 0.5% noise floor. The changed title/suffix paths are absent from those ordinary warm-turn deltas; differences are in unchanged session actor, row-fact reads and asynchronous admission completion. The warmed candidate/base duration ratio is 0.987; first-turn ratio is 1.095, both below 1.5.

First-turn statements are 1,066 → 1,079, with deferred catalog/plugin/memory work and native state-lease work shifting across startup windows. The combined boot+connect+first-turn statement totals are base [4,132, 4,070, 4,116] vs candidate [4,139, 4,111, 4,057], median 4,116 → 4,111. Whole-workload statements also decrease. The one additional ambiguity pair on a fresh AWS host also decreased the whole workload: statements 9,805 → 9,802 and requests 1,709 → 1,708; first-turn statements and requests were identical (964 / 182). Its warmed figures were 340.7 → 341.1 statements and 89.1 → 89.2 requests, still below the noise floor. This confirms redistribution rather than additional ordinary-turn work.

Per operation: full incremental suffix replacement deletes one SELECT and adds zero worker requests; ordinary warm turns do not invoke that replacement. Durable historical title generation uses the existing worker read in place of host reads, proven by the title-owner regression. The fixed workload does not invoke that historical-title branch, so no workload saving is claimed for it.

Measurement source is the original base 78d72c97a85c9e16a0ac17edb7a91b5f246a12fc versus 825c41af31184ca672c9d3976e16ca141a579358, using three alternating M,C pairs in one isolated Testbox invocation. The shared harness workload is unchanged; its private copy adds the existing transport census observer to count logical requests. Subsequent changes only update title-reader test mocks, prune their baseline entries, and merge current main; both integration conflicts were confined to regenerated inventory documentation. No SQL-path conflict edit occurred, so this proof is reused under the campaign rule.

Evidence

  • Remote title suites: 125 tests in 2 files, Vitest 74.74 seconds (77.70 seconds including wrapper command). Added regression proves worker title reads observe an in-process append and rewrite with zero warmed host data SQL; the orchestration regression awaits a deferred transcript read.
  • Remote suffix/FTS/canonical-readiness suites: 51 tests in 3 files, 43.27 seconds including wrapper command. Existing real-owner regressions preserve an intervening append and read fresh active/FTS projections after replacement.
  • Integrated head e7ea45f1b881c: core typecheck, all 28 core-test typecheck shards, T1/dialect/mock ratchets, and the other completed check:changed guards pass. Full check:changed is red only on seven Knip full-tree unused-export findings in untouched Telegram and subagent-registry files; The same seven findings reproduce on fetched main fe498079698b5fb73e08dcb164b3eee988e669be, in the same files and symbols. They are inherited; no changed file has a Knip finding. Production and script Knip scans pass. Madge passed. Final head 64c5ee37ca1a39e0756ffedcf678ae811139e408 passes type-aware oxlint for every changed TypeScript file and the inventory script, export-name collisions, and the exact mock-export ratchet. The final-head discussion suite passes remotely too: 15 tests, 28.05 seconds Vitest.
  • CI found an outdated synchronous title-reader mock in session-discussion.test.ts. The fixture now mocks the async owner; all 15 discussion tests pass locally (25.02 seconds Vitest / 30.75 seconds wrapper).
  • Two isolated Codex autoreview rounds: no actionable P0–P2 findings. No further review round.
  • CI: final-head run 38150704349 has an unrelated chat-panel-layout.e2e.test.ts timeout waiting for the terminal canvas to become visible. The identical test and hidden-canvas timeout fail on main run 38147604740, head 6233a19ea75bbcd079ec4dbe4660bfef9b9321ed. The PR fixture regression is fixed and its focused proof passes. Landing uses the authorized relaxed inherited-failure/slow-CI exception. Native review setup failed twice on missing @openclaw/proc-safe; use the authorized head-pinned REST squash fallback.
  • No SDK surface, schema, migration, Doctor, updater, plugin-loading, or service-lifecycle change; SDK diff and published-driver update cell are not applicable.
  • Production LOC: +12/−32 (net −20); tests +62/−13; inventory/docs +37/−8; mock baseline −2. No changelog edit; release-note context is this PR.
Per-file T1 audit (original → candidate)

Native caller evidence follows. Worker execution of the same shared helper is insufficient for a worker-only classification.

File under src/config/sessions/ Before After Remaining native caller / disposition
session-accessor.sqlite-suffix-read.ts 4 4 SessionManagerSuffixPersistence.removeTrailingEntries() uses readPreviousIndexedTranscriptEventSync and loadTranscriptSuffixEventsBoundedSync; deprecated public synchronous SDK contract. The async method retains an unbound-incognito/no-admission branch.
session-accessor.sqlite-transcript-anchor.ts 2 2 Synchronous manager current-turn and reload paths, public readActiveTranscriptEntryAnchor, and native model-context readers. Source-authority variant also checks permission/lifecycle before context disclosure.
session-accessor.sqlite-transcript-identity.ts 2 2 transcript-store.ts uses these identity reads from the native synchronous append APIs; generation-copy also shares the owner.
session-accessor.sqlite-transcript-incremental-read.ts 1 1 session-accessor.sqlite-read.ts exports synchronous delta/read APIs and uses this helper in native transcript correction.
session-accessor.sqlite-transcript-message-append.ts 1 1 Counted site is the optional physical payload reuse read in prepareTranscriptMessageAppend. session-manager-append.ts supplies its candidate from the native synchronous append route.
session-accessor.sqlite-transcript-message-rewrite.ts 3 3 Raw callback APIs remain public synchronous-transaction contracts. Prepared wrapper selects native only off the main thread or when database execution is unsupported; unbound native maintenance remains.
session-accessor.sqlite-transcript-metadata-read.ts 2 2 Shared session-accessor.sqlite-read.ts native public readers use message-presence and header reads.
session-accessor.sqlite-transcript-mirror.ts 3 3 withTranscriptWriteLock → runNativeTranscriptWriteLock → readTranscriptMirrorFacts retains the native lock callback contract.
session-accessor.sqlite-transcript-parent.ts 5 5 Same parent resolution functions run in synchronous manager append, compaction and transcript read/write APIs.
session-accessor.sqlite-transcript-presence.ts 1 1 ensureTranscriptHeader and provenance are also reached by native synchronous append and initialization contracts.
session-accessor.sqlite-transcript-reports.kernel.ts 1 1 withNativeCurrentTranscript invokes report selection for an unbound process-held incognito store.
session-accessor.sqlite-transcript-reports.ts 1 1 Only counted site is withNativeCurrentTranscript. Its callers require !binding && isProcessHeldTranscript; the process-held owner's migration is the remaining boundary.
session-accessor.sqlite-transcript-sequences.ts 2 2 Native synchronous append captures final positions; public rememberCommittedTranscriptMessageSequences opens the native owner. Pure getter/installation callers do not execute SQL.
session-accessor.sqlite-transcript-state.ts 14 14 Shared state kernels run through synchronous manager reload, append, suffix rewrite, compaction, import and public native transcript writers. Schema/Doctor paths also use this owner; they do not erase runtime native callers.
session-accessor.sqlite-transcript-stats.ts 3 3 readTranscriptStatsBatchReadOnlySync reaches the batch kernel and is explicitly exported by src/plugin-sdk/memory-core-host-engine-sessions.ts. Other native transcript readers use the single-row query.
session-accessor.sqlite-transcript-store.ts 1 1 Counted operation is the idempotency relocation write inside appendTranscriptEventInTransaction; synchronous manager/transcript writers share it. Doctor and migration callers additionally share rewrite helpers.
session-accessor.sqlite-transcript-suffix-idempotency.ts 2 2 The same kernel is used by the deprecated synchronous manager suffix API.
session-accessor.sqlite-transcript-suffix-write.ts 1 1 Public synchronous replaceTranscriptSuffixEventsSync, reached by the synchronous manager suffix API.
session-accessor.sqlite-transcript-suffix.ts 12 12 Called by the shared synchronous suffix-write kernel above.
session-accessor.sqlite-transcript-turn.ts 2 2 nativeReservation and released transaction-local callbacks (shouldAppendInTransaction, prepareMessageAfterIdempotencyCheck, beforeFreshMessageCommit) retain native execution. Bound actor paths reject unsupported callback compositions.
session-accessor.sqlite-transcript-watermark.ts 1 1 Public synchronous watermark API; native correction fallback; synchronous legacy chat-start notification fallback. Dashboard title's durable caller was moved to the existing awaited title reader.
session-accessor.sqlite-transcript-write-guard.ts 1 1 Counted operation is the closure returned by createSessionTranscriptOwnerPredicate, with two real Gateway-main callers: workspace recovery and durable ACP reset. These are final workspace-effect and ACP rebinding guards, not worker-only code.
session-accessor.sqlite-transcript-write-snapshot.ts 2 2 Synchronous manager persistence and the public withTranscriptWriteTransaction callback contract.
session-accessor.sqlite-transcript-write.ts 6 6 Public branch/exact-rewrite/raw-event/native lock APIs remain; withTranscriptWriteLock selects native for non-main-thread or unsupported execution. Synchronous manager persistence uses the snapshot exports.
session-accessor.sqlite-worktree-owner.ts 1 1 agents/worktrees/owner-protection.ts → resolveSessionEntryAccessTarget(..., { projection: "worktree" }) → loadExactSessionEntryCandidates → this reader. Protects real filesystem deletion/ownership, so retain pending owner-boundary migration.
session-canonical-key.ts 2 2 Keep mixed. assertCanonicalSqliteSessionKeysCurrent is reached from native entry-cache/availability/inventory/replacement/reset owners as well as worker entry handlers. markCanonicalSessionValidationPending is reached by shared entry-store/transcript-state kernels and Doctor writes. Setter is already T2.
session-canonical-validation.ts 1 0 Reclassify only hasPendingCanonicalSessionValidation T2 with the evidence above.
session-cold-storage-inventory.ts 2 2 Mixed: session-cold-storage-worker.ts:685-687 is worker-only, but session-cold-storage-status.ts:127 directly calls this kernel for retained native incognito stores. The status facade filters bound actors out first; unbound native stores remain.
session-cold-storage.ts 1 1 Mixed: restoreSessionColdTranscript.readNativeMetadata is used when no preparation exists. Durable callers prepare metadata through owner.readColdMetadata; native incognito retains two direct reads (:540, :555).
session-entry-snapshots.ts 2 2 Shared writer kernel, not W: session-accessor.sqlite-entry-store.ts:273,654 and commands/doctor/shared/session-entry-rewrite.ts:284. Entry-store remains shared by native sync entry mutation/replacement and worker writers. SQL side snapshot columns intentionally avoid loading excluded large snapshot values; keep projection in SQL.
session-group-categories.read.ts 1 1 Mixed: worker session-sharing-store.worker.ts and session-incognito-side-data.worker.ts; native fallback closure in session-group-categories.ts:89.
session-group-categories.ts 1 1 Native closure passed to runSessionCollaborationWrite; its dispatcher executes this closure at session-sharing-store.async.ts:202-212 only for unbound native incognito. Actor-bound incognito and durable stores use their worker commands.
session-history-eviction-candidates.ts 2 2 Mixed: session-transcript.worker.ts:176-191 dispatches worker calls; session-history-eviction.ts:197 calls historical IDs directly for reclamationMode === 'in-process' or incognito and :230 calls archived batch directly for incognito.
session-history-eviction.ts 1 1 The direct archived batch read above. Existing worker operation is readArchivedEvictionCandidates; historical IDs uses readHistoricalEvictionCandidates. Cannot mark facade W.
session-history.ts 1 1 Mixed: worker cost-usage/history/memory paths; native SDK src/plugin-sdk/memory-core-host-engine-sessions.ts:83,118 runs listSessionTranscriptInstances as final durable ingestion guards and deprecated sync discovery. Those are explicit retained SDK/authority contracts, not pure worker implementation.
session-pending-input-history-reconcile.ts 3 3 Mixed: session-incognito.worker.ts:402 and execution-worker operation registry call it; session-pending-input-history.ts:192 directly invokes it for unbound native incognito history. Real queued-input custody is rechecked at effect; do not drop it merely as bookkeeping.
session-pending-input-history.kernel.ts 3 3 Mixed: session-pending-input-history-read.worker.ts:15, session-incognito-history.worker.ts:331; native session-pending-input-history.ts:176.
session-pending-input-history.ts 1 1 readIncognito retains native readonly call for unbound incognito. Actor-bound requests use createIncognitoPendingInputHistoryReader; durable requests use history worker.
session-pending-input-operations.kernel.ts 3 3 Mixed: incognito/actor worker handlers and agent execution operations; session-pending-input-store.ts direct nativeMutation and direct incognito read are still callable. Native mutation also implements released synchronous completion on file-backed stores via session-accessor.pending-inputs.ts:364, not only incognito.
session-pending-input-source.kernel.ts 4 4 Mixed: history read worker and pending operations kernel; session-pending-input-source.ts:87 directly calls it for unbound native incognito. Source class also contains completion, pending-input and transcript visibility reads, not four duplicate existence checks.
session-pending-input-store.ts 1 1 Direct transaction is the nativeMutation closure for released synchronous recorder completion (session-accessor.pending-inputs.ts:364) plus unbound incognito mutate; actor-bound and ordinary durable mutate dispatch to workers.
session-reaction-store.kernel.ts 5 5 Mixed: agent/side-data worker handler; native setSessionReactionAsync fallback at session-reaction-store.ts:132-152. Existing message identity, session binding and reaction cap checks protect real stored data/access, not arbitrary paranoid checks.
session-reaction-store.read.ts 1 1 Mixed: worker history/side-data readers; native listSessionReactions at session-reaction-store.ts:204-214, called from gateway/session-transcript-readers.ts:425-431 for unbound process-held history.
session-reaction-store.ts 1 1 Direct transaction for native incognito at :141; durable route is session.reaction.set, bound incognito route is same named side-data operation.
session-sharing-store.kernel.ts 2 2 Mixed and security-sensitive: hasSessionMemberInDatabase is consumed by final native access guard in gateway/session-sharing-worker-grant.ts:289; listSessionMembersInDatabase is used by gateway/session-sharing-source.ts:564 in final source disclosure/transfer authority. Also legacy unbound incognito and native policy facades. Keep current effect-boundary authorization.
session-sharing-store.native.ts 4 4 Native mutation wrappers are used in sharing worker and callback closure of session-sharing-store.async.ts:435,472; that closure still executes for unbound native incognito.
session-sharing-store.ts 1 1 Synchronous readSessionMembers feeds listSessionMembers, isSessionMember, and unbound incognito readSessionMembersInWorker. Native policy: gateway/session-sharing-policy.ts:307; native row projection: gateway/session-row-projection-materialize.ts:380; retained native store: gateway/session-utils-store-retained.ts:332.
session-suggestion-store.kernel.ts 8 8 Mixed: suggestion writer wrappers plus reads from transcript/side-data workers, and unbound incognito direct read at session-suggestion-store.read.ts:68.
session-suggestion-store.ts 4 4 Native add/claim/release/finalize wrappers used by session-sharing-store.worker.ts:129-138 and closures in session-metadata-write.async.ts:69,84,99,114, which run directly for unbound native incognito. Reexported by src/config/sessions.ts:27.
session-transcript-fts.ts 1 1 T1 mixed: native SDK suffix/store/index operations reach the same delete. T3 edge: src/infra/state-migrations.session-window-repair.ts uses the same delete for Doctor repair. No independently counted worker-only expression.
session-transcript-index.ts 9 8 T1 mixed for shouldRebuildSessionTranscriptIndexSynchronously, readSessionTranscriptProjectionState, readSessionTranscriptIndexStatus, deleteActiveEventRows, deleteSessionTranscriptIndexInTransaction, both suffix-replacement expressions, listSessionsNeedingTranscriptIndexReconcile, and deleteOrphanedTranscriptIndexRowsInTransaction. Native SDK reaches store rebuild/suffix/delete; unbound incognito reconcile reaches list/orphan cleanup via projection-writer/reconcile. T2/T3 edges: state-migrations.media-persistence.ts:319 and import/repair call synchronous reconciliation.
session-transcript-match.ts 1 1 T1 expression at :90: findTranscriptEvent explicitly uses native read-only SQLite when isIncognitoSessionKey(captured.sessionKey) and binding acquisition returned undefined. Ordinary callers include heartbeat publication, background-session result, internal-source reply persistence and chat source finalization. The matching predicate's active-anchor read is likewise shared, not worker-only.
session-transcript-projection-rebuild.ts 12 12 T1 mixed at the actual counted operations: readProjectionSession is also reached through synchronous visitSessionTranscriptProjection → index rebuild; hasUnclassifiedSessionTranscriptEvents is shared by synchronous appends/status; snapshot/claim/chunk/finalize helpers are reached by native projection-writer fallback. prepareSessionTranscriptProjection itself is W-only but contains no counted primitive; marking its shared callees W would be incorrect.
session-transcript-projection-writer.ts 2 2 T1 runProjectionWrite.write :111 is a native transaction fallback, used in reconcile.ts:238+ and readSessionTranscriptIndexStatus:329+ whenever no execution/binding exists. T1 final session-key query :241 is inside that same fallback. Explicit schema maintenance variants can be T2/T3, but the lexical expressions also execute for ordinary unbound incognito.
session-transcript-read-fence.ts 1 1 T1 mixed SQL :169: native session-manager-reload.ts:146, sync accessor read/model-context/current-turn/suffix readers reach it. It checks the captured turn's visible position, generation and role. Retain the actual boundary until actor admission and native SDK ownership are addressed; do not classify all imports as SQL callers.
session-transcript-reconcile-memory.ts 2 2 T1 mixed readSnapshot :36 and source read :158: captureMemoryTranscriptProjectionSource creates the same source in host reconcile.ts:200,484 and projection-writer; src/infra/session-cost-usage-worker-runtime.ts:506 services memory-transcript from the parent-owned native incognito database. Framing the bytes does not make the SQL off-thread.
session-transcript-reconcile-readiness.ts 1 1 T1 native withOpenClawAgentDatabaseReadOnly :104 is the unsupported-execution fallback. It includes ordinary unbound incognito, plus permitted maintenance variants. prepareReconcileParams itself performs no SQL.
session-transcript-retained-data.ts 1 1 T1 mixed copyRetainedTranscriptPayload :124: stageRetainedTranscriptData → native SDK suffix replacement, and session-accessor.sqlite-transcript-store.ts:132 → native SDK store operations. The affected-row result is the effect outcome, not a redundant pre-read. Keep the SQL-side opaque payload copy/projection.
session-transcript-search.ts 4 4 T1 mixed all 4: isSessionTranscriptSearchCurrentSync :87 and searchSessionTranscriptsReadOnlySync :324/:353/:415 also run from the explicit native incognito branch :265. Durable Gateway callers use workers; that fact does not remove the native path.
targets-read-availability.ts 1 1 Mixed: target-inventory worker path and native gateway/managed-image-session-read.ts:54 (explicit legacy native cleanup selection), Doctor migration context. Owner/bounded visibility checks must remain for shared stores; do not classify whole module W.
targets.ts 2 2 Main Gateway calls: gateway/server-cron.ts:514 invokes listKnownSessionStoreAgentIds; combined-store-gateway.ts:392 invokes it for fixed-store topology. resolveExistingAgentSessionStoreTargetsSync remains in native sessions-read/abort/session-utils-store-candidates and target availability. Worker inventory also calls these selectors.
transcript-payload.ts 1 1 readTranscriptStorageEncoding caches per native handle but is shared by worker writes, native session-manager append kernel and transcript-store writes, and payload migration. It cannot be W just because it also serves hydration worker. Metadata projection/compression must remain SQL-side where it avoids transferring retained bodies.

@clawsweeper

clawsweeper Bot commented Oct 11, 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 scripts Repository scripts size: S labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves historical session-title reads to the existing worker and removes a redundant transcript-prefix SQL read.

Example: An untitled session contains “Original release plan” followed by “Latest follow-up.”

  • Before: Title generation reads the original message synchronously on the Gateway thread.
  • After: Title generation awaits the history worker and still names the session from “Original release plan.”

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and the previous finding is resolved; confidence rests on source review and production-owner test evidence rather than shipped-entry-point coverage of the changed branches.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied title and suffix suites exercise production owners, while the reported Gateway workload does not exercise the changed branches.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Historical session naming performs transcript SQL on the Gateway thread, while suffix replacement rereads an already-derived prefix.
Reason: The maintainer-directed change reuses existing owners, reduces production code, and explicitly accepts the narrow derived-row tradeoff.

Merge readiness

✅ Ready for maintainer review

Keep this useful, maintainer-directed PR open. The latest commit resolves the previous fixture finding, and review found no remaining actionable patch defect.

Priority: P2
Reviewed head: 64c5ee37ca1a39e0756ffedcf678ae811139e408

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied Gateway workload excludes historical title generation and suffix replacement, and no base-failing execution of the awaited orchestration regression is recorded.
Agent review details

How this fits together

The Gateway title coordinator reads bounded transcript fields and persists generated names; the transcript writer maintains active-history and search projections from canonical events.

flowchart TD
  A[Dashboard or discussion request] --> B[Title coordinator]
  B --> C[History worker]
  C --> D[Transcript storage]
  C --> B
  B --> E[Session name persistence]
  F[Suffix writer transaction] --> D
Loading

Technical review

Best possible solution:

Retain the existing history-worker cutover and transaction-derived prefix comparison with the corrected discussion fixture.

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

Current-main source shows both the synchronous historical-title read and redundant prefix SELECT; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Reusing the established worker and projections derived under the existing writer transaction is a focused simplification that preserves the canonical-byte fence.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 2cccdd1 adds src/gateway/dashboard-session-title.ts:483 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2cccdd175dd5; files: src/gateway/dashboard-session-title.ts)
  • Josh Lehman: Raw commit 68be5fd adds src/config/sessions/session-transcript-index.ts:413 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 68be5fdcd14b; files: src/config/sessions/session-transcript-index.ts)

PR surface

Source -20, Tests +49, Docs +23, Other +4. Total +56 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 12 32 -20
Tests 3 62 13 +49
Docs 2 30 7 +23
Config 0 0 0 0
Generated 0 0 0 0
Other 2 7 3 +4
Total 9 111 55 +56

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a scoped performance improvement that reduces Gateway-thread database work without changing user configuration or public contracts.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T15:14:34.100Z sha e7ea45f :: needs changes before merge. :: [P2] Update the discussion fixture for the awaited title reader

Reviewed October 11, 2026, 11:24 AM ET / 15:24 UTC (Revision 2).

@clawsweeper clawsweeper Bot added 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@steipete
steipete merged commit ea576bd into main Oct 11, 2026
131 of 134 checks passed
@steipete
steipete deleted the dbasync/sessclass-b branch October 11, 2026 15:27
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…penclaw#169177)

Route historical dashboard title reads through the existing async transcript worker and remove the redundant surviving-prefix SELECT during suffix replacement. Preserve canonical-byte conflict detection and final effect-boundary authority.

Audit result: assigned T1 sites 167 -> 165; one query deleted, one startup-only probe reclassified, and one Gateway flow moved off main. Shared synchronous contracts remain documented. Warmed workload is unchanged within noise at about 337 statements and 89 requests, with zero MAIN statements.

Validated focused owner suites, final discussion fixture, type-aware lint, typecheck shards, export collisions, database ratchets, Madge, and two review rounds. Knip findings and terminal-canvas UI timeout reproduce on main. Landed under the authorized relaxed inherited-failure policy; native tooling failed twice on a missing dependency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S 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