Repository navigation
fix(execution): resume a run into the workspace it started in - #139
Merged
harenome merged 1 commit intoNov 16, 2026
Merged
Conversation
A run started from the page records the name of the workspace its job went into, in run.json. At start-up, a run picked up again goes back into that workspace while it exists. Before, a restarted app had no workspace open and matched one by its exact roots, so a workspace that held other runs too did not match and each restart made a new workspace. A record without the name, or one that names a deleted workspace, gets a workspace as before.
This was referenced Nov 16, 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.
Closes #138
What
A run started from the page records the name of its workspace in
run.json(fieldworkspace). At start-up, the app adds each run that it picks up again to that workspace, when the workspace still exists. Without this, a restarted app has no workspace open. It looks for a workspace that holds exactly the run's roots, and a workspace that also holds other roots does not match. Thus each restart makes a new workspace with a random name.Execution.workspaceis saved with the record.Execution.file_under(name)sets it. A record without the field loads with"".shared.adopt_runs(runs)adds started runs to a workspace, asadopt_rootsdoes, and records its name in each run. The builder's Run, the agent port check and the benchmark proofs use it.adopt_roots(..., into=name)adds the roots to the named workspace when it exists. It opens that workspace only when no workspace is open. When the workspace does not exist, the behaviour does not change.app.pypassesinto=ex.workspacefor each restored run.A record without the field, or one that names a deleted workspace, gets a workspace as before. The workspace that is open at start-up does not change for other reasons.
Touches
backend · routes · docs and site
Verified
On
main(06935f8) and on this branch, each in a clean rootless container (python:3.12, a temporaryNULLIUS_HOME):New route test
ResumeIntoWorkspaceinapp/ui_tests/test_run_routes.py. It opens a workspace that holds two roots, starts a run throughPOST /runthat pauses after its first part, stops the app, and callsmain()with a fresh state. Onmainit fails:AssertionError: 'eager-ferret' != 'witty-pelican'. With this change it passes. Two more cases pass on both: a record that names a deleted workspace, and a record without the field.The real app: started over
/r/a /r/b, a run with one partsleep 120started throughPOST /run, the app stopped while the run goes on, then started again without arguments.mainworkspaceremoved fromrun.jsonmainIn each case the log says
Run p picked up again on this machine (running), with no error.Backend suite,
python3 app/tests/parallel.py: 1988 tests in 116 modules, OK.Route suite,
python3 app/tests/parallel.py app/ui_tests: 325 tests in 40 modules, OK (322 onmain).Risk
A rename changes a workspace's name, so a run recorded before the rename gets a workspace as on
mainat the next restart. If the change is wrong, a restored run goes into the wrong workspace: its job is only listed there, and no data moves or is deleted. A revert undoes it, and the extraworkspacefield inrun.jsonis then ignored.