Skip to content

feat(projects): per-project defaults for new threads (#1501 G2) - #1503

Merged
currentbits merged 3 commits into
mainfrom
coder/1501-g2-per-project-defaults-2bd6ea
Oct 6, 2026
Merged

currentbits merged 3 commits into
mainfrom
coder/1501-g2-per-project-defaults-2bd6ea

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Item G2 of #1501.

What changed

  • Edit Project gets "New thread defaults": provider, model, effort, permission mode, and an opt-in "Follow last used". Stored as threadDefaults on the project via the existing projects.update, so there's no new IPC channel.
  • Applied in createThread, so every creation path gets them: UI, issue starters, autodispatch and PR checkout. Existing threads are never touched.
  • Precedence, documented on projectDefaultsFor:
    1. Explicit input.
    2. Agent profiles, worker pools and automations. Forks, imports, post-merge, automations and memory passes skip project defaults entirely.
    3. Project defaults.
    4. Global default.
  • Validation:
    • An unknown or uninstalled provider falls back to the global default, with a note in the modal. Remote projects skip the local install check.
    • The model applies only on the provider it was picked for.
    • Effort and permission mode snap to what the provider supports.
  • Last used: only a pick on a thread before its first message counts, recorded in the three IPC setters, so failover, pools and automations never count as user picks.

Verified independently, on main merged with this branch and #1502:

Design call to confirm: an explicit provider at creation still takes the project's effort and permission mode; only the model is tied to the provider.

🤖 Generated with Claude Code

Willem and others added 3 commits October 6, 2026 16:13
Projects can carry threadDefaults (provider, model, reasoning effort,
permission mode, and an opt-in "last used" mode). createThread applies
them below explicit input and above the global settings default. Agent
profiles, worker pools and automations still win: forks, imports,
automations and memory passes skip project defaults outright. An
unknown or uninstalled provider falls back to the global default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Provider, model, effort and permission pickers plus "Follow last used"
in the Edit Project modal, with a note when the chosen provider is not
installed. The section is only sent when touched, so a name-only save
cannot overwrite a last-used update. New threads no longer inherit the
selected thread's provider when the project has its own default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T14:33:00.166429Z 4f8e03d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f8e03d745

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +103 to +106
function providerInstalledFor(project, id) {
if (project && project.remoteHost) return true;
if (id === "simulate") return true;
return isBinAvailable(resolveBin(getProvider(id)));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat WSL projects as cross-boundary provider hosts

For a Windows project whose path is under \\wsl$\..., the provider CLI runs inside WSL and may legitimately be absent from the Windows PATH; runner.js therefore treats wslTarget(project) like an SSH boundary and skips the local binary check. This new predicate exempts only remoteHost, so creating a thread discards an otherwise valid project provider/model and falls back to the global defaults whenever the CLI is installed only inside WSL. Reuse the runner's boundary predicate or also recognize wslTarget(project) here.

Useful? React with 👍 / 👎.

Comment thread src/coder/useCoderRuns.ts
Comment on lines +96 to +100
if (
opts?.inheritProvider !== false &&
inheritFrom &&
!project?.threadDefaults?.provider
) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep automatic inheritance out of last-used tracking

When a project has { lastUsed: true } but no stored provider, this condition still performs the existing automatic inheritance from the selected thread. That call goes through threads:setProvider, whose new handler records every such call as a user pick, so merely creating a thread silently persists the previously selected thread's provider/model as the project defaults. Treat last-used mode as a project default here as well, or provide a way for this automatic setter call to bypass recordLastUsedDefaults.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant