Skip to content

fix(talk): bound durable transcript persistence - #117214

Merged
vincentkoc merged 6 commits into
mainfrom
fix/talk-transcript-persistence-bound-clean
Aug 1, 2026
Merged

vincentkoc merged 6 commits into
mainfrom
fix/talk-transcript-persistence-bound-clean

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Related: #116201

What Problem This Solves

Fixes an issue where durable Talk transcript persistence could retain an unbounded backlog when the Gateway persistence path stalled, increasing memory use for a long-running voice session.

Why This Change Was Made

Adds one bounded serial queue and transcript-operation policy at the Talk owner boundary, then adopts it in the durable client voice session. Accepted writes remain FIFO, overflow is terminal until explicit close, capacity-waiting control work cannot seal transcript admission, and close seals and drains accepted work before releasing the session.

This is the foundation for two separate adoption PRs:

It does not change provider, config, environment-variable, protocol, SDK, or storage-schema surface.

User Impact

Long-running Talk sessions keep transcript persistence memory bounded without reordering accepted transcript writes, admitting empty finalized transcripts, resurrecting an overflowed queue after drain, or starving control work in an infinite retry loop.

Evidence

  • 35 focused tests passed across durable client voice sessions, the transcript registry, the shared bounded queue, and Gateway Talk client methods.
  • Coverage includes active + 40 FIFO admission, 9,959 deterministic overflow rejections, rejection after the accepted prefix drains, 10,000 whitespace transcripts followed by a real transcript, duplicate close, persistence failure recovery, independent sessions, non-sealing capacity waits, and explicit-close overflow release.
  • Repeated flushes for one stalled queue prefix return one shared promise, keeping flush bookkeeping O(1) while preserving the admission barrier.
  • Targeted formatting and git diff --check passed.
  • Code-exact P1 autoreview on b786f4a804f8ae050def290c8c439934b8eb718f: no accepted or actionable findings; patch correct at 0.90 confidence. The live head a947b737f1dd47af2cc8d30a67d25b0339ab866b is a signed changelog-only child with identical Talk/shared source and test bytes.
  • The same code-exact tree passed a Blacksmith Testbox production build on tbx_01kyxwp1pd3tmkt2dqzndcvmvt in 4m35s.
  • The scoped remote changed gate passed conflict-marker detection and stopped only on the then-current main environment-count ratchet (515 below budget 517); this PR changes no environment or config surface. The dedicated ratchet repair landed separately in chore(ci): lower environment variable budget #117224.
  • A dist-backed ephemeral Gateway proof passed on the combined stack: both client-owned and relay-owned transcripts persisted, both durable sessions closed with voiceStatus: closed, and the relay tool-call path remained accepted.
  • Combined-stack live OpenAI Realtime proof passed the backend bridge, browser WebRTC/audio path, and a three-cycle audio retry: 48,000-55,200 audio bytes per cycle, matching user/assistant transcripts, response.done each cycle, and zero late audio.
  • Exact-head hosted CI passed with 80 checks successful, 39 skipped, and zero pending or failed checks.
  • ClawSweeper reviewed exact head a947b737f1dd47af2cc8d30a67d25b0339ab866b with no findings or security issues and judged the Talk owner boundary the best repair.
  • No exact open PR or issue duplicates this owner boundary.

AI-assisted implementation; the maintainer reviewed the code, ownership split, and proof.

@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Aug 1, 2026
@vincentkoc vincentkoc added the P1 High-priority user-facing bug, regression, or broken workflow. label Aug 1, 2026
@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@clawsweeper clawsweeper Bot added 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. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:40 AM ET / 05:40 UTC.

ClawSweeper review

What this changes

This PR adds a bounded FIFO queue for durable client Talk transcript persistence, limiting stalled writes while preserving accepted transcript order and close behavior.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this member-authored, maintainer-labeled PR open for maintainer review. The exact head replaces the current unbounded per-session promise chain with a bounded FIFO owner that preserves accepted-write order, seals admission on real overflow, and drains accepted work before close; source and focused regression coverage support the approach, with no discrete correctness finding found.

Priority: P1
Reviewed head: a947b737f1dd47af2cc8d30a67d25b0339ab866b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a coherent owner-boundary repair with targeted lifecycle coverage and no identified correctness finding; exact landing-head CI and merge-state refresh remain the final confidence reducer.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository MEMBER, so the external-contributor real-behavior gate does not apply; the PR body nevertheless reports Gateway and live Realtime proof, but this read-only review could not independently fetch its linked artifacts because network resolution was unavailable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository MEMBER, so the external-contributor real-behavior gate does not apply; the PR body nevertheless reports Gateway and live Realtime proof, but this read-only review could not independently fetch its linked artifacts because network resolution was unavailable.
Evidence reviewed 6 items Current unbounded owner: Current main serializes each client voice operation by chaining it after the prior per-session promise, with no count or byte budget for a stalled persistence operation.
Bounded queue implementation: The PR queue separately tracks active work and bounded waiting work, seals admission on overflow, and retains the admitted prefix for flush/close.
Owner-boundary lifecycle: The PR routes client transcript writes through the registry and closes by synchronously sealing admission, draining accepted work, then running the existing close owner.
Findings None None.
Security None None.

How this fits together

Talk voice sessions turn user and assistant transcript events into durable session-history writes. The durable client-session owner serializes those writes, and this PR changes that owner so a stalled persistence backend cannot accumulate unbounded waiting transcript work.

