You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Per-project default environment for new threads
#16173
I connect a remote environment and add the same repository on my local machine and on the remote. Project grouping merges the two checkouts into one sidebar project.
For some projects, I always want to run threads on the remote. Today I must pick the remote each time I start a new thread. There is no setting to make the remote the default for one project.
Current behavior in the source:
buildProjectGroups picks the member on the primary (local) environment as the group representative (packages/client-runtime/src/state/projectGrouping.ts).
The "New thread in…" palette uses that representative when no thread from the group is active (buildSidebarProjectPickerEntries in apps/web/src/sidebarProjectGrouping.ts).
The legacy sidebar shows an environment menu for each new thread in a grouped project.
defaultThreadEnvMode only selects local or worktree mode. It does not select the machine.
Current workarounds have costs:
"Remove checkout" on the local copy deletes its threads.
Turning off grouping shows each repository twice.
Proposed solution
Add a per-project preferred environment setting:
Store it next to sidebarProjectGroupingOverrides, keyed by the logical project key. The value is an EnvironmentId.
Add a "Default environment" select in project settings. Show it only when the group has members on more than one environment. The default value is "Primary environment", which keeps today's behavior.
Use the setting when the app resolves the target member for a new thread: the sidebar button, Cmd+N with no active thread, the "New thread in…" palette, and the legacy sidebar menu (preselect it, or skip the menu).
If the preferred environment is disconnected, fall back to the primary environment and show the environment in the composer.
The active-thread rule stays the same. A new thread from an open thread still uses that thread's environment.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Area
apps/web, packages/client-runtime, packages/contracts
Problem or use case
I connect a remote environment and add the same repository on my local machine and on the remote. Project grouping merges the two checkouts into one sidebar project.
For some projects, I always want to run threads on the remote. Today I must pick the remote each time I start a new thread. There is no setting to make the remote the default for one project.
Current behavior in the source:
buildProjectGroupspicks the member on the primary (local) environment as the group representative (packages/client-runtime/src/state/projectGrouping.ts).buildSidebarProjectPickerEntriesinapps/web/src/sidebarProjectGrouping.ts).defaultThreadEnvModeonly selects local or worktree mode. It does not select the machine.Current workarounds have costs:
Proposed solution
Add a per-project preferred environment setting:
sidebarProjectGroupingOverrides, keyed by the logical project key. The value is anEnvironmentId.The active-thread rule stays the same. A new thread from an open thread still uses that thread's environment.
All reactions