Skip to content

feat(tlon): add durable ingress - #110910

Merged
steipete merged 1 commit into
mainfrom
claude/ingress-tlon
Jul 18, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/ingress-tlon

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Tlon firehose events could be accepted by the SSE client but lost if the process exited before local dispatch. The deleted in-memory processed-message guard also could not preserve dedupe state across restarts.

Why This Change Was Made

This routes Tlon firehose events through the shared SQLite channel-ingress queue. Each recognized message is durably admitted under a stable logical ID before the SSE handler resolves, then dispatched through a serialized conversation lane. Completed logical-ID tombstones replace the deleted processed-messages guard and preserve its count-based capacity of 2,000.

Tlon SSE redelivers unacknowledged events when reconnecting the same HTTP channel: reconnecting with a new channel ID resets the cursor and abandons that channel's pending events. This implementation therefore reopens the same channel first and acknowledges the SSE cursor only after durable admission. A definitive missing-channel response creates and resubscribes a new channel because Eyre may delete inactive channels.

The durable queue provides crash-window durability between SSE acceptance and local dispatch, plus local restart recovery. It does not preserve the old Eyre cursor after the server-side channel is deleted or replaced.

User Impact

Accepted Tlon messages now survive local process crashes and restarts until dispatch. Duplicate logical messages remain bounded by the existing 2,000-message policy. Failed SSE acknowledgements retry on replay, and reconnects retain the server cursor whenever the channel still exists.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added channel: tlon Channel integration: tlon size: XL maintainer Maintainer-authored PR labels Jul 18, 2026
@steipete
steipete merged commit 138d2d0 into main Jul 18, 2026
128 of 132 checks passed
@steipete
steipete deleted the claude/ingress-tlon branch July 18, 2026 19:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec7a8f15ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +223 to +225
return !running || options.abortSignal?.aborted
? { kind: "failed-retryable", error: new TlonIngressShutdownError() }
: result;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Finalize successful non-turn dispatches before shutdown

When shutdown races immediately after a handler finishes, this converts its successful result into a retry and leaves the claim for restart recovery. Several recognized-message paths perform user-visible side effects without calling lifecycle.onAdopted()—for example, handleChatFirehose persists/resends approval requests and handles owner admin/approval commands (extensions/tlon/src/monitor/index.ts:1003-1018, extensions/tlon/src/monitor/index.ts:1044-1058). A gateway stop after those effects complete but before this check therefore replays the event on restart, potentially resending an approval notification or re-executing a command; those terminal non-turn paths need to finalize their ingress lifecycle once their durable side effect succeeds.

Useful? React with 👍 / 👎.

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 size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant