agent: flag to create new captures as runtime-v2#3107
Open
williamhbaker wants to merge 1 commit into
Open
Conversation
Adds a `--runtime-v2-new-captures` flag (env `RUNTIME_V2_NEW_CAPTURES`) to the agent. When enabled, any newly-created capture that doesn't already set `enable-runtime-v2` is published with that shard flag set to `true`, placing it on the V2 runtime. Existing captures are never touched, and an explicit per-task flag always takes precedence. This can be deployed inert: the flag defaults to false, so it only begins to take effect once the agent is configured to enable it.
dgreer-dev
approved these changes
Jul 2, 2026
dgreer-dev
left a comment
Contributor
There was a problem hiding this comment.
LGTM, functionally. No comment on when to deploy
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.
Description:
Adds a
--runtime-v2-new-capturesflag (envRUNTIME_V2_NEW_CAPTURES) to the agent. When enabled, any newly-created capture that doesn't already setenable-runtime-v2is published with that shard flag set totrue, placing it on the V2 runtime. Existing captures are never touched, and an explicit per-task flag always takes precedence.This can be deployed inert: the flag defaults to false, so it only begins to take effect once the agent is configured to enable it.
Manually tested on a local stack: Many scenarios with the
RUNTIME_V2_NEW_CAPTURESagent config on and off, with new & existing captures being published / re-published. Also, sanity checking of derivation and materialization publishing (unchanged).Workflow steps:
(How does one use this feature, and how has it changed)
Documentation links affected:
(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)
Notes for reviewers:
I ended up far from where I started. I was initially considering a mechanism in the runtime itself to decide to run a task on the V1 or V2 runtime, or some kind of computed shard label value. Both of these were complex and insufficient for various reasons: In the runtime, we don't have the creation time of the task readily available, computing the shard label value in all the places we'd need to was not trivial, and I don't think either way would readily extend to derivations since they need to make a decision at build time anyway about which image to run.
While these challenges are not intractable, I think this final "just add the spec flag to the spec" mechanism is the most obviously correct and least intrusive approach, and makes it very easy to tell which tasks are running V2.