Skip to content

fix(tlon): await message persistence before acknowledgement - #129090

Merged
steipete merged 2 commits into
mainfrom
codex/land-aug23-tlon-discovery
Aug 25, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/land-aug23-tlon-discovery

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • await Tlon message persistence before acknowledging the SSE event
  • retry failed persistence through the existing monitor loop instead of advancing durable state early
  • preserve channel settings, authentication, discovery, and per-channel cursor behavior

Root cause

The monitor passed a detached callback into the message loop. The loop could durably acknowledge an event before the callback's persistence completed, so a failed write was not retried and later channel state could become stale.

Verification

  • genuine pre-fix reproduction covered the detached callback and retry failure
  • current-main focused HTTP/SSE owner suite: 87/87
  • independent full plugin proof: 283/283
  • format, lint, type, diff, and exact-hash checks passed
  • mandatory isolated review and secret scan completed clean with no actionable findings
  • exact reviewed binary diff: cee0085573cda5b1d3002ce47b29a4f3aee531f19cde0beb7b5e2c37af890718

Production delta: -55. Test delta: +51. Total net: -4. No live Urbit credentials were available; the real loopback HTTP/SSE owner suite is the strongest feasible boundary proof. No API, configuration, schema, migration, or security-contract change.

Changelog: not required for this internal monitor repair.

@clawsweeper

clawsweeper Bot commented Aug 25, 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 channel: tlon Channel integration: tlon size: M maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 07:09
@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 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 3:48 AM ET / 07:48 UTC.

ClawSweeper review

What this changes

The PR makes Tlon group-discovery settings persistence complete before its SSE event is acknowledged, allowing failed writes to be retried.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review. Current main still detaches the groups-ui persistence callback, while this PR returns and awaits it through the existing SSE acknowledgement contract; no patch correctness finding was identified.

Priority: P2
Reviewed head: aff5fe07bb303add58d81d110b7d2afe3daa8e66

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative owner-boundary repair with a credible regression test; only exact-head refresh and CI completion remain.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless describes a loopback HTTP/SSE owner-boundary suite and focused regression coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless describes a loopback HTTP/SSE owner-boundary suite and focused regression coverage.
Evidence reviewed 7 items Current-main gap: Current main still wraps the groups-ui callback in a detached async function, so its persistence result cannot control completion of the subscribed event handler.
Acknowledgement contract: The in-repo SSE client awaits a subscription handler before advancing its acknowledgement watermark; handler rejection therefore prevents acknowledgement.
Proposed repair: The PR’s groups-ui handler is async, awaits the settings poke, updates the local post-write snapshot only on success, and rethrows persistence failures.
Findings None None.
Security None None.

Live Verification

Command: pnpm test extensions/tlon/src/monitor/index.test.ts

Result: FAIL (partial) — step 2 expect_output awaits cumulative Tlon discovery persistence and retries failed writes: expected terminal output was not visible within 30 seconds: "awaits cumulative Tlon discovery persistence and retries failed writes"

pnpm test extensions/tlon/src/monitor/index.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129090-1608ku/target$ pnpm test extensions/tlon/src/monitor/index.test.ts
$ node --import tsx scripts/test-projects.mts extensions/tlon/src/monitor/index.test.ts
pnpm test extensions/tlon/src/monitor/index.test.ts
[test] starting test/vitest/vitest.extension-messaging.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129090-1608ku/target

stderr | extensions/tlon/src/monitor/index.test.ts › monitorTlonProvider inbound media truth › reports 'a failed download beside successful i…' to the model wit
hout changing command text
[tlon-media] Error downloading https://example.com/1.png: download failed

 ✓  extension-messaging  extensions/tlon/src/monitor/index.test.ts (10 tests) 394ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  07:49:08
   Duration  12.91s (transform 9.92s, setup 986ms, import 11.16s, tests 394ms, environment 0ms)

