We have a prepared multi-repo Cloud Agent environment containing our default repository plus several additional repositories.
When starting a Cloud Agent from Linear, Cursor does not use this prepared environment. Instead, it creates a new unnamed environment containing only the default repository.
I deleted the automatically created environment to rule out a stale environment association. On the next run from Linear, Cursor simply created another new single-repo environment rather than selecting the existing multi-repo environment.
The documentation says:
Cursor resolves environment configuration by repository or repo group, using the first match:
.cursor/environment.json in the repository
A personal saved environment
A team saved environment
Our prepared environment is a saved multi-repo environment. This makes me wonder how repo-group resolution is supposed to work for agents delegated from Linear.
It appears that Linear delegation resolves the target as a single repository. Cursor then seems to look for an environment matching that single-repo configuration rather than selecting the existing multi-repo environment that contains the target repository.
Questions:
Is a Linear-triggered Cloud Agent expected to use an existing multi-repo environment when the target repository is part of that environment’s repo group?
If so, how should the repo group be configured so Cursor resolves the prepared environment?
If not, is there a way to tell the Linear integration which saved environment/repo group to use?
Is .cursor/environment.json relevant to this? The documentation doesn’t appear to show a way to specify a multi-repo repo group there.
Currently, Linear-triggered agents don’t have access to the additional repositories required for our tasks, despite an existing prepared multi-repo environment containing them
Hey @Thomas_Akesson, thanks for the detailed report, and you have read the situation correctly.
Right now, assigning a Linear issue directly to Cursor always resolves to a single repository (the repo= hint, a repo label, or your Default Repository) and then uses or creates a single-repo environment for that repository. It does not look at saved multi-repo environments, and the “repo group” resolution in the docs only applies when the launch itself specifies that group of repos (the web dashboard, the API with repos, or an Automation). So there is currently no setting on the Linear integration to pick a saved environment, and .cursor/environment.json cannot declare additional repositories either. Your 20-repo environment is fine as configured; the direct-assign path just cannot reach it yet. This is on our radar and tracked as a feature request, and I’ve added your report to it.
The way to get multi-repo runs from Linear today is a Cursor Automation with a Linear trigger:
One small heads-up: you have two environments both named the same (an older 14-repo one and the newer 20-repo one). If you ever select environments by name, for example through the API, please give them distinct names so the right one is picked.