Skip to content

fix(sdk): make durable run recovery reject incomplete history - #633

Merged
Kaguya-19 merged 1 commit into
standalone_alpha1from
codex/sdk-durable-event-recovery
Oct 8, 2026
Merged

Kaguya-19 merged 1 commit into
standalone_alpha1from
codex/sdk-durable-event-recovery

Conversation

@Kaguya-19

Copy link
Copy Markdown
Collaborator

When durable event pages overlap or stop before the run's recorded last sequence, SDK recovery can duplicate output or report a partial result as completed. Recovery now advances only through contiguous positive event sequences, ignores replayed events, and returns the existing result_unknown state for gaps or incomplete history. It only queries the original run.

Extraction Inventory

Baseline: standalone_alpha1 at 70228cfed; selectively extracted from d56d5bcc6.

File/block Change Verification
packages/sdk/src/client.ts: readDurableRunEvents Deduplicate replay; validate continuity; reject gap, invalid sequences and pages without progress 13 new regression scenarios
Same file: runs.result Incomplete history returns result_unknown with original recovery reference No submit_turn during recovery
packages/sdk/test/transport.test.ts Page/cross-page duplicates, misleading nextSeq, gap, missing sequence, early EOF, no progress, invalid sequence Existing paged output/usage/finishReason preserved

Validation

  • Before implementation: 13 new cases failed; existing paged recovery passed.
  • After implementation: all 14 focused runs.result cases passed.
  • SDK typecheck and build passed.
  • Full SDK transport file: 139 tests passed.
  • Lockfile and SDK dependency manifests match the existing installation; tests used ignored dependency links in an isolated worktree.

Public SDK result types, result projection, AgentLoop and Gateway protocol are unchanged. Materials, skill selection, Lantay adapters/vendor and large acceptance data are excluded. This PR and the Docker extraction are independent, both targeting standalone_alpha1.

@Kaguya-19
Kaguya-19 merged commit b243fa0 into standalone_alpha1 Oct 8, 2026
0 of 2 checks passed
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