Skip to content

fix(beam): resume sharing when the mirror receiver changes - #133533

Merged
steipete merged 1 commit into
mainfrom
codex/beam-simplify
Aug 30, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/beam-simplify

Conversation

@steipete

@steipete steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where changing Beam's mirror endpoint after a successful upload silently skipped unchanged active sessions at the new receiver. Pending completion updates could also be sent to a receiver that had never accepted the session.

Why This Change Was Made

The mirror now owns one current receiver and resets its acknowledgements, terminal retry tracking, and redirect block together when that endpoint changes. This fixes the destination boundary without adding another delivery path or changing retry scheduling, retention, authorization, or redaction.

The review also removes redundant traversal of already-typed runtime configuration, simplifies HTTP acknowledgement handling, and removes an unreachable fallback in catalog share routing. The mirror's shutdown, bounded retry, and transcript-cursor safeguards remain intact. Production LOC: +19/-26 (net -7); tests and test support: +24/-3 (net +21). No new dependencies, configuration options, or storage changes.

User Impact

Unchanged active sessions publish once to a newly configured receiver, including when returning to a previous endpoint. Old terminal work is discarded on an endpoint change; rows at the previous receiver retain their normal expiry. Named, bare-id, and stale-title share links keep their current behavior. The Beam guide documents the receiver-switch behavior.

AI-assisted implementation; I reviewed the owning runtime, receiver, catalog, client, existing regressions, and the final diff.

Evidence

  • Extended the existing real loopback redirect/restart regression. Before the fix, it independently reproduced both suppressed delivery after a successful endpoint switch and an old completion upload reaching the new receiver; it passes after the repair.
  • 70 focused tests passed across the Beam receiver, mirror, terminal retry policy, and catalog share routes. Coverage includes redaction, stop/abort cleanup, retry fairness/expiry/capacity, upload attribution, paging, and ambiguous/missing share links.
  • Separate synthetic proof: the real Beam mirror uploaded through two loopback Beam HTTP handlers, retried a rejected completion, changed receivers, read the received transcript through the catalog, completed it, and switched back. The first receiver saw live/rejected-completed/live; the second saw live/completed. No old terminal retry crossed receivers, and unchanged content was deduplicated within each receiver.
  • The loopback proof uses a synthetic catalog, injected operator.write scope, and in-memory stores; it does not claim production authentication, persistent-store migration, or a Team deployment.
  • Control UI build and unchanged startup budgets passed. Codex autoreview found no actionable P0–P2 findings. All changed-scope checks passed on the final rebased head. Exact-head CI run 33335013189 passed; all PR checks are complete with no failures.
  • Provenance: reproduced on current main; the introducing commit was not established. Credential-owner work in fix(beam): isolate missing mirror credentials #128336 is separate and remains untouched.

@steipete steipete self-assigned this Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui plugin: beam Beam session sharing plugin size: S maintainer Maintainer-authored PR labels Aug 30, 2026
@steipete
steipete marked this pull request as ready for review August 30, 2026 20:56
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:16 PM ET / 21:16 UTC.

ClawSweeper review

What this changes

The PR makes Beam resend unchanged active sessions after a mirror receiver URL changes, discards old-receiver terminal retries, documents that behavior, and simplifies an equivalent Control UI missing-session branch.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for normal maintainer review: current main still retains delivery state across receiver URLs, while this maintainer-associated PR resets that state at the receiver boundary and has no identified correctness blocker.

Priority: P2
Reviewed head: 913de10fdd2545e5a146b248c8b3698efa0b133d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with source-backed transition coverage and no identified correctness or security defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-associated PR is not subject to the external-contributor proof gate; its supplied exact-head loopback evidence nevertheless maps the real mirror runner through HTTP receiver handlers across the changed receiver-switch scenario.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-associated PR is not subject to the external-contributor proof gate; its supplied exact-head loopback evidence nevertheless maps the real mirror runner through HTTP receiver handlers across the changed receiver-switch scenario.
Evidence reviewed 6 items Introduced receiver boundary repair: The introduced transition detects a changed endpoint, clears tracked acknowledgements and terminal retries, and unblocks redirect state before any upload; uploads then consume that one receiver value.
Current-main behavior still needs the fix: Current main keeps only a redirect-blocked endpoint and retains tracked session fingerprints across configuration changes; the active-upload loop therefore still deduplicates unchanged content after a receiver switch.
Boundary regression coverage: The extended loopback-server test switches receivers with an inactive session to detect an incorrectly transferred terminal update, then restores the session and switches back to verify fresh delivery per receiver.
Findings None None.
Security None None.

