Skip to content

Respect the per-repo override for the model selection - #6001

Merged
intentionally-left-nil merged 3 commits into
mainfrom
feat/respect-per-repo-models
Sep 9, 2026
Merged

intentionally-left-nil merged 3 commits into
mainfrom
feat/respect-per-repo-models

Conversation

@intentionally-left-nil

@intentionally-left-nil intentionally-left-nil commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

If the user has chosen a different model for a github repository, switch out the model once the repository is known

The initial inference to determine the repository and other setup still uses the users default model for their integration

Summary

Note: I decided explicitly against wiring this into the UI for the New Cloud Agent session. That modal almost always prefers the user's most recent model (unless it's their first experience). I didn't want to create confusion about user expectations (should it always switch away, what happens if the user overrides it etc), so the simplest thing was to leave this alone for now. Instead the scenarios affected are:

  1. Starting a bot conversation from a GitHub mention — apps/web/src/lib/bot/agent-runner.ts:211 calls resolveBotModelSlug(integration) to pick the model for the whole conversation, before any specific repo is chosen.
  2. Spawning a cloud agent session once a repo is picked within that bot conversation — apps/web/src/lib/bot/tools/spawn-cloud-agent-session.ts:197-206. Here a per-repository override (if configured) takes precedence over this installation-level default.
  3. Clicking "fix this review" from a PR review comment — apps/web/src/app/cloud-agent-fork/review/[reviewId]/route.ts:91-101, which resolves the model for the agent session created to address the review, falling back through repo override → installation default → hardcoded DEFAULT_BOT_MODEL.

Verification

Testing this locally isn't easy, since it's realistically triggered from an @mention and not e.g. the new cloud agent page. That tab always has the user's last model as the sticky one, and I don't want to change it. So, unit tests only for now

If the user has chosen a different model for a github repository,
switch out the model once the repository is known

The initial inference to determine the repository and other setup still uses the users default
model for their integration
@kilo-code-bot

kilo-code-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • apps/web/src/app/cloud-agent-fork/review/[reviewId]/route.ts
  • apps/web/src/lib/bot/tools/spawn-cloud-agent-session.ts
  • apps/web/src/lib/bot/tools/spawn-cloud-agent-session.test.ts
Previous Review Summary (commit 43ae937)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 43ae937)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (10 files)
  • apps/web/src/app/cloud-agent-fork/review/[reviewId]/route.ts
  • apps/web/src/app/cloud-agent-fork/review/[reviewId]/route.test.ts
  • apps/web/src/lib/bot/tools/spawn-cloud-agent-session.ts
  • apps/web/src/lib/bot/tools/spawn-cloud-agent-session.test.ts
  • apps/web/src/lib/integrations/core/types.ts
  • apps/web/src/lib/integrations/core/types.test.ts
  • apps/web/src/lib/integrations/db/platform-integrations.ts
  • apps/web/src/lib/integrations/db/platform-integrations.test.ts
  • apps/web/src/lib/integrations/github-repository-settings.ts
  • apps/web/src/lib/integrations/github-repository-settings.test.ts

Reviewed by grok-4.6 · Input: 101K · Output: 6.1K · Cached: 290.9K

Review guidance: REVIEW.md from base branch main

Comment thread apps/web/src/lib/bot/tools/spawn-cloud-agent-session.ts Outdated
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.

2 participants