[test] passed 1 Vitest shard in 19.07s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129090-1608ku/target$ pnpm test extensions/tlon/src/monitor/index.test.ts
$ node --import tsx scripts/test-projects.mts extensions/tlon/src/monitor/index.test.ts
[test] starting test/vitest/vitest.extension-messaging.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129090-1608ku/target

stderr | extensions/tlon/src/monitor/index.test.ts › monitorTlonProvider inbound media truth › reports 'a failed download beside successful i…' to the model wit
hout changing command text
[tlon-media] Error downloading https://example.com/1.png: download failed

 ✓  extension-messaging  extensions/tlon/src/monitor/index.test.ts (10 tests) 398ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  07:49:28
   Duration  6.14s (transform 3.26s, setup 447ms, import 5.05s, tests 398ms, environment 0ms)

[test] passed 1 Vitest shard in 12.19s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129090-1608ku/target$












Assertions:

  • FAIL expect_output: awaits cumulative Tlon discovery persistence and retries failed writes

How this fits together

The Tlon plugin consumes group SSE events, discovers chat channels, persists their settings, and then advances the Urbit event acknowledgement watermark. The change ensures persistence failure reaches the monitor transport rather than being detached from it.

flowchart LR
  A[Group SSE event] --> B[Tlon monitor]
  B --> C[Discover chat channels]
  C --> D[Persist channel settings]
  D --> E{Write succeeds?}
  E -->|Yes| F[Acknowledge event]
  E -->|No| G[Reconnect and replay]
  G --> B
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main and exact-head required checks were still running; refresh against current main and require green validation before merge.
  • Complete next step (P2) - The protected maintainer label and MEMBER authorship require normal human review; the remaining action is exact-head refresh and green required CI, not an automated repair.
Agent review details

Security

None.

PR surface

Source -55, Tests +52. Total -3 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 49 104 -55
Tests 1 52 0 +52
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 101 104 -3

Review metrics

Metric Value Why it matters
Production versus test delta production -55, tests +52 The repair removes the detached duplicate discovery paths while adding one focused regression scenario.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land one canonical awaited persistence path after rebasing or refreshing the branch and confirming its exact-head checks; retain the focused failure-and-retry regression coverage.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land one canonical awaited persistence path after rebasing or refreshing the branch and confirming its exact-head checks; retain the focused failure-and-retry regression coverage.

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

Yes—source and the added regression test establish the path: a detached groups-ui callback can finish after the SSE client has acknowledged the event, whereas a rejected awaited callback prevents that acknowledgement.

Is this the best way to solve the issue?

Yes—the patch uses the existing SSE handler-completion contract instead of adding a second retry or acknowledgement mechanism, and it preserves cumulative settings writes while the subscription snapshot lags.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded reliability repair for Tlon channel discovery and durable settings state.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless describes a loopback HTTP/SSE owner-boundary suite and focused regression coverage.

Evidence

What I checked:

Likely related people:

  • steipete: Prior merged Tlon durable-ingress work and the current monitor/SSE history place this contributor at the central owner boundary. (role: durable-ingress feature owner and recent area contributor; confidence: high; commits: 138d2d071c4b, aff5fe07bb30; files: extensions/tlon/src/monitor/index.ts, extensions/tlon/src/urbit/sse-client.ts)
  • NIO: Recent merged Tlon SSE lifecycle work touched the client that enforces handler completion before acknowledgement. (role: recent SSE lifecycle contributor; confidence: medium; commits: df8cc5a45810; files: extensions/tlon/src/urbit/sse-client.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase or refresh against current main and let the required exact-head checks complete green.

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-25T07:16:27.766Z sha 28d3c86 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit cf908f7 into main Aug 25, 2026
101 checks passed
@steipete
steipete deleted the codex/land-aug23-tlon-discovery branch August 25, 2026 09:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
…#129090)

* fix(tlon): await message persistence before acknowledgement

* test(tlon): use promise timer helper in monitor fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: tlon Channel integration: tlon maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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