How this fits together

Beam is an opt-in plugin that mirrors selected local session catalogs to a remote Beam receiver. Its polling runner reads the configured receiver, deduplicates active uploads, sends final completion updates, and the Control UI separately resolves shared catalog links.

flowchart LR
  Config[Mirror configuration] --> Runner[Beam mirror runner]
  Catalogs[Selected session catalogs] --> Runner
  Runner --> Changed{Receiver changed?}
  Changed -->|Yes| Reset[Clear receiver delivery state]
  Changed -->|No| Upload[Deduplicate and upload]
  Reset --> Upload
  Upload --> Receiver[Remote Beam receiver]
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed: this active maintainer-associated PR has no identified mechanical blocker and should proceed through normal exact-head validation.
Agent review details

Security

None.

PR surface

Source -7, Tests +21, Docs 0. Total +14 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 20 27 -7
Tests 1 23 2 +21
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 44 30 +14

Review metrics

Metric Value Why it matters
Production versus test LOC runtime/UI +19/-26 (net -7); tests/support +24/-3 (net +21); docs +1/-1 The receiver-boundary repair reduces production code while adding focused transition coverage and matching documentation.

Technical review

Best possible solution:

Land the receiver-scoped state reset so each newly configured destination receives its own active-session snapshot and cannot receive completion retries belonging to a prior destination.

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

Yes, from source: on current main a successful active upload remains fingerprint-tracked after the endpoint changes, so unchanged content is suppressed at the new receiver; the focused loopback regression exercises that transition.

Is this the best way to solve the issue?

Yes. Treating acknowledgements, terminal retries, and redirect suppression as receiver-scoped state fixes the owner-boundary violation without adding configuration, persistence, or a parallel delivery path.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The PR repairs an opt-in Beam mirror delivery defect with a bounded user impact and no evidence of a broader outage.
  • 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: This maintainer-associated PR is not subject to the external-contributor proof gate; its supplied exact-head loopback evidence nevertheless maps the real mirror runner through HTTP receiver handlers across the changed receiver-switch scenario.

Evidence

What I checked:

  • Introduced receiver boundary repair: The introduced transition detects a changed endpoint, clears tracked acknowledgements and terminal retries, and unblocks redirect state before any upload; uploads then consume that one receiver value. (extensions/beam/src/mirror.ts:389, 913de10fdd25)
  • Current-main behavior still needs the fix: Current main keeps only a redirect-blocked endpoint and retains tracked session fingerprints across configuration changes; the active-upload loop therefore still deduplicates unchanged content after a receiver switch. (extensions/beam/src/mirror.ts:238, 343fe90926c0)
  • Boundary regression coverage: The extended loopback-server test switches receivers with an inactive session to detect an incorrectly transferred terminal update, then restores the session and switches back to verify fresh delivery per receiver. (extensions/beam/src/mirror.test.ts:337, 913de10fdd25)
  • Runtime entry point and caller: The Beam plugin registers the mirror as a service; the service constructs the runner from the plugin runtime and begins polling, so the changed runner owns the production delivery transition. (extensions/beam/index.ts:23, 913de10fdd25)
  • Documentation matches the implementation: The Beam guide now states that a receiver change starts fresh active-session delivery and discards prior receiver terminal retries, matching the new runner state transition. Public docs: docs/plugins/beam.md. (docs/plugins/beam.md:156, 913de10fdd25)
  • Introduced-commit provenance: The reviewed head has the pinned base as its raw recorded parent, establishing that the receiver-state hunks are introduced by this PR rather than base drift. (extensions/beam/src/mirror.ts:389, 913de10fdd25)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-08-30T21:02:23.508Z sha 913de10 :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Landing proof for head 913de10fdd2545e5a146b248c8b3698efa0b133d:

The mirror now owns one receiver transition: acknowledgements, terminal retry tracking, and redirect blocking reset together. The old duplicate destination argument and redundant validation/result branches are removed; catalog routing also drops its unreachable fallback. Production is net -7 LOC (+19/-26); tests/support are net +21. No configuration, persistence, retention, or authorization changes were introduced.

Validation:

  • pnpm test:serial extensions/beam/src/beam.test.ts extensions/beam/src/mirror.test.ts extensions/beam/src/mirror-retry.test.ts ui/src/pages/chat/route-loader-catalog-share.test.ts — 70 passed.
  • The receiver-switch loopback regression failed on main before the fix for both suppressed delivery and misdirected terminal work, then passed after the repair.
  • A separate final-head synthetic runner -> two real loopback Beam HTTP handlers -> catalog proof passed. It exercised live acknowledgement, rejected completion, receiver switch, no transfer of old terminal retries, unchanged active delivery, completion, and return to the previous receiver. Catalog, authorization scope, and stores were synthetic; no production auth or deployment is claimed.
  • pnpm ui:build — passed, including unchanged startup budgets.
  • env -u OPENCLAW_TESTBOX pnpm check:changed --base HEAD^ -- docs/plugins/beam.md extensions/beam/src/beam.test-support.ts extensions/beam/src/mirror.test.ts extensions/beam/src/mirror.ts ui/src/pages/chat/route-loader-catalog-share.ts — all checks passed. An initial Testbox attempt failed before dispatch because the task's temporary clone used a local origin path; the supported local run then completed with pinned dependencies.
  • Codex autoreview: scoped-clean at P0–P2; native review artifacts validated.

Exact-head CI run 33335013189 passed. The final check rollup has no failed or pending checks. Latest ClawSweeper comment is still a review-in-progress placeholder with no published findings or rank-up moves; the independent Codex review is clean. Proceeding through native prepare/merge.

@steipete
steipete merged commit f132f40 into main Aug 30, 2026
256 checks passed
@steipete
steipete deleted the codex/beam-simplify branch August 30, 2026 21:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 30, 2026
* origin/main: (55 commits)
  test: include v2026.8.1 release navigation (#133581)
  fix: stop cloud work before unrelated provider inspection finishes (#133476)
  fix(e2e): keep delete fixture target-compatible (#133526)
  fix(release): detect optional target E2E capability (#133525)
  fix(package): publish readable dist inventory (#133549)
  docs: add complete v2026.8.1 maintainer change index (#133585)
  fix(browser): preserve contextless worker and iframe sessions (#133571)
  fix(voice): discover configured provider candidates (#133507)
  refactor(ui): simplify chat rendering and lifecycle state (#133567)
  test: reduce maturity fixture cleanup time (#133566)
  improve: speed up legacy imports and transcript replacement (#133546)
  docs: add draft v2026.8.1 release notes (#133557)
  test: guard multi-project Vitest cache ownership (#133554)
  fix(memory): clarify default agent scope in command help (#133560)
  fix(clawdock): keep credentials out of diagnostic output (#133547)
  refactor(ui): avoid redundant presence work in avatar lists (#133548)
  fix(agents): recognize internal requester completion replies (#133543)
  fix: prevent duplicate queued user messages in chat clients (#133542)
  chore(ui): refresh control ui locales (#133544)
  fix(beam): restart delivery when the receiver changes (#133533)
  ...
vincentkoc added a commit to shojikumaru/openclaw that referenced this pull request Aug 30, 2026
…cked-delivery

* origin/main: (261 commits)
  fix(clawdock): keep credentials out of diagnostic output (openclaw#133547)
  refactor(ui): avoid redundant presence work in avatar lists (openclaw#133548)
  fix(agents): recognize internal requester completion replies (openclaw#133543)
  fix: prevent duplicate queued user messages in chat clients (openclaw#133542)
  chore(ui): refresh control ui locales (openclaw#133544)
  fix(beam): restart delivery when the receiver changes (openclaw#133533)
  fix(models): recover /models browse from a replaced prepared catalog (openclaw#133221)
  perf(terminal): reuse control scans and remove repeated sanitization work (openclaw#133527)
  perf(agents): prepare only consumed tool and skill diagnostics (openclaw#133512)
  fix(line): offer the card command only on LINE (openclaw#132895)
  fix: keep Android publication independent of core release (openclaw#133471)
  refactor(agents): simplify compaction accounting (openclaw#133521)
  refactor(plugins): simplify registration lifecycle policy (openclaw#133364)
  perf(plugins): avoid eager loader imports for active registry reads (openclaw#133518)
  refactor(ui): consolidate chat rendering ownership (openclaw#133508)
  test(auto-reply): prepare memory flush model capabilities (openclaw#133532)
  fix(ui): replace startup hourglasses with capacity-aware rings (openclaw#133470)
  fix(talk): preserve provider conversation order in browser transcripts (openclaw#133493)
  fix(ui): deduplicate participant and viewer avatars (openclaw#133519)
  feat(ui): add CRT terminal theme (openclaw#133495)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. plugin: beam Beam session sharing plugin rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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