Skip to content

fix(connectors): a restart-resumed turn's answer reaches its Slack thread - #46048

Closed
AmethystLiang wants to merge 2 commits into
mainfrom
AmethystLiang/bunyip
Closed

AmethystLiang wants to merge 2 commits into
mainfrom
AmethystLiang/bunyip

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When Orca restarts while a bot is answering a Slack message, Orca resumes the work afterwards, but the bot's final answer never reached Slack. Now the resumed work's answer is posted to the thread that asked, once. An answer that is too old to be useful is closed quietly instead.

Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​943 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​940
Prod 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1235 $\color{#cf222e}{\Huge{\mathbf{−}}}$​159 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1076

What Changed

  • A cut turn counts as finished. A restart saves the cut turn as interrupted with no outcome. Reply recovery only read the outcome field, so it treated that turn as still running and left its Slack request open forever. It now reads the derived verdict.
  • The continuation names what it resumes. Orca's restart continuation now carries a host-only restartOf: the turn, the cut turn's row, or the send it resumes. The provider never sees it, and a client's send can't carry it because SendBody is strict. Recovery verifies the binding and fills the original request with the continuation's answer, in its own thread. The checks: same session and epoch, exactly one match, an interruption, no other root turn in between, and at most 4 hops. Anything else binds nothing.
  • A cut request waits for its continuation. It waits while a restart offer for that work stands (pending, in progress, or failed and open to a retry) or while a verified continuation exists. Offers are read before the journal, because a continuation is journaled before its offer settles. A hold is capped at 24 h from the cut; another turn starting doesn't end it.
  • Stale answers aren't posted. A recovered fill posts only if its answer ended within 1 h and its request is under 24 h old. Otherwise the request is closed quietly (quiet, no post), with a local expired_reason column, a warn line and a counter. The limits are named constants in connector-reply-policy.ts. They are deliberately conservative and easy to tune.
  • A mirrored continuation isn't posted twice. If the chat's Slack mirror already posts the continuation turn, its inherited request closes quietly, so the thread gets one answer.

Why

A restart left the reply outbox row open forever and the continuation's answer unattached. Fixing both in recovery keeps the live turn-end path unchanged. Checked against how comparable products handle this.

Visual Proof

N/A: no UI. The change is which answer the reply outbox sends to Slack after a restart, and the tests below cover it.

Testing

  • 21 new tests fail on origin/main and pass here. They cover:
    • the binding matrix (turn, cut-turn row, send, a send that became a turn, no match or two matches, a non-interrupted turn, a root in between, a 4-hop chain, a 5th hop, a client send);
    • holds against the real recovery capsule (pending, in progress, failed then rollback, dismiss, superseded, a reclaimed lease, an offer read racing the journal, subscribing before the first read);
    • durable freshness across reboots;
    • the five request shapes stuck on a real machine, which all close quietly;
    • the mirror and the outbox in both orders, with exactly one post;
    • the upgrade of an older reply table.
  • pnpm tc and oxlint, oxfmt and ast-grep on the changed files pass. The related suites pass, except three files that fail identically on origin/main on this host.
  • Tested on macOS.

Performance

No new polling and no extra reads on the live turn end. Recovery adds one offers-file read per settle of a chat with unfilled rows, plus lookups inside the window it already reads, and one timer per held chat at its durable deadline.

Review

AI-assisted change (Claude). Cross-platform: no platform-specific code; paths come from the existing capsule. SSH/remote: unchanged; recovery runs where the journal lives. Agents and integrations: the provider payload and send fingerprints exclude restartOf, and only the Slack reply outbox changes. Mobile and older builds: columns are added by ALTER, with no user_version change; older builds ignore them and the new body field. Security: no new input surface. Client sends still go through the strict SendBody.

Risk

Level: Medium.

  • A cut request now waits up to 24 h if a restart offer for its work stays open and nothing else happens, then closes quietly.
  • A request closed quietly shows as done in Slack, with no post. A dedicated cloud expired outcome is a follow-up.
  • Not fixed here: a turn end whose live journal read fails can still post an answer through both the turn end and the outbox. That is follow-up item 969.
  • A plain revert restores the previous behaviour. The two added nullable columns stay and are unused.

…read

When Orca restarts mid-turn, the turn is saved as interrupted with no
outcome, and Orca sends a restart continuation to finish it. Reply
recovery read only the raw outcome, so it treated the cut turn as still
running and kept its Slack request open forever; the continuation carried
no binding to that request, so its final answer was never attached.

- Recovery reads the derived verdict: a cut turn is finished (interrupted).
- A restart continuation names what it resumes (restartOf: a turn, a cut
  turn's row, or a send). Recovery verifies it in the same session and
  epoch (one match, an interruption, nothing in between, at most four
  hops) and fills the original request with the continuation's answer.
- A cut request waits while a restart offer for its work stands (pending,
  in an action, or failed and open to a retry) or a verified continuation
  exists, capped at 24 h from the cut. Offers are read before the journal.
- A recovered fill posts only if its answer ended within 1 h and its
  request is under 24 h old; otherwise it closes quietly (no post) with a
  local expired_reason, a warn line and a counter.
- A continuation the chat's Slack mirror already posts closes its
  inherited request quietly, so the thread gets one answer.
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The change adds restart-continuation references to journal messages and reads standing recovery offers from recovery capsules. Connector reply recovery now binds continuations to earlier work, holds interrupted replies while continuation conditions apply, and settles rows using journal evidence and expiry rules. Reply admission times and quiet-expiry reasons are persisted. Tests cover restart binding, offer timing, expiry, and Slack mirror posting.

Merge Risk: Moderate · up to b38b8

A restart-resumed turn that has no connector rows can lose its answer event. A recovery pass that is still running when the service shuts down can recreate watches and timers afterward. An offer published during a row read can still be missed, which would close the original request as interrupted before the continuation can answer it. These affect the Slack delivery path this change is meant to fix, so they should be addressed before merge.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description follows the repository template. It has ELI5, What Changed, Why, Visual Proof (N/A with reason), Testing, Risk with level, Review, and Performance sections. The Linked Issue section is… Add the linked issue number in the 'Fixes #' line, or confirm that a maintainer has no pre-existing issue to attach. Expand the Why section to explain the alternatives considered. Tick the Testing and Checklist items that the author has com…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: a restart-resumed turn's answer is delivered to its Slack thread. The changeset adds restart-continuation binding (restartOf), reply-recovery holds, and delivery of th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a restart-resumed turn's answer is delivered to its Slack thread. The changeset adds restart-continuation binding (restartOf), reply-recovery holds, and delivery of the resumed answer to the original Slack request. The title is concise and specific, and it follows the conventional commit style used in the repository.

Full details: Description check

Explanation

The description follows the repository template. It has ELI5, What Changed, Why, Visual Proof (N/A with reason), Testing, Risk with level, Review, and Performance sections. The Linked Issue section is empty: it has 'Fixes #' with no issue number, and the template requires a linked issue for outside contributors. The AI Disclosure section is filled in with the model name. The Agent skill upstream boundary checkbox is unchecked and the Checklist is not ticked. The Testing checkboxes are also not ticked. The Why section gives only a brief rationale and does not compare the alternatives considered. The description also contains an auto-generated LoC block that must stay as-is.

Resolution

Add the linked issue number in the 'Fixes #' line, or confirm that a maintainer has no pre-existing issue to attach. Expand the Why section to explain the alternatives considered. Tick the Testing and Checklist items that the author has completed, and state in the Agent skill upstream boundary section whether the change copies any upstream skill-installer source. Keep the generated LoC block unchanged.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ceb9295-d42b-46f4-be80-a0c38c02add1
Commits

Reviewing files that changed from the base of the PR and between 83a0a1c and 552ac80.

Files selected for processing: 28

  • src/main/external-conversations/connector-reply-policy.ts
  • src/main/external-conversations/external-conversation-reply-evidence.ts
  • src/main/external-conversations/external-conversation-reply-expiry.ts
  • src/main/external-conversations/external-conversation-reply-fill.ts
  • src/main/external-conversations/external-conversation-reply-recovery-capsule.test.ts
  • src/main/external-conversations/external-conversation-reply-recovery-deps.test.ts
  • src/main/external-conversations/external-conversation-reply-recovery-deps.ts
  • src/main/external-conversations/external-conversation-reply-recovery-restart.test-fixture.ts
  • src/main/external-conversations/external-conversation-reply-recovery-restart.test.ts
  • src/main/external-conversations/external-conversation-reply-recovery.test.ts
  • src/main/external-conversations/external-conversation-reply-recovery.ts
  • src/main/external-conversations/external-conversation-reply-settle-pass.ts
  • src/main/external-conversations/external-conversation-restart-binding.test.ts
  • src/main/external-conversations/external-conversation-restart-binding.ts
  • src/main/external-conversations/external-conversations-install.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies-schema.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies.test.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies.ts
  • src/main/native-chat/agent-session-journal/durable-rows/journal-storage-schema.ts
  • src/main/native-chat/agent-session-wire/recovery/structured-agent-session-interrupted-continuation.ts
  • src/main/native-chat/agent-session-wire/recovery/structured-agent-session-restart-continuation-envelope.test.ts
  • src/main/native-chat/agent-session-wire/recovery/structured-agent-session-restart-continuation-envelope.ts
  • src/main/native-chat/agent-session-wire/recovery/structured-agent-session-restart-continuation.ts
  • src/main/runtime/agent-session/records/agent-session-recovery-capsule-file.ts
  • src/main/runtime/agent-session/records/agent-session-recovery-capsule.ts
  • src/shared/agent-session/journal/agent-journal-bot-message-fields.ts
  • src/shared/agent-session/journal/journal-connector-reply.ts
  • src/shared/agent-session/requests/structured-agent-session-send-mutation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

…swer reaches the thread

Follow-up to the review of the restart reply recovery (C1, CodeRabbit).

- The continuation's envelope fingerprint is computed over the fields the
  host's send plan hashes, which leave out restartOf. It hashed the whole
  body before, so the host refused every continuation that named its work.
- A read the restart binding needs that fails is now unknown, not
  "binds nothing": the pass decides nothing by absence, holds what may be
  resumed and settles the chat again in 30 s, so one failed alias read no
  longer closes the request as unattributed or interrupted.
- A continuation the agent rejected binds nothing, and a failed restart
  action no longer holds, so the cut request is told how it ended instead
  of waiting a day and closing quietly.
- The request is answered with the whole reply: the prose the restart cut
  partway through, then the continuation's. A heard continuation's own
  turn end tells only the turn's state (unless the Slack mirror holds it),
  so the thread gets that answer once.
- A restart chain past its fourth hop binds nothing at all, so the
  original request releases at once instead of holding 24 h.
- A pass that saw the restart offers change after it read them (a crash
  cut's offer is recorded at startup) fills no cut; the next pass decides.
- A failed settle, including one at a hold's deadline, is retried in 30 s.
- Only person messages typed before the continuation's turn ended count
  as ones the Slack mirror posts with that turn.
- The capsule tests wait for the fill they assert, not a fixed number of
  pauses.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ec59b253-86f1-47e1-97ae-4b97537acedd
Commits

Reviewing files that changed from the base of the PR and between 552ac80 and b38b894.

Files selected for processing: 17

  • src/main/external-conversations/connector-reply-policy.ts
  • src/main/external-conversations/external-conversation-chat-turns.ts
  • src/main/external-conversations/external-conversation-reply-evidence.ts
  • src/main/external-conversations/external-conversation-reply-recovery-capsule.test.ts
  • src/main/external-conversations/external-conversation-reply-recovery-restart.test-fixture.ts
  • src/main/external-conversations/external-conversation-reply-recovery-restart.test.ts
  • src/main/external-conversations/external-conversation-reply-recovery.ts
  • src/main/external-conversations/external-conversation-reply-settle-pass.ts
  • src/main/external-conversations/external-conversation-reply-settle-timers.ts
  • src/main/external-conversations/external-conversation-restart-binding.test.ts
  • src/main/external-conversations/external-conversation-restart-binding.ts
  • src/main/external-conversations/external-conversation-turn-ends.test.ts
  • src/main/external-conversations/external-conversation-turn-ends.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies.test.ts
  • src/main/native-chat/agent-session-wire/recovery/structured-agent-session-restart-continuation-envelope.test.ts
  • src/main/native-chat/agent-session-wire/recovery/structured-agent-session-restart-continuation-envelope.ts
  • src/main/runtime/agent-session/records/agent-session-recovery-capsule-file.ts
Files skipped from review as they are similar to previous changes: 1

  • src/main/external-conversations/connector-reply-policy.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

// A hold's own deadline, or sooner when the offers couldn't be read.
const retryAt = offers === null || pass.unknown ? pass.now + RETRY_MS : null
const at = [pass.holdUntil, retryAt].filter((time): time is number => time !== null)
this.timers.deadline(sessionId, at.length > 0 ? Math.min(...at) : null)

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.

Major · Stability & Availability · Quick win

Prevent a successful pass from restoring work after disposal.

If dispose() runs while operationWindow is pending, a successful completion can still reach this block. It restores the journal watch and schedules another hold deadline. The captured generation protects only the error handler.

Pass the generation into settleOnce and reject stale completions before they restore watches or timers. Keep scheduling enabled for passes from the current generation.

Based on learnings, cancelling timers does not stop in-flight work from restoring obsolete scheduled work.

Source: Learnings

!verdict ||
// What it resumed couldn't be read: owed until it can.
binding === BINDING_UNKNOWN ||
(verdict === 'interruption' && pass.turnHeld(turn, opener))

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.

Major · Data Integrity & Integration · Quick win

Recheck the hold after the awaited row read.

If no offer exists, turnHeld returns false. The following journal.read can then wait while an eligible offer is published. That publication increments offerChanges, but this pass does not check it again before filling the request as interrupted. The next pass cannot undo the first fill.

Revalidate the offer-change state after awaited reads and before expiry or fill. If the state changed, retain the request for another pass. Preserve immediate interruption settlement when no offer appears.

// A restart continuation's words answer the requests its resumed work took, through reply
// recovery (design: slack-reply-lost-restart): its end tells this conversation the turn's state
// only, so the thread never gets that answer twice. A turn the mirror holds tells it there.
if (fill && !end.mirrored && isRestartContinuation(turn.opener)) {

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.

Major · Functional Correctness · Quick win

Keep the answer event when a restart continuation has no connector stamps.

The restart branch returns true before the empty-stamps fallback runs. A continuation with no connector stamps therefore emits only the turn state. Reply recovery fills outbox rows only from connector stamps, so no row delivers the answer. Before this branch, empty stamps returned false, and the normal answer event was emitted.

Suppress the answer only when recovery holds rows that cover this conversation. Otherwise, the answer must still be emitted through the normal path.

@AmethystLiang
AmethystLiang marked this pull request as draft November 21, 2026 05:35
AmethystLiang added a commit that referenced this pull request Nov 25, 2026
…uietly, and a restart continuation answers with the whole reply

Follow-up to the restart reply recovery that landed in #46044, #46068 and
#47898, carrying the two parts of #46048 main does not have.

- A fill recovery makes from a turn that ended over an hour ago, or any
  recovery or restart-continuation fill of a request admitted over a day
  ago, closes the request quietly (no post) instead of posting it. Rows now
  record when they were admitted (admitted_at) and, locally, why a fill
  closed quietly (expired_reason); each such close logs a warn line and
  counts. A row with no date, and a request a usage-limit pause told its
  thread to wait for, are never closed this way.
- A restart continuation's claimed requests are answered with the reply
  the restart cut partway (each cut of a chain, oldest first, up to four),
  then the continuation's own. A turn cut inside a tool call adds nothing,
  and a failed read leaves the continuation's answer alone.
- The reply matrix harness reads cut replies as the app does, and its rows
  carry real clock times.
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Closing as superseded. Main fixed the core of this PR with a different design: #46044 (151f776), #46068 (1e2d5fb) and #47898 (d8747bb). A restart continuation now claims its cut's requests through a host-written connectorClaim, and recovery waits on continuationsSettled instead of offer-based holds. The two parts main lacked, quiet closes for answers too old to post and the whole answer after a restart, continue in #48642, rebuilt on main's design.

The open review findings are moot on main. None was waived; this is what replaced each one:

Finding Status on main
r4650638618: the envelope hashed restartOf, so the host refused the continuation restartOf does not exist on main. #46068 hashes the continuation envelope over agentSessionMessagePayload(body), which strips the host-written connectorClaim as every send does (structured-agent-session-restart-continuation-envelope.ts).
r4649431659: a person typing after the continuation ended counted as mirrored, so the answer was lost The continuation_mirrored quiet close and personMessagesDuring are gone. #46068 decides the mirror from the cut opener's own mirrorPosts state (external-conversation-restart-cuts.ts), not from later messages.
r4649431664: an offer published between reads closed the row as interrupted Main reads no offers. A cut row stays owed until this start's continuations settle (continuationsSettled, #46068), and the claim commits in the continuation's admission transaction.
r4649431661: a failed deadline read left the row open beyond 24 h Main has no 24 h hold or deadline timer. Rows wait on continuationsSettled and the journal watch (#46068).
CodeRabbit r4650669024: disposal restored work after a pending read The hold-deadline timers this was about don't exist on main. Main's dispose() clears the watches and settle timers it owns.
CodeRabbit r4650669028: hold re-check after the row read No offer-based hold on main (see r4649431664).
CodeRabbit r4650669030: a restart continuation with no stamps lost its answer event That branch of turn-ends.ts was removed. On main, #46044 makes a turn end state-only only when its stamps name the conversation; otherwise it keeps the full end.

AmethystLiang added a commit that referenced this pull request Nov 25, 2026
…uietly, and a restart continuation answers with the whole reply

Follow-up to the restart reply recovery that landed in #46044, #46068 and
#47898, carrying the two parts of #46048 main does not have.

- A fill recovery makes from a turn that ended over an hour ago (a held
  empty-turn answer judged by when its turn ended), or a fill of a request
  admitted before this process started and over a day old, closes the
  request quietly (no post). A live turn's request, a hidden retry's
  included, never starts the request clock; a row with no admission date
  never ages by it on any path; a row a usage-limit pause ever owed keeps
  a paused mark through later cuts, claims and retry holds, and never
  ages by it either.
- A quiet close fills under its own delivery id, and the answer of the
  requests filled with it never keys on that id, so the outbox sends
  disjoint events. Rows record admitted_at and, locally, expired_reason;
  each close is counted and logged only once the journal shows it written.
- A restart continuation's claimed requests, and every request it answers
  in that thread, get the whole reply: each cut of the chain's partial
  prose, oldest first, then its own. The prose rides on the continuation's
  claim, built from the read that already builds the claim, so the fill
  reads no journal; over the answer cap the earlier part is cut with the
  existing note.
- A recovery pass still reading when the host changes or connectors stop
  writes, watches and schedules nothing once its read returns.
- The reply matrix harness carries real clock times and a process start.
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Correction to the mapping above: the disposal finding (CodeRabbit r4650669024) is not fully moot. Its hold-deadline timers are gone on main. But a recovery pass still reading when the host changed or connectors stopped could re-attach a journal watch on the old host once its read returned, and a later publication could then arm the 2 s settle timer. #48642 fixes it at b70334c: each pass carries the dispose generation it began in, and writes, watches and schedules nothing once that is stale. It is tested across a host change and a connectors-off. The other six mappings stand.

AmethystLiang added a commit that referenced this pull request Nov 25, 2026
…uietly

Follow-up to the restart reply recovery that landed in #46044, #46068 and
#47898 (refs #46048).

- A fill recovery makes from a turn that ended over an hour ago (a held
  empty-turn answer judged by when its turn ended), or a fill of a request
  admitted before this process started and over a day old, closes the
  request quietly (no post). A live turn's request, a hidden retry's
  included, never starts the request clock; a row with no admission date
  never ages by it on any path; a row a usage-limit pause ever owed keeps
  a paused mark through later cuts, claims and retry holds, and never
  ages by it either.
- A quiet close fills under its own delivery id, and the answer of the
  requests filled with it never keys on that id, so the outbox sends
  disjoint events. Rows record admitted_at and, locally, expired_reason.
- Each quiet close is written in its own call, so its own commit result
  says whether it closed; it is counted and logged only then. A call that
  threw is looked up once by key, and an unconfirmed close is logged as
  such, never counted.
- Recovery work begun before a dispose (another host, connectors off)
  writes, watches and schedules nothing once it resumes: boot's first
  read, each pass, a fill nested in it and a claim are bound to the
  generation they began in, and a reply write queued on the journal's
  lane asks whether it is still current when the writer takes it. A boot
  asking to open a chat while a pass runs gets its pass run again opened.
- The reply matrix harness carries real clock times and a process start.
AmethystLiang added a commit that referenced this pull request Nov 25, 2026
…uietly

Follow-up to the restart reply recovery that landed in #46044, #46068 and
#47898 (refs #46048).

- A fill recovery makes from a turn that ended over an hour ago (a held
  empty-turn answer judged by when its turn ended), or a fill of a request
  admitted before this process started and over a day old, closes the
  request quietly (no post). A live turn's request, a hidden retry's
  included, never starts the request clock; a row with no admission date
  never ages by it on any path; a row a usage-limit pause ever owed keeps
  a paused mark through later cuts, claims and retry holds, and never
  ages by it either.
- A quiet close fills under its own delivery id, and the answer of the
  requests filled with it never keys on that id, so the outbox sends
  disjoint events. Rows record admitted_at and, locally, expired_reason.
- A fill's rows are written as one command in one writer transaction that
  returns each row's result, so a batch commits whole or not at all. A
  quiet close is counted and logged only when its row changed. A call that
  fails probes its quiet closes once by key: one this attempt wrote wakes
  the sender before the error is rethrown. A failed recovery pass is
  settled again, and a live fill that throws still hands its rows to
  recovery.
- Work begun before a dispose (another host, connectors off), and a live
  turn end since reset, writes, holds, asks, watches, schedules and wakes
  nothing: boot, each pass and nested fill, claims, the live fill and its
  retry hold and send, the turn-end and retry callbacks, and the reply
  write's admit, asked just before it is posted to the writer worker.
AmethystLiang added a commit that referenced this pull request Nov 25, 2026
…uietly

Follow-up to the restart reply recovery that landed in #46044, #46068 and
#47898 (refs #46048).

- A fill recovery makes from a turn that ended over an hour ago (a held
  empty-turn answer judged by when its turn ended), or a fill of a request
  admitted before this process started and over a day old, closes the
  request quietly (no post). A live turn's request, a hidden retry's
  included, never starts the request clock; a row with no admission date
  never ages by it on any path; a row a usage-limit pause ever owed keeps
  a paused mark through later cuts, claims and retry holds, and never
  ages by it either.
- A quiet close fills under its own delivery id, and the answer of the
  requests filled with it never keys on that id, so the outbox sends
  disjoint events. Rows record admitted_at and, locally, expired_reason.
- A fill's rows are written as one command in one writer transaction that
  returns each row's result, so a batch commits whole or not at all. A
  quiet close is counted and logged only when its row changed. A call that
  fails probes its quiet closes once by key: one this attempt wrote wakes
  the sender before the error is rethrown. A failed recovery pass is
  settled again, and a live fill that throws still hands its rows to
  recovery.
- Work begun before a dispose (another host, connectors off), and a live
  turn end since reset, writes, holds, asks, watches, schedules and wakes
  nothing: boot, each pass and nested fill, claims, the live fill and its
  retry hold and send, the turn-end and retry callbacks, and the reply
  write's admit, asked just before it is posted to the writer worker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant