Self-Hosted Routing for Monorepos

Hey @Troy_Gibb,
There’s a quick reframe here that should unblock you: self-hosted routing isn’t environment-based at all. Environments only configure Cursor-managed cloud VMs. Self-hosted worker pools route purely on labels. Every request carries an auto-derived repo=<owner/repo> (from each worker’s git remote) plus an optional pool=<name>.

For a monorepo that’s actually the good news. Since all your fleets check out the same repo, they all carry the same repo= label, so the repo alone can’t tell them apart. The thing that distinguishes them is the pool name.

1. Give each fleet its own pool name with --pool-name (or CURSOR_WORKER_POOL_NAME in the helm chart / pod env):

agent worker --pool --pool-name k8s-general start
agent worker --pool --pool-name ios-minis start
agent worker --pool --pool-name k8s-general-dev start
agent worker --pool --pool-name ios-minis-dev start

2. Pick the fleet at trigger time with pool=<name>:

  • Slack: @Cursor pool=ios-minis <prompt>
  • Linear: put pool=ios-minis in the text of the triggering @Cursor comment. It’s read only from that comment, not from the issue description and not from issue/project labels. That’s an intentional boundary so a preset label can’t silently reroute someone else’s run onto your infrastructure.

3. One thing to watch on a monorepo: if you opt into self-hosted without a pool= (for example just self_hosted=true), the run only needs to match repo=, so any of your pools serving that repo can claim it. An iOS job could land on the k8s pool. On a shared-repo setup, always name the pool.

Full reference: Pool names and Triggering pool agents.

The piece that isn’t there yet is routing to the right pool without typing pool= every time (a repo or team-level default, or inferring the pool from a Linear label or assignment). That’s exactly the ask in the thread you linked, so it’s worth keeping that conversation consolidated there where it carries the most weight with our team.

If you paste your agent worker command and a sample Slack/Linear trigger, I’m happy to sanity-check the exact setup.