Skip to content

Include transient and speculative WFT events in GetWorkflowExecutionHistoryResponse#9325

Draft
spkane31 wants to merge 38 commits intomainfrom
spk/update-premature-end-stream
Draft

Include transient and speculative WFT events in GetWorkflowExecutionHistoryResponse#9325
spkane31 wants to merge 38 commits intomainfrom
spk/update-premature-end-stream

Conversation

@spkane31
Copy link
Contributor

@spkane31 spkane31 commented Feb 13, 2026

What changed?

Re-does #9138 which was incidentally merged.

Include transient and speculative WFT events in GetWorkflowExecutionHistoryReponse response, unless UI or CLI made request.

  • Adds transient_or_speculative_events back to GetMutableStateResponse
  • Reserve transient_workflow_task in HisotryCOntinuation token
  • Add validation helpers
  • Add query-compare-query for transient events at request start and end

Re-implements #7732

Why?

Fix "premature end of stream" errors when workers request history after cache eviction w/ transient/speculative workflow tasks present. This adds transient & speculative WFT events in GetWorkflowExecutionHistory (already in PollWorkflowTask). Worker cache eviction w/ speculative workflow tasks causes the expected and actual event counts to be different. #7732 passed transient events through continuation tokens, which could become stale during pagination. This PR implements mutable state querying at both start and end of pagination and compares transient event IDs to detect if WFT state changed during pagination and return a retryable error.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

Same risks from #7732

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