WP-107: Preserve caller cancellation through provider requests - #1773
Open
simple-agent-manager[bot] wants to merge 17 commits into
Open
WP-107: Preserve caller cancellation through provider requests#1773simple-agent-manager[bot] wants to merge 17 commits into
simple-agent-manager[bot] wants to merge 17 commits into
Conversation
Contributor
Contributor
Author
|
Integration in progress — owned by task 01KZMFQJ4VKXEFB9K9Q64QKDDF. PR Shepherd: hands off until this completes. |
simple-agent-manager
Bot
force-pushed
the
sam/wp-107-preserve-caller-6jjttt
branch
from
August 10, 2026 00:14
b81ae6d to
bbc73bf
Compare
|
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.



Release contract
DO NOT MERGE THIS PR. Do not deploy it to shared staging. WP-107 is a foundation packet; the final integration task owns staging and merge authorization. This PR must remain open and unmerged even after every check is green.
Summary
ProviderRequestContextto every VM and volume provider operationprovisionNodeNo WP-100–103 or WP-109 lifecycle/inventory behavior is included.
Root cause
providerFetch()assigned its own timeout controller after spreadingRequestInit, overwriting any caller signal. The provider contract also had no context parameter, so cancellation could not cross retry, polling, helper, authentication, or API orchestration boundaries.RED evidence
On refreshed
origin/main(8eed3b740), an immediate caller abort used a different fetch signal and settled only after the 75 ms internal timeout asProviderError. Focused RED commit5e56b8ad9produced:provisionNode: 1 failure / 9 passesThe old behavior necessarily fails the pre-cancelled signal and exact in-flight identity regressions.
Final local evidence
git diff --check: passorigin/mainThe repository currently emits an existing Vitest/coverage-v8 patch-version warning; both complete coverage runs exited 0 with the totals above.
Independent local reviews
Reviewer findings drove additional regressions for production GCP credential closures, WIF STS/IAM, delegated volume mutations, delay cleanup, pending KV/DNS/D1 boundaries, response bodies after headers, and zero-body 204 races.
Staging
Intentionally skipped by explicit user instruction. No shared staging state was deployed or mutated. Local full suites, coverage, static gates, and independent reviews are the non-staging evidence.
Post-mortem
The internal timeout was implemented as an exclusive signal rather than a composed lifecycle boundary, and tests covered timeout expiry without a caller signal. The durable process fix updates provider quality guidance so timeout wrappers must compose cancellation and retry/poll/multi-step tests must assert prompt exact rejection, cleanup, and post-cancel quiescence.
Agent Preflight (Required)
Classification
External References
N/A: the change hardens an internal private provider contract using standard platform AbortSignal behavior; no external API contract or provider semantics changed.
Codebase Impact Analysis
The change spans
packages/providerspublic provider operations and HTTP/retry/poll helpers plus the directapps/apiGCP credential/token and node-provisioning call paths. CLI, data schema, UI, deployment, and unrelated lifecycle/inventory paths are unchanged.Documentation & Specs
Updated
packages/providers/src/provider-fetch.tsJSDoc,.claude/rules/02-quality-gates.md,.claude/rules/06-technical-patterns.md,packages/providers/AGENTS.md, and the WP-107 task record to document cancellation propagation, exact reasons, cleanup, and post-cancel quiescence.Constitution & Risk Check
Checked Principle IV size/DRY constraints and Principle XI no-hardcoded-values requirements. The primary risks were cancellation identity loss, listener/timer leaks, and resource side effects after cancellation; scenario tests and independent constitution, Workers, security, test-quality, doc-sync, and completion reviews all pass.