Repository navigation
feat(runner)!: submit() continues a stored instance, and a kept run is left up for its submitter - #256
Merged
Conversation
…s left up for its submitter
earakely-scale
approved these changes
Oct 19, 2026
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.
Second step towards
task runandeval runalways going through the configured[runner](discussed on #236). Two CLI options only worked in-process because theRunnercontract couldn't carry them.Resume (
--context-json+--start-step).Runner.submit()takes an optionalinstance_id. Given one, the run continues that instance from its stored context, atmetadata["start_step"]. A caller resumes by naming the instance rather than by shipping a context, so contexts stay out of runner payloads (Temporal limits one to 2 MB).LocalRunnerseeds the run from the stored context, then lays the submitted metadata (per-run overrides, keys) over it.task_versiongiven, it runs the version the instance records, so a newer version never runs over an older instance's context.Task.runnow drops the recorded failures of the steps it is about to run again. A resumed run whose failed step now passes therefore ends COMPLETED, under any runner.--keep. A run whosemetadata[KEEP_KEY]is set and that ends on its own, passed or failed, is left up. Its submitter tears it down, for example from the instance's stored context withteardown_run. A cancelled run is torn down either way: what a step in flight deployed is only in the runner's live context.Breaking:
Runner.submitgains a parameter, so an override with the old signature no longer matches.LocalRunneris the only implementation in this repo.Tests: a kept run that completes is left up, and one that is cancelled is torn down. A run given an existing instance, with no version, gets that instance's stored context, its id,
start_stepand the stored version. One given an instance of another version fails without running. A run drops the recorded failures of the steps it runs again.

Confidence Score: 5/5
The PR appears safe to merge; the previous version-mismatch finding is fixed.Summary
Adds stored-instance resume and lets submitters keep resources after a run finishes.
The latest change rejects mismatched tasks and versions. No new actionable issues were found. Tests were inspected, not run.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A["Runner.submit"] --> B{"Stored instance?"} B -->|Yes| C["Use recorded version unless supplied"] C --> D{"Task and version match?"} D -->|No| E["Fail before running"] D -->|Yes| F["Restore context and apply overrides"] B -->|No| G["Create context"] F --> H["Task.run"] G --> H H --> I{"Finished on its own with keep?"} I -->|Yes| J["Leave resources up"] I -->|No| K["Tear down resources"]Reviews (3) · Last reviewed commit: "fix(runner): a resume refuses an instanc..." · Reviewed by Greptile