Skip to content

Container worker: honour workspace_key with a per-session working directory #408

Closed

Description

@pdettori

Found preparing the VM demo B runbook (#367, PR #403, fix-list item 7). Listed as an optional follow-up in the epic (#370).

Problem

On the container tier, every session's turns lease the same shared sandbox containers (harness/src/select-sandbox.ts:376-434 has no owner filter). BashRunner ignores Exec.workspace_key (remote-worker/internal/exec/runner.go:98-102: "BashRunner IGNORES it — … today's single shared workspace"). So every session, including another user's, works in the same /workspace. In the demo, user 2's agent sees user 1's git clone, and two concurrent sessions cloning the same repo collide on the same path.

Proposal

  • When WorkspaceKey is non-empty, run the command in /workspace/<key>, created on first use with a name validated to one path segment. An empty key keeps today's behaviour, so the proto stays additive (spec §3.4).
  • An idle or delete-time cleanup policy, mirroring the P4 vmpool per-run workspace (and not repeating P4 microVM tier: WorkspaceIdle=30min deletes a HITL session's workspace mid-session, silently #338's mid-session deletion).
  • Tests: two keys see disjoint directories; an empty key uses /workspace; a key containing / or .. is refused.

Explicitly NOT a security boundary

Same Unix user, same process list, same container: a command can cd ... This removes the collision and the "B sees A's clone" optics. The isolation fix is MI1 S5 owner binding (spec §9), and the runbook's "not claimed" section stays as written.

Critical path

Not for #367's acceptance (session ownership, not sandbox isolation). Worth doing before the epic's live multi-user demo with its git clone research act (#368), for the optics and to avoid the concurrent-clone collision.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions