Skip to content

fix(tlon): await durable invite side effects - #130329

Merged
steipete merged 1 commit into
mainfrom
codex/fix-tlon-foreigns-durable-ack
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-tlon-foreigns-durable-ack

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Tlon foreign-invite events could be acknowledged before group acceptance or approval state was durably written. Callback-side failures could therefore detach, be swallowed, or leave an invite marked processed even though its side effect never completed.

Why This Change Was Made

The monitor now awaits owner and allowlisted group acceptance, direct-message RSVP handling, and approval persistence before acknowledging the event. Approval state is staged and rolled back on save failure; owner notification remains best effort only after the durable write succeeds. Startup and replay behavior are preserved.

User Impact

Tlon invites are no longer silently lost when joining a group or persisting approval state fails; failed work remains retryable instead of being prematurely acknowledged.

Evidence

  • Three genuine ordering/persistence regressions failed before the repair and pass afterward.
  • Focused monitor coverage passes 16/16; full Tlon coverage passes 289/289 tests.
  • Focused formatting, type-aware lint, and diff checks pass.
  • Fresh autoreview and independent review report no actionable findings.
  • Production delta: +69/-88, net -19 lines.

Follow-up

Model approval-response decisions as explicit durable/idempotent phases so response retries can share the same ownership contract.

@clawsweeper

clawsweeper Bot commented Aug 26, 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 labels Aug 26, 2026
@steipete
steipete marked this pull request as ready for review August 26, 2026 19:51
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 26, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 3:58 PM ET / 19:58 UTC.

ClawSweeper review

What this changes

This PR makes Tlon foreign-invite handling await group joins, DM RSVPs, and approval persistence so failed work is retried before the SSE event is acknowledged.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. The patch moves failure propagation to the Tlon monitor callbacks that precede the existing SSE acknowledgement boundary, and the focused regressions cover the prior swallowed-error paths; no blocking code finding was identified. The remaining merge gate is exact-head CI and normal maintainer review.

Priority: P1
Reviewed head: 1d92d9ee7bd3f3456c87a41c9ebeddf2c5f26ab2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative repair with source-backed transport semantics and targeted regression coverage; exact-head CI remains the normal merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable: the repository state identifies this as a member-authored PR; the focused tests remain supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: the repository state identifies this as a member-authored PR; the focused tests remain supplemental evidence.
Evidence reviewed 6 items Changed callback boundary: The foreign-invite subscription awaits processing and rethrows failures, while group joins are awaited before an invite is marked processed.
Approval persistence boundary: Pending-approval writes now rethrow when invoked by invite handling, preventing notification and processed-state advancement after a failed durable write.
Acknowledgement contract: The current local SSE owner awaits subscription callbacks and only then advances acknowledgement; a thrown callback bypasses the acknowledgement call.
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 owner group invite acceptance and retries failed writes: expected terminal output was not visible within 30 seconds: "awaits owner group invite acceptance and retries failed writes"

$ 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.11 /tmp/clawsweeper-live-proof-130329-E00HAC/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 (16 tests) 722ms

 Test Files  1 passed (1)
      Tests  16 passed (16)
   Start at  19:58:59
   Duration  13.72s (transform 10.28s, setup 1.01s, import 11.62s, tests 722ms, environment 0ms)

[test] passed 1 Vitest shard in 20.33s
$ 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.11 /tmp/clawsweeper-live-proof-130329-E00HAC/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 (16 tests) 709ms

 Test Files  1 passed (1)
      Tests  16 passed (16)
   Start at  19:59:20
   Duration  6.46s (transform 3.24s, setup 457ms, import 5.05s, tests 709ms, environment 0ms)

[test] passed 1 Vitest shard in 13.07s

Assertions:

  • FAIL expect_output: awaits owner group invite acceptance and retries failed writes

How this fits together

The Tlon monitor receives group and direct-message invite events, applies invite policy, then joins, RSVPs, or records a pending approval. The local SSE client acknowledges an event only after its callback resolves, so callback failures preserve replayability.

flowchart LR
  A[Tlon SSE invite event] --> B[Tlon monitor]
  B --> C[Invite policy]
  C --> D[Join group, RSVP, or persist approval]
  D --> E{Side effect succeeds?}
  E -->|yes| F[SSE acknowledgement]
  E -->|no| G[Unacknowledged replay]
  G --> B
Loading

Before merge

  • Complete next step (P2) - No mechanical repair remains; this member-owned, maintainer-labeled PR needs normal exact-head CI completion and maintainer landing review.
Agent review details

Security

None.

PR surface

Source -19, Tests +191. Total +172 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 69 88 -19
Tests 1 191 0 +191
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 260 88 +172

Review metrics

Metric Value Why it matters
Production vs test LOC production +69/-88 (net -19); tests +191/-0 The repair is net-negative in production while adding focused ordering and retry coverage for the three affected invite paths.

Merge-risk options

  • The supplied state reports this otherwise clean PR as behind main with exact-head checks still in progress; land only after the reviewed head has current green required checks.

Maintainer options:

  1. Decide the mitigation before merge
    Keep durable invite side effects inside the monitor callback and let the existing SSE client withhold acknowledgement until those effects either succeed or fail.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep durable invite side effects inside the monitor callback and let the existing SSE client withhold acknowledgement until those effects either succeed or fail.

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

Yes—source-reproducible: rejected Tlon poke calls were previously caught or detached before the callback returned, while the added focused cases exercise those exact failure paths.

Is this the best way to solve the issue?

Yes—the monitor callbacks own the durable side effects, while the local SSE client already owns acknowledgement after callback resolution; changing that boundary is narrower and safer than altering transport acknowledgement.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: The repaired failure mode can silently lose or defer Tlon invite acceptance and approval handling for active channel users.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable: the repository state identifies this as a member-authored PR; the focused tests remain supplemental evidence.

Label justifications:

  • P1: The repaired failure mode can silently lose or defer Tlon invite acceptance and approval handling for active channel users.
  • 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: Not applicable: the repository state identifies this as a member-authored PR; the focused tests remain supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the existing foreign-invite path to the recent f498727 work, and the reviewed repair is by the same contributor. (role: recent Tlon area contributor; confidence: high; commits: f498727bbdad, 1d92d9ee7bd3; files: extensions/tlon/src/monitor/index.ts, extensions/tlon/src/monitor/approval-runtime.ts)

Rank-up moves

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

  • Rebase or refresh the branch as needed, then wait for the exact reviewed head's required checks to finish 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.

@steipete
steipete merged commit 94b7d08 into main Aug 26, 2026
168 checks passed
@steipete
steipete deleted the codex/fix-tlon-foreigns-durable-ack branch August 26, 2026 20:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 P1 High-priority user-facing bug, regression, or broken workflow. 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