| title | Workspaces (Multi-Repo Fleet) |
|---|---|
| sidebarLabel | Multiple Repositories |
| description | Use when one worker should serve several repositories or tracker teams: workspace.toml, routing rules, and isolated per-task worktrees. |
| section | Automation |
| order | 3 |
| dateModified | 2026-11-28 |
A workspace lets one devintern worker serve every repository you automate. You describe the repositories once in ~/.devintern/workspace.toml, then poll either one default tracker query or several separate tracker teams. One automation license covers the whole workspace.
devintern worker init inside a checkout writes a one-repo workspace. Add more later:
devintern worker scaffold # create ~/.devintern/workspace.toml and .env
cd ~/code/backend && devintern worker add-repo
cd ~/code/frontend && devintern worker add-repoworker add-repo adds a [[repos]] entry from the checkout's origin remote, merges new keys from a legacy .devintern-code/.env (if the checkout still has one) into the shared .env (conflicting values go to that repo's [repos.env]), and seeds a routing rule for a Jira or Linear project key. On a repository devintern init registered as manual-only, it removes manual_only so the worker uses it. Running it again is a no-op, and comments in workspace.toml are preserved. The repo's .devintern-code/settings.json needs no changes.
- The worker keeps a bare clone of each repository under
~/.devintern/repos/and runs each task in a fresh worktree under~/.devintern/worktrees/. Your own checkouts are never touched. - Before the agent starts, dependencies are installed by detecting the package manager from the lockfile. If that fails, the run continues with a warning.
- Worktrees are removed after a successful run and kept after a failure for debugging, then deleted after
worktrees_ttl_days(except a worktree holding unfinished work that could not be pushed). - Runs, queue, and schedule state live in
~/.devintern/state/queue.db. Worker sign-in and relay pairing live in~/.devintern/state/code/; usedevintern worker loginto sign in.
A short example with two repositories and one tracker query:
[workspace]
worktrees_ttl_days = 7 # delete kept worktrees after this many days
dashboard = true # embedded dashboard on dashboard_port (default 4400)
[defaults]
tracker = "jira"
task_query = "sprint in openSprints() AND labels = devintern"
worker_task_args = "--create-pr" # flags for every task run
poll_interval = 60 # seconds
pr_labels = ["devintern"] # GitHub only
# pr_attribution = false # omit the "Opened by DevIntern" PR/MR footer
[[repos]]
name = "backend"
remote = "git@github.com:acme/backend.git"
default_branch = "main" # optional; base for task worktrees and task PRs (default: remote HEAD)
env_file = "env/backend.env" # optional, relative to ~/.devintern
[repos.env]
GITHUB_REPO = "acme/backend"
[[repos]]
name = "frontend"
remote = "git@github.com:acme/frontend.git"
[[routing.rules]]
repo = "backend"
project = "BACK"
[[routing.rules]]
repo = "frontend"
labels = ["frontend"]Set manual_only = true on a [[repos]] entry for a repository you only run by hand from your own checkout. The worker skips it: no clone, no polling, no routing, automations, or worker add tasks. A workspace whose repos are all manual-only does not need [defaults].tracker. A manual-only repo without a hosted remote can set path = "/absolute/checkout/dir" instead of remote; runs in that directory or below it use the entry. devintern init writes these entries for you.
Running devintern <TASK> inside a checkout whose origin matches a [[repos]] entry (manual-only or not) uses that workspace: the shared .env, the repo's env_file and [repos.env], [trackers] settings, pipelines, prompt overrides, sign-in, and run history. A ticket being worked on by the worker cannot be started by hand at the same time (and the reverse); the worker retries its run later.
Keys not shown here are documented on the page for their feature:
| Keys | Page |
|---|---|
[[automations]] |
Recurring Automations |
[[estimations]] |
Story Points Estimation |
[[error_monitors]] |
Sentry Auto-fixes |
[workspace].conflict_resolution*, auto_merge*, ci_failure_fix; [[repos]].sync_team_prs, auto_merge_team_prs, auto_merge_safe_paths, auto_merge_deny_paths, auto_merge_review_paths |
PR Follow-up |
[worker.schedule], [worker].auto_update, [workspace].dashboard_port |
Worker Daemon |
[dashboard].allowed_origins, tailscale_autodetect |
Dashboard |
[dashboard.access] |
Dashboard access levels |
[reporting].auto_report, contact_email |
Reporting Bugs |
[mcp].allow_direct_delegation |
Agent Skills: Delegate tasks through MCP |
[workspace].git_author_name, git_author_email (also per [[repos]]) |
Configuration: Commit identity |
[defaults].dependency_mode |
Delegation: Dependent tasks |
[[teams]].dependency_mode |
Worker Daemon: Ticket dependencies |
pipeline_file |
below |
Notes on the keys above:
[defaults].trackercan be any tracker with polling support.- A repo's
pr_labelsreplaces[defaults].pr_labels. For a manual-only repo, setPR_LABELS(comma-separated) in its env file. pr_attributionis on by default and adds the one-line DevIntern footer to PR and MR bodies; set it tofalsein[defaults]or a[[repos]]entry, or setPR_ATTRIBUTION=falsein a repo's env file. A repo's value replaces the default.- Repo names must be unique and filesystem-safe; they become directory names.
Set mode = "automations_only" in [workspace] for a worker that only runs your scheduled automations and ad-hoc devintern worker add tasks. The default is mode = "full".
[workspace]
mode = "automations_only"In this mode, whatever credentials are set (including GITHUB_TOKEN and a relay pairing):
- Off: tracker polling, Sentry monitors,
[[estimations]], and relay events.[defaults].trackeris not required, andtask_queryor[[teams]]are ignored. - Off: PR review feedback, @mentions, CI fixes, conflict resolution, base sync, auto-merge, and stacked-PR maintenance, on GitHub and GitLab.
- No task opens a PR. Every
[[automations]]entry must haveopen_pr = false; one withopen_pr = truefails config validation. PR flags in[defaults].worker_task_args(--create-pr,--auto-review) are dropped. devintern worker addtasks still run, because each one is an explicit operator action. They commit to a local branch in their worktree and do not push or open a PR. Because no task opens a PR,worker add --afterandDepends on:dependencies are rejected; enqueue a follow-up once the task it builds on has finished.
devintern worker doctor shows the mode, and its "What this worker will do" section lists each handler as off (automations-only mode). devintern worker init does not write this setting; add it to workspace.toml yourself.
A one-repo workspace needs no routing rules. With several repositories, each task must match rules that agree on exactly one repo. Tasks that match none, or match rules naming different repos, are recorded as skipped and not run; fix the rules or the task's labels, then edit the task.
| Rule key | Matches |
|---|---|
repo |
Target repository (required) |
project |
Key prefix for PROJ-123 style keys (Jira, Linear) |
labels |
Any of the listed labels |
components |
Any of the listed components |
team |
Limits the rule to one team |
Criteria in one rule are ANDed, and comparisons are case-insensitive. Trackers with numeric ids route by labels or components.
Use [[teams]] when one worker polls separate boards, tracker accounts, or tracker products. Each team has its own query, polling state, and credentials:
[[teams]]
name = "platform"
tracker = "jira"
task_query = "project = PLAT AND labels = devintern"
repo = "api" # every task from this team runs in api
env_file = "env/platform.env"
[[teams]]
name = "growth"
tracker = "linear"
task_query = '{"team":{"key":{"eq":"GROW"}}}'
[teams.env]
LINEAR_API_KEY = "lin_api_..."
[[routing.rules]]
team = "growth"
repo = "web"
labels = ["web"]- A team with
reposends every task to that repository and ignores routing rules. It cannot also have team-scoped rules. - A team without
repouses rules that name it plus rules with noteam. It needs at least one applicable rule in a multi-repo workspace. - Credentials layer as workspace
.env, then the team'senv_file, then[teams.env]. The shared.envcan also hold team-specific values named<TRACKER>_<TEAM>_<SETTING>, for exampleJIRA_PLATFORM_API_TOKEN. The team name is uppercased, and characters other than letters and digits become_. - Once any team exists,
[defaults].task_queryis no longer polled on its own. A workspace with only automations, estimations, or Sentry monitors needs no task query at all. - Connect each team to the relay separately:
devintern worker connect jira --team platform.
Set pipeline_file to a JSON pipeline definition (steps, plugins, and artifacts at the top level; see Customizing the Task Pipeline) for the whole fleet in [defaults], or for one repo in [[repos]]. Relative paths resolve against ~/.devintern, and a leading ~/ expands to your home directory.
[defaults]
pipeline_file = "pipelines/default.json" # fleet-wide
[[repos]]
name = "backend"
remote = "git@github.com:acme/backend.git"
pipeline_file = "pipelines/backend.json" # this repo onlyExactly one pipeline runs per task, chosen in this order: the repo's pipeline_file, [defaults].pipeline_file, then the built-in default. A pipeline block in a repository's .devintern-code/settings.json is not read. Relative plugin and prompt paths in a pipeline_file resolve against that file's directory, so install plugin dependencies there. An invalid pipeline fails the run with the file named. See Customizing the Task Pipeline for steps and plugins.
By default the worker runs one agent job at a time. To run independent jobs in parallel, opt in explicitly:
[workspace.execution]
isolation = "best_effort_host"
max_concurrency = 4 # all agent jobs across the workspace
max_concurrency_per_repo = 1 # task and PR jobs per repositorymax_concurrency_per_repo limits how many jobs run at once on one repository. It covers task runs and PR jobs (review replies and mentions, conflict resolution, CI fixes, base syncs, and auto-merge checks) together, with one exception: one PR job per repository can always start, even while tasks use the whole limit, so PR feedback never waits for a long task. Each PR job runs in its own worktree, so jobs for different PRs on one repository can run in parallel. Jobs on the same PR always run one after another. Automations use the repository's base checkout instead: one automation runs per repository at a time, it does not count against max_concurrency_per_repo, and it runs alongside task and PR jobs. Short PR jobs get free slots before tasks.
Raising either limit above 1 requires isolation = "best_effort_host". This is not an isolation boundary: parallel jobs share the host's ports, processes, Docker daemon, caches, and agent quota, which can cause EADDRINUSE, port conflicts, and lock errors. Every parallel PR worktree also installs its own dependencies, which uses more disk and install time. Use it only for repositories whose tasks tolerate that.
The worker keeps idle PR worktrees for reuse, at most max_concurrency_per_repo (minimum 2) per repository, and removes any that have been unused for 24 hours. Worktrees of running jobs are never removed. Each repository gets its own worktree per branch, so repositories that use the same branch name never share one. Two open PRs from the same head branch in one repository do share a worktree. If both need work at the same moment, the second job is deferred without a PR comment and runs on a later pass.
The generated systemd unit caps the worker's whole cgroup at a share of host RAM, so one heavy job or several concurrent ones cannot exhaust the machine. The defaults are 50% for MemoryHigh (throttling), 65% for MemoryMax (hard cap), and 15% for swap (0 disables swap):
[workspace.execution]
memory_high_percent = 50
memory_max_percent = 65
memory_swap_max_percent = 15The values are percentages of host RAM, resolved when the systemd unit is written. They cover the worker and every process its runs start in the worker's own cgroup. A run with AGENT_SANDBOX=docker is the exception: the agent runs in a guest microVM outside that cgroup, so the hard cap does not bound it, and only the host-level admission check reacts when the host runs low. Changing the percentages takes effect after devintern worker service install rewrites and restarts the service. job_memory_max_percent caps each job inside that budget (default: half of memory_max_percent, below memory_high_percent; 0 turns it off). See Running as a service for the behavior at the cap. macOS launchd agents have no equivalent limit.
Caps how much agent work the worker starts per day, for example to keep an unattended subscription login (Codex with a ChatGPT account, Claude with a Pro or Max plan) inside a daily budget. Both are unset by default, meaning no cap:
[workspace.execution]
max_runs_per_day = 20 # agent jobs started per day
max_agent_minutes_per_day = 480 # total run time per day, in minutes| Setting | What counts |
|---|---|
max_runs_per_day |
Every run the worker starts: task runs, ad-hoc tasks, PR jobs (review replies, mentions, conflict resolution, CI fixes, auto-merge checks), automations, and estimations. A task's verification and auto-review rounds are part of its run and count once. A run deferred by an agent usage limit counts once, when it runs again. |
max_agent_minutes_per_day |
The wall-clock time of those runs, from start to finish, including running ones. |
The day is the worker host's local calendar day, and the counts come from the run history, so a restart keeps them. Runs you start by hand with devintern <TASK> on this machine count too. When a cap is reached, new jobs wait until local midnight; running jobs are never stopped, so the minutes cap can be exceeded by the jobs already running when it is reached. Raising or removing a cap applies as soon as the worker reloads workspace.toml. devintern worker status and the dashboard header show today's usage, and the dashboard Overview shows a banner while a cap holds new work.
Secrets live in one owner-only ~/.devintern/.env: tracker credentials, GITHUB_TOKEN, and agent settings. Each repository can layer more on top, highest last:
- Shared workspace
.env - The repo's
env_file - Inline
[repos.env]values - For team tasks: the team's
<TRACKER>_<TEAM>_<SETTING>values from the shared.env, then itsenv_file, then[teams.env]
Ad-hoc tasks (devintern worker add) and scheduled automations on a repo also get layer 4 when exactly one team is fixed to that repo with repo = "<name>". worker add --team <name> picks the team explicitly, and is required when several teams are fixed to the repo. These runs keep the repo's TASK_TRACKER and GITHUB_REPO, so only the team's credentials apply. Because layer 4 sits above the repo layers, a namespaced team value such as GITHUB_PLATFORM_TOKEN replaces a GITHUB_TOKEN set in the repo's env_file or [repos.env] for that team's runs. An automation on a repo with several fixed teams uses layers 1-3 and logs a warning; set env_file on the [[repos]] entry to choose its credentials.
For GitHub remotes, GITHUB_REPO is filled in from the remote URL. For GitLab remotes on your tracker instance, GITLAB_PROJECT is filled in with the project path (group/sub/repo): gitlab.com remotes while GITLAB_BASE_URL is unset or gitlab.com, and self-managed remotes when their host (or a GITLAB_CODE_HOST_ALIASES alias) matches GITLAB_BASE_URL. A GITHUB_REPO or GITLAB_PROJECT you set in any layer, including a team's, wins over the derived value. Polling and issue search still use the workspace or team GITLAB_PROJECT, so keep a centralized tracker project in the shared .env.
GitHub and GitLab API calls for a repo, and the follow-up runs on its PRs (review feedback, conflict resolution, CI fixes, auto-merge), pick the team the same way, so they use the account that opened the PR. If several teams are fixed to the repo, they use the one with tracker = "github"; with none or several such teams, they use layers 1-3. Artifact upload settings (DEVINTERN_ARTIFACT_*) use the same layers; see upload configuration.
Other trackers have no repo-to-project mapping, so set per-repo keys such as JIRA_DEFAULT_PROJECT_KEY, LINEAR_DEFAULT_TEAM_KEY, ASANA_DEFAULT_PROJECT_GID, AZURE_DEVOPS_PROJECT, or TRELLO_DEFAULT_BOARD_ID in the repo's env_file or [repos.env].
The worker reloads workspace.toml a moment after you save it. Work already running finishes with the old config. Send SIGHUP to force a reload. A broken edit is logged and the last valid config keeps running.
Most settings apply on reload, including repos, routing rules, queries, team repo, automations, estimations, pipelines, concurrency, daily caps, PR follow-up settings, and [notifications]. These need a restart:
- team
name,tracker,env_file, and[teams.env] [[error_monitors]][defaults].trackerand tracker credentials in the workspace.env[worker.schedule][workspace].dashboardanddashboard_port[workspace].mode
A reload that changes a restart-only setting is rejected as a whole.
The memory_high_percent, memory_max_percent, and memory_swap_max_percent settings in [workspace.execution] are accepted on reload but change nothing yet: only devintern worker service install rewrites the systemd unit with the new values (see Memory limits). The per-job cap (job_memory_max_percent) is resolved when the worker starts, so restart the worker to change it.