fix(profile): preserve receipts across request copies - #112
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #111.
The real HTTP route can clone a request twice before execution:
Profile materialization writes its v2 acknowledgment on the request object received by the backend. Before this fix, the response and durable run read the original request, so either clone could strand the acknowledgment even though materialization succeeded.
This change relays the acknowledgment from every execution request to the route-owned request before each delta and again at iterator completion. A silent backend still produces one acknowledgment-only metadata delta, so durable state and non-streaming/streaming callers receive it.
Proof:
pnpm exec vitest run tests/execution-timeout.test.ts tests/durable-runs.test.ts tests/smoke.test.ts tests/sse-keepalive.test.ts— 114/114pnpm test— 621 passed, 6 skippedpnpm build— passedgit merge-tree --write-tree origin/main HEAD— clean tree7c7572e9c4793922c7cd58cf638ff0ad8589addfNew real-route cases cover: