Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This was referenced Nov 2, 2026
hzrd149
pushed a commit
to hzrd149/contextvm-sdk
that referenced
this pull request
Nov 11, 2026
…on-positive TTLs Bundles the two remaining verified findings from the rs-sdk ContextVM#111/ContextVM#112 review round: Writer leak on the gating drop path. Every inbound tools/call with a progressToken reserves an OpenStreamWriter before middleware runs. A request dropped by middleware (explicit gating -32042/-32043/-32000, transparent payment_rejected, capacity refusal, or any custom gating) never produces the normal-path response that is the only reaper for never-started writers, so the reservation (writer + closures + abort controller + metadata) leaked until transport teardown — one per gated streaming invocation on exactly the path a busy paid API hammers. A throwing middleware chain leaked the correlation route too. Fix: cleanupDroppedRequest is now the single owner of per-request state and releases the writer alongside the route; the chain-error path runs the same cleanup; the release logic is extracted as ServerOpenStreamFactory.releaseUnusedWriter and reused by deferIfStreamActive's never-started branch. Non-positive TTLs. paymentTtlMs: 0 (both lifecycles) and invoice ttl: 0 (explicit gating grant) birth-expired the pending/grant entry while the invoice stayed payable, disarming the redelivery dedup (CEP-8). Both now fall back to the default window, mirroring the guard getVerificationTimeoutMs already applied. Also documents the run-to-completion atomicity assumption of claim()+trySetPending() for porters (insight from the rs port).
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.
Depends on #108 and #110. Related: #111.
Summary
Recognize settlement despite missed notifications and retry retained paid results after publication failures without another payment or handler execution.
PaymentStateStore; fence reconciliation and publication by generation/ownership.Storage and recovery contract
The SDK bundles only in-memory storage and adds no storage dependency. Recreating a transport can recover results while the same application-owned store remains alive. Process restart or cross-host recovery requires a persistent implementation supplied and managed by the application. The SDK does not initialize/close custom backends or fall back to fresh memory on their errors.
Default-store lifetime limits are tested explicitly. A fresh memory store cannot recover an earlier result. No distributed-backend or process-crash durability guarantee is claimed for the bundled store.
Validation