flowchart LR
  A[Voice transcript events] --> B[Durable client Talk session]
  B --> C[Transcript operation registry]
  C --> D[Bounded FIFO queue]
  D --> E[Session transcript persistence]
  C --> F[Overflow or close barrier]
  F --> G[Closed voice session]
Loading

Before merge

  • Resolve merge risk (P1) - Merging changes the terminal sequencing of durable transcript persistence: a real overflow now stops later transcript admission until explicit close, so the exact current-base head should retain focused lifecycle proof before landing.
  • Resolve merge risk (P1) - GitHub reports this branch as behind current main and its required checks were still running in the supplied context; refresh merge-head validation rather than relying only on the earlier reviewed head.
  • Complete next step (P2) - This is a member-authored, maintainer-labeled session-state repair with no mechanical finding to dispatch; the maintainer should refresh the exact landing head and decide sequencing before the stacked relay and browser adopters.
Agent review details

Security

None.

PR surface

Source +274, Tests +432. Total +706 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 378 104 +274
Tests 3 432 0 +432
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 810 104 +706

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #116201
Summary: This PR is a candidate repair for the durable client-session transcript backlog described by the broader realtime voice resource-retention issue; the relay and browser branches are separate owner-boundary follow-ons.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Refresh the landing-head lifecycle proof (recommended)
    Rebase or otherwise refresh the clean merge result and confirm the focused transcript queue tests still cover overflow, accepted-prefix drain, and duplicate close on the exact landing head.
  2. Accept the tested queue policy
    Maintain the bounded, terminal-overflow policy if maintainers accept that later transcripts are intentionally rejected after the persistence backend cannot keep up.

Technical review

Best possible solution:

Land the bounded queue as the shared durable-client foundation after exact current-base validation, then keep the relay and browser owner changes in their separate stacked PRs so each lifecycle boundary remains independently reviewable.

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

Yes, from source: current main appends every transcript operation to an unbounded per-session promise chain at src/talk/client-voice-session.ts:61, so a stalled transcript write admits arbitrary later operations. The exact head supplies focused stalled-write and capacity regression tests, although this read-only review did not execute them.

Is this the best way to solve the issue?

Yes: the best repair is at the durable client-session operation owner, where writes are admitted and close is ordered, rather than truncating or dropping work downstream in the persistence accessor. The separate relay and browser adopters remain correctly isolated in #117215 and #117216.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bcff3a0de3a9.

Labels

Label justifications:

  • P1: A stalled durable transcript backend can retain unbounded work during real long-running Talk sessions.
  • merge-risk: 🚨 session-state: The branch changes queue admission, persistence ordering, overflow, and close behavior for stored voice-session transcripts.
  • 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 author is a repository MEMBER, so the external-contributor real-behavior gate does not apply; the PR body nevertheless reports Gateway and live Realtime proof, but this read-only review could not independently fetch its linked artifacts because network resolution was unavailable.

Evidence

What I checked:

  • Current unbounded owner: Current main serializes each client voice operation by chaining it after the prior per-session promise, with no count or byte budget for a stalled persistence operation. (src/talk/client-voice-session.ts:61, bcff3a0de3a9)
  • Bounded queue implementation: The PR queue separately tracks active work and bounded waiting work, seals admission on overflow, and retains the admitted prefix for flush/close. (src/shared/bounded-serial-queue.ts:18, a947b737f1dd)
  • Owner-boundary lifecycle: The PR routes client transcript writes through the registry and closes by synchronously sealing admission, draining accepted work, then running the existing close owner. (src/talk/client-voice-session.ts:66, a947b737f1dd)
  • Focused regression coverage: The exact head adds coverage for FIFO ordering, count/weight capacity, non-sealing capacity waits, flush-prefix behavior, terminal overflow, accepted-prefix close, whitespace handling, failed persistence recovery, and independent session ownership. (src/talk/client-voice-session.test.ts:301, a947b737f1dd)
  • Feature provenance: The existing serial-operation helper dates to the client-voice session work introduced by this commit; the PR replaces that same owner boundary rather than adding a downstream workaround. (src/talk/client-voice-session.ts:61, 89394978e0a6)
  • Current-main and release check: The inspected checkout is current main at bcff3a0; the supplied latest release is v2026.7.1, so this open PR is not already implemented on current main or in that release. (src/talk/client-voice-session.ts:45, bcff3a0de3a9)

Likely related people:

  • Peter Steinberger: Current main attributes the original per-session serial-operation helper to this commit, making this person the strongest historical routing candidate for the owner boundary being replaced. (role: feature introducer; confidence: high; commits: 89394978e0a6; files: src/talk/client-voice-session.ts)
  • Vincent Koc: Recent merged history includes Talk and voice-call fixes, and this contributor authored the current bounded-persistence implementation. (role: recent area contributor; confidence: high; commits: 2838a2a0ea5c, 645929da80ed; files: src/talk/client-voice-session.ts, extensions/voice-call/index.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the focused queue/lifecycle proof and required checks on the exact current-base landing head.

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 (2 earlier review cycles)
  • reviewed 2026-08-01T04:58:31.341Z sha c63efed :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T05:26:34.720Z sha 0546c98116b5cbf7187969786770c3807a0dc69b :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review August 1, 2026 05:14
@vincentkoc
vincentkoc force-pushed the fix/talk-transcript-persistence-bound-clean branch from 0546c98 to b786f4a Compare August 1, 2026 05:32
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc merged commit fcb7338 into main Aug 1, 2026
133 checks passed
@vincentkoc
vincentkoc deleted the fix/talk-transcript-persistence-bound-clean branch August 1, 2026 05:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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