You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Updating thirdshift during an Experiment stops it: the Trial scope launcher execs the deleted install path #1498
This was generated by AI during an A/A Experiment for #1434.
Problem
Replacing the installed thirdshift binary while an Experiment is running, for example with thirdshift update, makes the next Trial launch fail. The failure then stops the Experiment.
src/scope.rs:445 (v0.17.2 and main) wraps every scoped Trial and Grader as systemd-run --user --scope … <current_exe> --oom-exec <program> …, using std::env::current_exe(). On Linux, once the file at the install path has been replaced, that function returns /home/jacob/.local/bin/thirdshift (deleted), and systemd-run can't exec it. #261 fixed the same problem for child Runs (child_run.rs's own_executable() uses /proc/self/exe), but the scope launcher never got that fix.
Using /proc/self/exe directly won't work here, because systemd-run execs the program from the user manager, where "self" is the manager. The path needs to stay valid in another process, for example /proc/<thirdshift pid>/exe, or a private copy of the binary made at Experiment start.
Evidence (2026-10-27, thirdshift host, Experiment 83721fbb, started on 0.17.1)
~/.local/bin/thirdshift was updated to 0.17.2 at some point between 19:18 and 19:32 EDT.
At 19:32:25 the next Trial launch exited at once. Its attempt stderr: Failed to find executable /home/jacob/.local/bin/thirdshift (deleted): No such file or directory.
That worker sat idle until the other worker's Trial ended at 19:48. The Experiment then failed with Arm Trial protocol failed (exit status: 1): Failed to find executable … (deleted) and was left paused.
Starting the same command again resumed it (36 Trials remaining), so no Trials were lost. Without someone watching, though, about 16 minutes of the Experiment were wasted and it would have stayed stopped.
Expected
The guide says an update is safe while a Ticket run or Spec run is using the old binary. The same should hold for an Experiment: Trial and Grader launches keep working after the install path is replaced. A regression test can follow #261's: replace or remove the binary at its install path in the middle of an Experiment, then start the next scoped Trial.
Confirmed on the selected Base snapshot, 9712feb. Keep #1498 as one bug fix covering the shared Trial and Grader launcher.
Diagnosis and evidence
src/scope.rs:729 passes current_exe() to systemd-run; the helper at line 744 still uses std::env::current_exe(). Both trial_command and grader_command use this launcher.
A standalone Rust probe extracted the current launch, current_exe, scope_base, manager_command and available helpers, with inert bookkeeping stubs, and exercised real systemd user scopes. Before replacement, the wrapper succeeded. After atomically replacing the probe executable, current_exe returned its install path with (deleted) and the launcher exited 1 with Failed to find executable … (deleted): No such file or directory. Removing the executable produced the same result.
In both cases, passing /proc/<parent PID>/exe successfully executed the original wrapper. This confirms a viable fix without changing the installed binary or running a production Experiment.
src/evals/experiment/execution.rs:262 propagates a non-OOM launch failure as Arm Trial protocol failed. src/evals/experiment/workers.rs:81 stops further dispatch and joins workers before returning the error, consistent with the reported delay while another Trial finished.
Replace the install-path lookup in the shared capped launcher with a reference to the running thirdshift executable that another process can execute, such as /proc/<thirdshift PID>/exe. Construct it in the owning thirdshift process and preserve the proc path without canonicalizing it. Keep the original wrapper version, requested Arm program, arguments, environment, memory caps and OOM behavior. A bare /proc/self/exe is unsuitable because another process consumes the path.
Acceptance and validation
Add regression coverage that replaces or removes a copied running executable, then launches the next Trial and a Grader. Assert that the original wrapper runs and the replacement does not. Also cover a command prepared before replacement and executed afterwards. Reuse the replacement fixture in tests/support/mod.rs:654 and the pattern in tests/spec_run.rs:825; retain scope-policy checks. Run relevant scope and Experiment tests, then scripts/affected-tests main.
Extend the update-safety wording in docs/guide.md:987 and src/update.rs, regenerate the manual, and check the Experiment scope description in site/architecture/index.html:276 for corresponding wording.
The local reproduction confirms the launcher defect; a complete Experiment with production agents was not run.
Activity
JacobStephens2 commentedon Nov 10, 2026
Agent Brief
Confirmed on the selected Base snapshot, 9712feb. Keep #1498 as one bug fix covering the shared Trial and Grader launcher.
Diagnosis and evidence
src/scope.rs:729passescurrent_exe()tosystemd-run; the helper at line 744 still usesstd::env::current_exe(). Bothtrial_commandandgrader_commanduse this launcher.launch,current_exe,scope_base,manager_commandandavailablehelpers, with inert bookkeeping stubs, and exercised real systemd user scopes. Before replacement, the wrapper succeeded. After atomically replacing the probe executable, current_exe returned its install path with(deleted)and the launcher exited 1 withFailed to find executable … (deleted): No such file or directory. Removing the executable produced the same result./proc/<parent PID>/exesuccessfully executed the original wrapper. This confirms a viable fix without changing the installed binary or running a production Experiment.src/evals/experiment/execution.rs:262propagates a non-OOM launch failure asArm Trial protocol failed.src/evals/experiment/workers.rs:81stops further dispatch and joins workers before returning the error, consistent with the reported delay while another Trial finished.src/child_run.rs:618; its/proc/self/exefix does not cover this launcher. Scheduled Passes start Runs during an Experiment on the same host, so Trials time out under load #1494 concerns host contention, and Replace axoupdater with a small verified updater #1592 concerns updater replacement; neither duplicates this bug.Implementation
Replace the install-path lookup in the shared capped launcher with a reference to the running thirdshift executable that another process can execute, such as
/proc/<thirdshift PID>/exe. Construct it in the owning thirdshift process and preserve the proc path without canonicalizing it. Keep the original wrapper version, requested Arm program, arguments, environment, memory caps and OOM behavior. A bare/proc/self/exeis unsuitable because another process consumes the path.Acceptance and validation
Add regression coverage that replaces or removes a copied running executable, then launches the next Trial and a Grader. Assert that the original wrapper runs and the replacement does not. Also cover a command prepared before replacement and executed afterwards. Reuse the replacement fixture in
tests/support/mod.rs:654and the pattern intests/spec_run.rs:825; retain scope-policy checks. Run relevant scope and Experiment tests, thenscripts/affected-tests main.Extend the update-safety wording in
docs/guide.md:987andsrc/update.rs, regenerate the manual, and check the Experiment scope description insite/architecture/index.html:276for corresponding wording.The local reproduction confirms the launcher defect; a complete Experiment with production agents was not run.