Skip to content

fix: stabilize live-text subscription fixture - #186330

Merged
shakkernerd merged 1 commit into
mainfrom
live-text-request-frame-fixture-613
Oct 27, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
live-text-request-frame-fixture-613

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: the live-text broadcast fixture can inspect an absent WebSocket frame when it exercises subscription changes through the real asynchronous browser client. The fixture opened the socket without completing the required Gateway challenge/hello handshake, so the client correctly held the subscription request while the fixture immediately tried to read its parameters. That primary failure also left the request pending until teardown, producing a secondary gateway client stopped rejection.

User Impact

User impact: there is no production or user-visible behavior change. The live-text regression suite now exercises the existing browser-client handshake and request-ordering contract deterministically while preserving the two-observer stream, subscribe/unsubscribe behavior, event payloads and counts, close assertion, and real subscriber registry path.

Why This Change Was Made

The fixture now uses the existing browser handshake helper and acknowledges hello before driving subscription requests. For each subscribe or unsubscribe operation, it records the current send boundary and waits for the exact new request frame matching the method, session key, and subscription ID. It then applies that request's parameters to the real server registry, responds to the request's actual ID, and awaits settlement before continuing.

This keeps the repair inside the fixture owner. It does not add timing sleeps, change request or broadcast behavior, weaken assertions, alter timeouts, or introduce a second protocol abstraction.

Evidence

  • The prior scheduled CI failure was TypeError: undefined is not an object (evaluating 'params.key') in the two-observer live-text case, followed by the pending request's gateway client stopped rejection during teardown.
  • Exact-candidate changed-file formatting/lint, the canonical test-line ratchet, and the affected Gateway-server test type graph passed remotely.
  • The formerly failing named case passed 1/1; the complete src/gateway/server-broadcast.live-text.test.ts file passed 18/18.
  • packages/gateway-client/src/protocol-client.handshake-queue.test.ts, which controls held-until-hello request ordering, passed 7/7 on the unchanged protocol owner input and was reused across the final fixture-only correction.
  • The independent calibrated review and separate installed autoreview are clean. Hosted CI remains pending under the explicitly authorized focused-proof route; ClawSweeper acknowledged the exact head but remains unfinished.

@clawsweeper

clawsweeper Bot commented Oct 27, 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 gateway Gateway runtime size: XS labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR completes the live-text fixture’s Gateway handshake and waits for subscription requests to be sent before processing them.

Example: The fixture subscribes observers first and second to agent:main:chat, then unsubscribes first.

  • Before: The fixture reads an absent request frame before hello completes and fails before exercising the shared stream.
  • After: The fixture acknowledges hello, awaits each request’s onSent callback, and verifies that the remaining observer receives AB.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, narrowly scoped fixture correction with no identified defect; validation evidence is reported in-process test execution rather than shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only repair has reported focused and full-file passing results using the real browser client and registry with mocked sockets; no production behavior changes require shipped-entry-point proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: A live-text regression fails during fixture setup before checking whether another observer can safely unsubscribe.
Reason: Restores useful regression coverage under the current protocol contract; maintainer authorship supplies direction for this narrow repair.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is maintainer-authored and repairs a concrete fixture failure without changing production behavior or weakening the existing regression assertions.

Priority: P3
Reviewed head: e53ca1560c9fc49bf27e3c0ba0de02194704ba3f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The fixture connects the real browser client to a mocked WebSocket and feeds subscription parameters into the real subscriber registry, then checks live-text broadcasts and reconstructed browser events.

flowchart LR
  A[Live text fixture] --> B[Browser client]
  B --> C[Protocol handshake and requests]
  C --> D[Mock WebSocket]
  D --> E[Subscriber registry]
  E --> F[Broadcast owner]
  F --> B
Loading

Technical review

Best possible solution:

Retain the fixture-only repair using the existing handshake helper and request owner’s onSent callback.

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

The base fixture opens its socket without challenge or hello, then immediately reads a request that the protocol owner holds until readiness; this explains the reported undefined-params failure without executing target code.

Is this the best way to solve the issue?

The patch repairs the fixture at its owner, reuses established handshake and send-completion contracts, and preserves the original behavioral assertions without new production machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2e628e80c294.

Provenance checked

  • Shared-observer fixture and baseline-reset assertions keeps the original intent (13f4924: Protect remaining observers from append-only updates after another observer retires the browser baseline; later consolidation in test(config,ui,channels): remove low-value tests (batch d282) #177219 retained that contract.)
  • Requests held until hello keeps the original intent (a6c1185: Ensure connect is the first frame and prevent warm-page requests from causing native Gateway rejection.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 13f4924 adds src/gateway/server-broadcast.live-text.test.ts:183 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 13f49243c4cb; files: src/gateway/server-broadcast.live-text.test.ts)

PR surface

Tests 0. Total 0 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 17 17 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 17 17 0

Labels

Label changes:

  • add P3: This is a focused test-fixture repair with no production behavior change.
  • 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.

Label justifications:

  • P3: This is a focused test-fixture repair with no production behavior change.
  • 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 execution lanes are retired.

Reviewed October 27, 2026, 5:46 PM ET / 21:46 UTC.

@shakkernerd
shakkernerd merged commit c8df283 into main Oct 27, 2026
127 of 128 checks passed
@shakkernerd
shakkernerd deleted the live-text-request-frame-fixture-613 branch October 27, 2026 21:53
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: the live-text subscription fixture now completes its browser handshake and settles the exact subscribe or unsubscribe request it observes.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
Stabilizes the live-text subscription fixture by completing its browser handshake and correlating registry updates and responses with each actual request frame.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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