Skip to content

feat(web): let a run started over the API name the workspace its jobs go into - #514

Draft
pierreleca wants to merge 9 commits into
ThinkFlowLab:mainfrom
pierreleca:feat/api-run-workspace
Draft

pierreleca wants to merge 9 commits into
ThinkFlowLab:mainfrom
pierreleca:feat/api-run-workspace

Conversation

@pierreleca

Copy link
Copy Markdown
Contributor

Closes #513

What

  • Replaces feat(builder): launch a saved recipe from a shell as the builder's Run does #446, on the API's start.
  • Before: an API start's jobs went into the open workspace.
  • workspace on POST /api/v1/runs, Client.start, remote run --workspace, MCP's start_run.
  • Made, closed, when missing. The open workspace stays open; a restart reopens it.
  • Not lowercase letters, digits and dashes, or a link or a file in its place: 400, nothing started.
  • Left alone: the builder's Run (no workspace choice) and runs/check.

Verified

  • Keyless scratch server, HumanEval's nop: remote run --workspace trials put the job in trials; without it, in the open workspace, still open.
  • Bad name, read token: exit 4, nothing started.
  • Backend 3,275, routes 857: nothing fails that main passes.
  • Not checked: a Settings host.

Risk

  • A workspace made this way is not reopened at start until opened once.
  • As on main, two starts at once into the open workspace can drop one job from workspace.json.
  • Undo: revert.

Agents

  • Claude Code, Opus 5.5
  • Codex, gpt-6-astra

… go into

A program that starts a run over the API cannot say where its jobs go:
they land in the workspace open on the server, or in a new one with a
random name when none is open. A person reading the pages then finds
runs they did not start in the workspace they are looking at.

A start now takes a workspace: the `workspace` field of
`POST /api/v1/runs`, `Client.start(workspace=...)`, `nullius remote run
--workspace NAME` and the `workspace` input of MCP's `start_run`. The
workspace is made, closed, when there is none, and the run's record
names it for a restart. The open workspace stays open with its own jobs,
and a restart reopens it, not the one the run went into. A name that is
not lowercase letters, digits and dashes is refused with 400, as is a
workspace that is a symbolic link or leads outside the workspaces
folder. Without the field nothing changes.

The builder's Run offers no workspace: its runs go into the open one,
as before.
…es it

A start that named the open workspace read a second copy of it from disk,
added its jobs to that copy and made the copy the open one. A start that
names no workspace adds to the first copy, and two such starts at once
could each drop the other's job from the open workspace's roots.

Under the lock, a named start now makes the workspace when it is missing
and adds its jobs through adopt_roots, which uses the open workspace's own
object, as before the lock.
The line on `workspace` already gives the names a start takes. The four
lines added with the fixes covered a link or a file in the workspace's
place, null, and starts at the same moment: the server's answer names
each refusal, and no reader acts on them before a start.
…case

The repository's test rules ask to extend a nearby case first. The path
conflict test already asserts the refusal, no execution and no run record:
a folder and a link in the lock's place are two more names in it, and the
link's target outside the workspaces folder must not be created. A link to
a lock the server holds is refused by the same link check.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start a run over the API into a named workspace

1 participant