Repository navigation
fix(voice-call): stream diagnostic logs with backpressure - #134838
Conversation
Co-authored-by: sunlit-deng <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 1:19 AM ET / 05:19 UTC. ClawSweeper reviewWhat this changesThis PR streams custom Voice Call diagnostic JSONL in bounded chunks with stdout backpressure, corrects SQLite tail startup history, and updates the related documentation and regression coverage. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep this PR open for normal maintainer review: current main still performs the unbounded custom-log reads, the prior documentation finding is addressed, and no blocking introduced defect was found in the reviewed patch. Priority: P2 Review scores
Verification
How this fits togetherVoice Call’s diagnostic CLI reads either the plugin’s persisted call history or an explicitly supplied JSONL file. It emits records to an operator pipe and computes latency summaries without changing live call delivery. flowchart LR
A[Voice Call CLI] --> B{Default history or custom log}
B -->|Default| C[SQLite call history]
B -->|Custom file| D[Chunked JSONL reader]
C --> E[Diagnostic output]
D --> E
E --> F[Operator pipe or terminal]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +56, Tests +268, Docs +13. Total +337 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared reader and SQLite-tail repair, then land after exact-head checks complete and a Voice Call owner approves the implementation. Do we have a high-confidence way to reproduce the issue? Yes—current-main source has the whole-file and append-sized allocation paths, and the PR supplies registered-CLI pressure evidence for the repaired behavior; this read-only review did not rerun it. Is this the best way to solve the issue? Yes—the single custom-log range/framing owner serves both tail and latency while preserving SQLite as the default history owner, avoiding duplicate streaming implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 12c4bdf7482f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Addressed the review's documentation finding and rank-up move in d2f3e64: both subcommand summaries now describe persisted call history and explicit custom JSONL logs. Runtime and tests are unchanged from the reviewed and green head. The production delta remains +56. This is the one shared range/framing owner for both diagnostic commands; it replaces the duplicated whole-file/append allocation paths and owns descriptor cleanup and stdout backpressure. No parallel diagnostic path or arbitrary record-size limit was added. The paused-pipe proof preserves exact output while reducing queued bytes from 4,242,477 to 66,207. I accept this bounded growth for those ownership and streaming guarantees. |
|
The final head d2f3e64 now has green exact-head CI: https://github.com/openclaw/openclaw/actions/runs/33472769322. The latest review confirms the documentation correction and finds no actionable defect. The suggested separate owner approval is not an enforced gate for this bounded diagnostic refactor: the touched paths have no restricted CODEOWNERS entry, and live main rules require the CI gate and linear history, not independent approval. Maintainer review is complete under the requested fix-and-land workflow; the shared-reader growth rationale and real CLI proof are recorded above. Proceeding through native prepare/merge without bypassing checks. |
|
Merged via squash.
|
…34838) * fix(voice-call): stream diagnostic logs with backpressure Co-authored-by: sunlit-deng <[email protected]> * docs(voice-call): align diagnostic command summaries --------- Co-authored-by: sunlit-deng <[email protected]>
What Problem This Solves
Replaces #111759 with a shared streaming implementation for Voice Call diagnostics. Custom JSONL tailing and latency analysis currently read whole files or appended regions into memory, and tailing keeps writing when stdout is blocked. SQLite tailing also retains every serialized snapshot for the process lifetime and unexpectedly backfills old history after
--since 0or--since 1.Why This Change Was Made
One descriptor/range reader now owns complete-line framing, initial history selection, partial records, file replacement, observed truncation, and descriptor cleanup. Tail reads and writes 64 KiB chunks and awaits stdout drain. Latency parses selected records individually, preserving requested history, normal JSON semantics, malformed-record skipping, and a final unterminated JSON record. No arbitrary byte window or record-size cap is introduced.
The SQLite tail loop primes deduplication from the existing retained history while printing only the requested initial records, then replaces the seen set with each retained snapshot. This changes ephemeral CLI state only: no schema, persistence, retention, configuration, dependency, or SDK change.
User Impact
Slow consumers no longer cause the CLI to queue the rest of a large append, rotation starts a fresh stream, and
--since 0follows new snapshots without replaying old history. Documentation now distinguishes the default SQLite store from explicit custom JSONL diagnostics. Thanks @sunlit-deng for the original work and report.Evidence
--since 0and--since 1startup behavior.Production +144/-88 (net +56), tests +268, docs net +13. The shared reader removes duplicate whole-file/append decoding and nested tail wrappers; the remaining growth owns bounded range reads, file identity, and output backpressure. The original proposal added 214 production lines.
Latency memory still scales with the largest selected JSON record plus requested metric samples. Concurrent in-place rewrites are not atomic snapshots: inode replacement and observed shrink reset the stream, but an undetected same-inode truncate/regrow between polls cannot be inferred.