Skip to content

fix(test): restore shared-observer unsubscribe coverage - #186308

Closed
roboclaw-bot wants to merge 2 commits into
mainfrom
openclaw/shared-observer-fixture-184502
Closed

roboclaw-bot wants to merge 2 commits into
mainfrom
openclaw/shared-observer-fixture-184502

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #184502

What Problem This Solves

The shared-observer regression's subscription acknowledgements omit the canonical session key, so they do not exercise the browser's acknowledged-baseline retirement contract.

User Impact

No user-visible behavior changes. This restores the real acknowledgement shape in an existing browser/protocol/registry/broadcaster regression without removing test cases or weakening delivery assertions. The separate inherited-main repair was requested by @jalehman; it does not modify the guest-access stack.

Why This Change Was Made

Main's #186330 now owns the handshake and actual request-dispatch receipt. This candidate reuses that owner, removes the redundant added challenge/hello block, and retains only the acknowledgement payload correction. The net test-code change is +5 lines versus current main; all existing cases and delivery assertions remain.

The test-line ceiling is 6,290,703, exactly the measured test corpus in both the published head and GitHub's verified merge candidate: zero slack, no deleted tests and no allowance beyond that tree. It accounts for existing main growth plus this five-line fixture correction.

Evidence

Earlier revisions encountered a baseline-only merge conflict and then a head-versus-merge-candidate count mismatch while main advanced. All 18 fixture tests passed. This revision binds the counter to the verified actual candidate tree; the ACK-only patch is unchanged and no forced merge or prior-head CI waiver is used.

Current head: 199af38, based on main 0153f5f. GitHub's merge candidate d017801f8ba407fc6339939bff6affe8df142b9f was fetched through the live Git ref and its two parents verified. Its tree and the head tree are identical: e787d219446d370f07498e897d8d35595ecca8af. The canonical ratchet reports 6,290,703 / 6,290,703, slack 0, on that source tree. This verifies the actual candidate rather than relying on a stale merge preview or a head-only count against a different base.

  • The original startup failure was independently reproduced and matched scheduled main. That startup defect is now fixed by fix: stabilize live-text subscription fixture #186330; this PR preserves the distinct canonical acknowledgement correction.
  • Reduced fixture: 18/18 tests pass, 34.17s Vitest / 36.68s wrapper; typed lint, format and diff checks pass. The final mechanical base update leaves the inspected browser client, protocol client, broadcaster, subscriber registry, handshake helper and dependency pins unchanged. The canonical ratchet on the verified merge candidate, with the corrected counter, reports 6,290,703 / 6,290,703, slack 0.
  • ClawSweeper's duplicate-handshake finding is addressed: there is only main's startConnect/hello setup. Its merge-tree finding is addressed by measuring GitHub’s candidate, not the head-only checkout.
  • Fresh local autoreview (Codex GPT-6.1 Sol, P0–P2) reported one static concern that canonical unsubscribe ACKs would leave the next shared-stream delta without a browser baseline. Rejected with owner evidence: server-chat-state.ts notifies change listeners even when another observer remains; server-broadcast-live-text.ts clears that connection's matching receipt on the notification, forcing the next full snapshot. The composed regression passes with realistic ACKs. No production workaround was added and no cleaner review was requested to hide the finding.
  • Prior exact-head CI caught five inherited curly-lint errors in two UI test files. Main's existing 8b2b0997a5780c0 repair was integrated; those formerly failing lint inputs now pass. The subsequent seven-line merge-ref count mismatch is documented in run 40593073928. No CI rerun/dispatch or empty green-only push was made.
  • Proof is the existing production browser/protocol/registry/broadcaster composition with mocked WebSocket I/O, not live Gateway authentication. No build is needed for the test-only patch. Fresh exact-head ci-gate success, clean ClawSweeper with no before-merge items, and CLEAN merge state remain required.

Landing blocked by renewed counter conflict

After the tree-identical candidate above was verified, main changed the shared counter again. A fresh Git merge-tree inspection against observed main 4b27ee8 reports a conflict only in config/test-lines-baseline.txt (main 6,289,827; this head 6,290,703). The ACK-only source patch is unchanged. Current-head CI was still pending at the last gate read; the required CLEAN merge state is not established. No merge was attempted.

The rebase loop is stopped rather than adding future allowance or waiving exact-head CI/review. A stable test-corpus/counter landing window is needed to reconcile this shared-file contention and finish the required gates.

Contributor credit: @jalehman and @vincentkoc.

Work sessions

Worked on by

@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
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 27, 2026 20:56
@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. 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. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR restores canonical subscription acknowledgement payloads in the shared-observer test and adjusts the test-line ceiling.

Example: Two observers subscribe to agent:main:chat, then the first unsubscribes before text advances from A to AB.

  • Before: The fixture omits the acknowledgement key, bypassing browser baseline retirement.
  • After: The acknowledgement identifies agent:main:chat, exercising baseline retirement and full-snapshot recovery for the remaining observer.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A minimal, source-verified coverage repair supported by reported in-process validation; the conflict and pending CI remain landing gates without lowering the patch rating.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only PR reports 18 passing fixture tests using production browser/protocol/registry/broadcaster code with mocked WebSocket I/O; no live Gateway behavior change is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The shared-observer regression can miss failures in recovery after an acknowledged unsubscribe.
Reason: Restoring the original payload protects an established browser/server lifecycle contract without adding runtime machinery; maintainer-authored direction is already established.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR restores useful regression coverage with no introduced code defects found; GitHub reports a merge conflict and the exact-head CI gate remains pending.

Priority: P3
Reviewed head: 199af38ddcd7cf257507f4a6315e1d3e208a3e8d

Before merge

  • Complete next step - The PR author should resolve GitHub's reported conflict, preserve the acknowledgement correction, and set the ceiling to the resolved candidate's measured test total.

Findings

None.

Agent review details

How this fits together

The regression connects the production browser client, subscriber registry, and broadcaster through mocked WebSocket I/O to verify subscription changes and reconstructed chat delivery.

flowchart LR
  A[Observer requests] --> B[Browser protocol client]
  B --> C[Fixture WebSocket]
  C --> D[Subscriber registry]
  D --> E[Broadcaster receipts]
  E --> F[Browser chat projection]
Loading

Technical review

Best possible solution:

Preserve the acknowledgement-only correction and reconcile the shared ceiling to the resolved candidate's measured test corpus.

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

Source inspection establishes that the existing fixture omits the response key consumed by browser baseline retirement; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch is the smallest complete fixture repair: restore the original acknowledgement shape, reuse existing owners, and retain all delivery assertions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared-observer acknowledgement fixture changes intended behavior with a stated reason (9f7a75d: Test consolidation removed the payload while intending to preserve distinct lifecycle coverage; the original regression included it.)
  • Test-line ceiling changes intended behavior with a stated reason (25da76e: The prior ceiling accompanied main's security-preset feature; this PR documents an exact corpus measurement and independently has zero head slack.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9f7a75d adds src/gateway/server-broadcast.live-text.test.ts:88 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9f7a75d39082; files: src/gateway/server-broadcast.live-text.test.ts)
  • Shakker: Raw commit c8df283 adds src/gateway/server-broadcast.live-text.test.ts:86 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c8df28341066; files: src/gateway/server-broadcast.live-text.test.ts)

PR surface

Tests +5, Other 0. Total +5 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 6 1 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 2 7 2 +5

Labels

Label changes:

No label changes.

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: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-27T21:13:14.783Z sha feb671f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-27T21:47:30.034Z sha 1e8d8c70ea3ec66aa5528fd48954f88d029714c8 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-27T22:17:05.608Z sha 55b4b61af197d4433f5fee10886a875bf1b646d1 :: needs changes before merge. :: [P2] Measure the ceiling against the candidate merge tree | [P3] Remove the duplicate handshake setup
  • reviewed 2026-10-27T22:41:26.047Z sha df770c2efc0669723797ef2db21ebf30f040d36b :: needs maintainer review before merge. :: none
  • reviewed 2026-10-27T22:58:30.956Z sha 590e94b5b5a9f433149e62c41b900c2468dd919f :: needs changes before merge. :: [P2] [P2] Measure the ceiling against the candidate merge tree
  • reviewed 2026-10-27T23:18:34.203Z sha f95ed57a4d31961324fce72b5920ed48c411a0c5 :: needs changes before merge. :: [P2] [P2] Match the ceiling to the current candidate merge tree
  • reviewed 2026-10-27T23:41:51.601Z sha 199af38 :: needs changes before merge. :: none

Reviewed October 27, 2026, 7:46 PM ET / 23:46 UTC (Revision 8).

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 27, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/shared-observer-fixture-184502 branch from 1e8d8c7 to 55b4b61 Compare October 27, 2026 22:12
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/shared-observer-fixture-184502 branch from 590e94b to f95ed57 Compare October 27, 2026 23:11
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
roboclaw-bot and others added 2 commits October 27, 2026 23:33
Complete the browser handshake before sending subscription requests and return the real acknowledgement payload so unsubscribe retires the client baseline. Keep every behavioral assertion and set the test-line ceiling to the exact tracked total.

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
Worked on by:
- @vincentkoc
- @jalehman

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: b6df24b8-0517-4c6e-afe8-3e085c3c5b2c
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/shared-observer-fixture-184502 branch from f95ed57 to 199af38 Compare October 27, 2026 23:33
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 27, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Superseded by main commit c8df283 (#186330), which fixes the original handshake/request-frame failure. Latest scheduled main confirms the exact shared-observer case passes (69 ms) and all 18 tests in the file pass: https://github.com/openclaw/openclaw/actions/runs/40602073741/job/122532645760 . The remaining ACK-only coverage adjustment is not needed to unblock #184502; closing as instructed, without merging or deleting the branch.

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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant