Skip to content

A restart opens the run's workspace, not the workspace that was open #157

Closed

Description

@harenome

Priority

medium

Components

  • app/web (routes)
  • docs and the site

Evidence

Workspace witty-pelican was open. A run paused on a remote host belongs to workspace humble-gecko. After each restart of the app, the open workspace was humble-gecko.

The same on main (b11083b), in a clean container. Workspace alpha holds /r/a and workspace bravo holds /r/b. A run with one part sleep 300 starts from bravo through POST /run. Then alpha is opened, the app stops while the run goes on, and the app starts again without arguments:

open workspace: alpha
  workspace alpha: opened 2026-11-16T14:50:23+00:00 roots ['/r/a']
  workspace bravo: opened 2026-11-16T14:50:22+00:00 roots ['/r/b', '$NULLIUS_HOME/data/runs/p/jobs']
== app stopped
run still alive: yes
== restart without arguments
open workspace: bravo
  workspace alpha: opened 2026-11-16T14:50:23+00:00 roots ['/r/a']
  workspace bravo: opened 2026-11-16T14:50:25+00:00 roots ['/r/b', '$NULLIUS_HOME/data/runs/p/jobs']
Run p picked up again on this machine (running)

When no workspace is open before the restart, the result is the same: bravo is open after it. Without a run, the same restart opens no workspace and shows the first steps of the Runs page.

Cause:

  • A restart without arguments opens no workspace (app/app.py, main). The Runs page then shows the first steps, with the workspaces in the order that they were last opened.
  • For each run that it picks up again, main calls shared.adopt_roots([ex.jobs], into=ex.workspace).
  • adopt_roots (app/web/shared.py) adds the job to that workspace. It also opens the workspace when no workspace is open, and thus marks it as the workspace opened last.

Thus the run, not the user, selects the open workspace. With runs from more than one workspace, the first run that execution.restore() returns selects it.

Reproduction

  1. Make two workspaces, A and B.
  2. Start a run from B. Open A.
  3. Stop Nullius while the run goes on or is paused.
  4. Start Nullius again without job paths.
  5. Open Runs. Workspace B is open, and B is first in the list of workspaces.

Expected

A restart without job paths reopens the workspace that was open before it: A. The restarted app adds the run's job back to B and does not open B. A workspace that the user closed with Close stays closed after a restart. A restart over job paths opens the workspace of those paths, as it does now.

Workaround: open A by hand after each restart.

Acceptance

  • A restart without job paths reopens the workspace that was open, with or without a run to pick up again.
  • At start-up, a run picked up again goes back into its workspace, and that workspace does not open.
  • After Close, a restart opens no workspace.
  • A restart over job paths opens the workspace of those paths, as it does now.
  • Without workspaces, a restart shows the first steps, as it does now.
  • A route test fails on main and passes with the fix.

Dependencies and related

Follows #138 and #139: #139 made a run picked up again go back into its workspace. This issue is about the open workspace only. No other issue or pull request found (searched for workspace restart, open workspace, reattach workspace, adopt_roots, picked up again, last opened workspace).

Activity

  1. added
    bugSomething isn't working
    P2Planned: limited in scope, has a way around it, or a missing feature
    on Nov 16, 2026
  2. added theissue type on Nov 16, 2026
  3. added a commit that references this issue on Nov 17, 2026
    2371a16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Planned: limited in scope, has a way around it, or a missing featurebugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions