Skip to content

Multi-repository environments serialize on one lease slot and cannot set up checkouts #257

Description

@danny-avila

A common trusted-VM layout is one environment whose root holds several checkouts (for example root: /home/<user>/src containing LibreChat, agents and code-interpreter). With that layout:

  • All work serializes. Workspace lease slots only parallelize distinct registered roots, so raising LIBRECHAT_CODE_WORKSPACE_LEASE_SLOTS does nothing for one broad root. On one deployment with a single broad root, 10-31% of execute_command requests per day hit the 30 s WORKSPACE_QUEUE_TIMEOUT (1,775 of 5,744 on the busiest day). Agents that start background checks in parallel only queue them.
  • No per-checkout setup. setup runs at worker start with cwd at the root, and per conversation worktree only when --conversation-worktree-root is set and the sources are git repositories. actions always run with cwd forced to the root. Nothing can run a repository's own bootstrap (for LibreChat, npm run smart-reinstall) in a fresh worktree of one of the contained checkouts, so agents improvise, for example by symlinking another checkout's node_modules, which resolves workspace packages to the wrong branch.
  • Credentials: with checkout routing, the broad root is not itself a repository, so actions and setup at the root get no GitHub credentials.

Environments cannot overlap, so a per-repository environment cannot sit beside the broad one.

Proposal

Allow an environment to declare repositories inside its root, each with its own setup and lease capacity. Sketch:

name: primary
root: /home/ubuntu/src
repositories:
  - path: LibreChat
    setup: { command: npm run smart-reinstall -- --skip-client, timeoutMs: 900000 }
  - path: agents
    setup: { command: npm ci, timeoutMs: 600000 }
  • Each repository (and each conversation worktree created from it) is its own lease key, so work in different repositories runs in parallel up to the negotiated slot count.
  • setup runs once per new worktree of that repository, with cwd at the worktree and that repository's credentials.
  • Alternatively, allow non-overlapping child environments under a parent root.

Acceptance

  • Two commands in two different repositories of one environment run concurrently with 2 slots.
  • Creating a worktree of LibreChat runs its declared setup there, with LibreChat-scoped credentials.
  • Existing single-root environment definitions keep working unchanged.

Activity

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