Repository navigation
Run store-owned turns on remote compute targets - #445
Open
Kevin Kitts (kittskevin) wants to merge 3 commits into
Open
Kevin Kitts (kittskevin) wants to merge 3 commits into
Kevin Kitts (kittskevin) wants to merge 3 commits into
Conversation
This was referenced Dec 2, 2026
…omputeProvider Wires store-owned (`statePolicy: "store-owned"`) turn execution into the unified ComputeTarget / ComputeProvider / ComputeRegistry abstraction: - Extends ComputeProvider with optional `openStoreOwned(request) -> RemoteStoreOwnedLease`. - Validates fail-closed at `worker.start()` that every enabled `store-owned` target has a registered provider implementing `openStoreOwned` and a session store supporting opaque archives. - Per durable turn, probes the opaque store head, answers an already-committed turn key from the worker-owned trusted record with zero sandbox contact, opens a lease through the target's provider (`expectedHead` + lazy `readArchive`), verifies `hydratedHead` matches the stored head, runs the turn on the bound remote runtime behind the worker model credential broker, takes one opaque archive and commits it with conditional store-wins CAS. - Each turn binds its lease's client for the target with resume: true exactly when the store holds a head in the epoch (the sandbox kept it warm or hydrated it from the archive), so no later turn is bound as one whose remote lost the conversation; turn 0 and an epoch's first turn create it. The turn's model handler is its own, made while the session holds no binding, so it serves that turn's binding only. A binding the turn did not make, or a lease client still bound to another session, is refused for a retry: a client serves one session at a time. - The provider's open has a 60 s default deadline, the same as the session manager's deadline for the native create or resume that follows it on the lease's client. The two run one after the other, neither covers the other, and each holds the session lock at most half of what a caller waits for it. A native create or resume past its deadline fails the turn for a retry and drops the sandbox cache. - A conflict invalidates the warm cache and reports unpublished (reason "conflict") without bricking the session. Unset, worker behavior is unchanged. - A cancelled attempt (a lost activity lock, a cancel or a delete) commits nothing, as a local session's does since #382: the warm cache is invalidated and the turn reported unpublished (reason "cancelled"), so no cancelled result is stored under the turn key and its retry runs the turn from the stored head. A cancelled attempt's result settles nothing for good (no store-owned refusal is raised). - Documents the rollout: the release that first lets workers enable a compute target is deployed by stop, deploy, start, because during a rolling update a worker without compute-target support can run a target session's turn locally. Targets are enabled only after every worker runs it; a rollback first ends or deletes every session placed on a compute target. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A local turn that lost its Copilot runtime connection skips its snapshot commit (transport_loss) because the runtime may have torn its files. The same holds for a remote sandbox: a store-owned turn with a transport-loss result, or an error result in the connection-closed words without the flag (the inactivity watchdog, a session error; the same check the remote guard of runTurn uses), now invalidates the warm cache, closes the lease and reports the turn unpublished with reason "transport_loss". The retry starts from the stored head. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add docs/developer/building/compute-providers.md: who does what, the ComputeProvider and RemoteStoreOwnedLease interface with a TypeScript skeleton, the store-owned target settings (storeOwned.maxArchiveBytes and storeOwned.deadlinesMs), what happens every turn, the rules a provider must keep, error handling, testing and rollout. List it in the developer guide. In the configuration reference, describe the store-owned start checks and the storeOwned block, and link the guide. The design record's link to the guide no longer says it is to be added. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
waldemort-auto
Bot
force-pushed
the
waldemort/m1-pr2-opaque-archive-store
branch
from
December 2, 2026 07:21
02bb72b to
7851de6
Compare
waldemort-auto
Bot
force-pushed
the
waldemort/m1-pr3-store-owned-mode1
branch
from
December 2, 2026 07:21
857c181 to
9d2bc3c
Compare
This branch has not been deployed
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
857c18101ff8c5516f53fffde0f8af1471c3a863remote-store-owned.test.jsandcompute-integration.test.mjscover startup validation, cold/warm lease binding, hydrate mismatch recovery, per-phase deadlines, transport-loss and cancellation non-commit, and idempotent turn-key replay.↓ Hosted PR checks on this branch run once the pull request is opened, and end-to-end qualification against a live external sandbox platform remains provider-specific.
Summary
Wires opt-in store-owned remote execution (
statePolicy: "store-owned") into theComputeTarget/ComputeProviderabstraction from #443 and the opaque-archive store contract from #444, and adds the developer guide for writing a compute provider.Under
store-owned, the session store owns durable state and the remote sandbox is a disposable warm cache. On each turn the worker probes the opaque archive head, answers an already-committedturnKeydirectly from the trusted turn record without contacting a sandbox, or opens a lease viaprovider.openStoreOwned(), verifieshydratedHead, runs the turn behind the worker's model credential broker, packs one opaque archive, and commits it with conditional store-wins CAS.Design record:
docs/proposals/remote-compute-targets.md§8–§11.Provider guide:
docs/developer/building/compute-providers.md.Stack
main)waldemort/m1-pr1-compute-abstraction)waldemort/m1-pr2-opaque-archive-store)What changes
compute-target.ts,remote-store-owned.ts): extendsComputeProviderwithopenStoreOwned(request) -> Promise<RemoteStoreOwnedLease>and addsstoreOwnedtarget settings (maxArchiveBytesup to 16 MiB,deadlinesMsforopen,read,dehydrate, andcommit).worker.ts):worker.start()fails closed unless every enabledstore-ownedtarget has a registered provider declaring"store-owned", implementingopenStoreOwned, and a session store supporting opaque archives.remote-store-owned.ts,session-lifecycle.ts,session-proxy.ts):turnKeyretries fromreadTrustedTurnCommitwith zero sandbox contact.expectedHeadand a single-usereadArchivecallback toopenStoreOwned; verifieshydratedHeadmatchesexpectedHead(STORE_OWNED_HYDRATE_MISMATCHinvalidates the warm cache and retries).CopilotClientwithresume: trueiff the store holds a head in the current epoch, and creates a fresh per-turn model broker handler while the session holds no binding.open, 60 sread, 120 sdehydrate, 60 scommit, and 60 s native create/resume).SnapshotConflictError), user stops, cancelled attempts (lost activity lock, cancel, delete), and lost runtime connections (transport_lossor connection-closed errors) commit nothing, invalidate the warm cache, close the lease, and emitsession.snapshot_unpublished.docs/developer/building/compute-providers.md, documentsstoreOwnedtarget configuration indocs/developer/reference/configuration.md, and documents the stop-deploy-start rollout and rollback procedure indocs/developer/deploy/aks.md.Compatibility
docs/developer/deploy/aks.md).Tests
Adds
packages/sdk/test/local/remote-store-owned.test.jsand extendspackages/sdk/test/unit/compute-integration.test.mjs:reusedWarm: true), cold restore on sandbox replacement, and epoch reset acrossFilesystemSessionStoreandSessionBlobStore.readArchivehead-movement refusal, andinvalidateWarmCachehandling.turnKeyrecovery after a crash between archive commit and activity completion, with zero sandbox contact.STORE_OWNED_DEADLINE) and abort signal propagation.Not in this PR
Session workspaces on a compute target, snapshot-owned (platform-managed) state policies, worker-side token usage metering for brokered requests, and orchestration-version fencing across mixed fleets (see
docs/proposals/remote-compute-targets.md§12).