Repository navigation
fix(google-meet): serialize caption state without crashing on __soy circular JSON - #140682
gaoanze888 wants to merge 1 commit into
Conversation
…ircular JSON (openclaw#140455) Google Meet's DOM attaches a __soy property whose object closes a cycle back to the node. The in-call status script stored the live DOM node in each visible caption row for lifecycle tracking, then passed those rows into JSON.stringify via recentTranscript — throwing "Converting circular structure to JSON" and leaving inCall unreported. Two fixes: 1. Root cause: strip the live DOM node from recentTranscript entries before serialization, keeping only the serializable {at, speaker, text} fields. 2. Defensive: add a circular-safe replacer to JSON.stringify that drops DOM nodes (nodeType check) and breaks cycles (WeakSet). Adds a regression test with a mock __soy circular reference.
|
🦞👀 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 real behavior proof before merge. Reviewed September 6, 2026, 10:59 PM ET / September 7, 2026, 02:59 UTC. ClawSweeper reviewWhat this changesThe PR removes live browser nodes from Google Meet caption status output, adds a defensive JSON serialization guard, and tests a circular-reference caption fixture. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, focused fix: current main and v2026.9.2 retain the failing serialization path. No blocking code defect was found, but the submitted evidence does not yet demonstrate the patched behavior in a real Meet session. Priority: P1 Review scores
Verification
How this fits togetherThe Google Meet plugin runs a browser script to collect meeting status and captions. The returned JSON feeds meeting health checks, which determine whether the participant is in the call and ready for audio. flowchart LR
A[Meet page and captions] --> B[Browser status script]
B --> C[Page-owned caption lifecycle]
C --> D[Plain caption fields]
D --> E[Serialized meeting health]
E --> F[Plugin status and audio readiness]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +93. Total +99 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep DOM references inside caption lifecycle state and export only the established caption fields, while preserving separate tracking for the remaining audio-routing failures. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a precise trigger: an active caption row with a circular DOM property reaches JSON.stringify through recentTranscript. The reporter supplies a matching failure trace; this read-only review did not execute code. Is this the best way to solve the issue? Yes, projecting the existing caption fields at the serialization boundary is a narrow repair and matches the sibling transcript export pattern. The generic replacer is unnecessary for that repair, but no reachable correctness defect from it was established. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 022daecee1ab. LabelsLabel changes:
Label 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
|
What Problem This Solves
Closes #140455 (Bug 1 — CRITICAL, clean fix).
Google Meet's DOM attaches a
__soyproperty whose object closes a cycle back to the node. The in-call status script (meetStatusScript) stored the live DOM node in each visible caption row for lifecycle tracking, then passed those rows intoJSON.stringifyviarecentTranscript— throwing:Effect:
page.evaluatereturns HTTP 500; the plugin can never confirm in-call (inCallreportednodespite the agent being a participant), never establishes the audio bridge, and reportsmanualAction: browser-control-unavailable.Root Cause
In
scrapeCaptions(), each visible caption row is pushed as{ ...row, node: region }whereregionis a live DOM element. WhenrecentTranscript = lines.slice(-5)copies these rows (including thenodeproperty) into the serialized payload,JSON.stringifyencounters the__soy→nodecycle and throws.Fix
1. Root cause — strip the live DOM node from
recentTranscriptentries:This keeps only the serializable
{ at, speaker, text }fields and drops thenode,seenAt, etc. Thenodeproperty remains on the internalcaptionState.visiblearray for lifecycle tracking — only the serialized copy is cleaned.2. Defensive — add a circular-safe replacer to
JSON.stringify:This is a belt-and-suspenders guard that handles any future edge case where a DOM node or circular reference might sneak into the serialized payload.
Evidence
Regression test
Added a test in
google-meet-platform-adapter.test.tsthat:__soy = { node: <self> }(circular reference) andnodeType: 1(DOM element)captureCaptions: true) and in-call statemeetStatusScriptin a sandboxed VM contextJSON.parse(result)succeeds,inCallistrue, andrecentTranscriptentries have nonodepropertyBefore the fix (test catches the bug):
After the fix:
All existing tests pass
The existing 5 tests (caption capture, audio routing) continue to pass with no regression.