fix(server): t3_project_read shows the default model saved in Settings #38636
Mergedspiky02plateau(GitHub profile, opens in a new tab)merged 2 commits into
main fromrefs/pull/38636/headmerged by juliusmarminge View on GitHubtanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- @@ -165,3 +166,9 @@165166 yield* readCaller();166167 return yield* Project.ProjectService;167168 });169+170+/** Settings, not the project record, hold the project default model that new threads use. */171+const withSavedDefaultModel = Effect.gen(function* () {172+ const settings = yield* ServerSettings.ServerSettingsService.pipe(173+ Effect.flatMap((service) => service.getSettings),174+ Effect.mapError(unavailable),@@ -165,3 +166,12 @@165166 yield* readCaller();166167 return yield* Project.ProjectService;167168 });169+170+/** Settings, not the project record, hold the project default model that new threads use. */171+const withSavedDefaultModel = Effect.gen(function* () {172+ const settings = yield* ServerSettings.ServerSettingsService.pipe(173+ Effect.flatMap((service) => service.getSettings),174+ Effect.mapError(unavailable),175+ );176+ return (project: ProjectRecord) => {177+ const resolved = resolveProjectSettings(settings, project.id, project);@@ -475,4 +496,4 @@475496 t3_project_update: McpToolAccess.writesEnvironment((input) =>476497 Effect.gen(function* () {477498 const projects = yield* Project.ProjectService;478- return yield* projects499+ const updated = yield* projects@@ -475,6 +496,7 @@475496 t3_project_update: McpToolAccess.writesEnvironment((input) =>476497 Effect.gen(function* () {477498 const projects = yield* Project.ProjectService;478- return yield* projects499+ const updated = yield* projects479500 .update({ ...input, commandId: yield* newCommandId() })480501 .pipe(Effect.mapError(projectFailure));502+ return (yield* withSavedDefaultModel)(updated);
juliusmarminge added labelstakeover:in-progress
Sign in to join this conversation.
Important
Review skipped#
Review was skipped as selected files did not have any reviewable changes.
813022f1-901e-4139-af95-06f3fd402f5dReviewing files that changed from the base of the PR and between 019c481db7d603f61055723e78d525451b1b4475 and f3ce0d440fa05a8a51ce6d3a21af56d45a35cc97.
You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Walkthrough
Project list, read, and update handlers now resolve and return
defaultModelSelectionusing server settings and project records. A new test checks the read result when the project record has no default model and a Settings model override is configured.Changes: Project default model responses
apps/server/src/mcp/toolkits/project/handlers.ts,apps/server/src/mcp/toolkits/project/tools.tsapps/server/src/mcp/toolkits/project/handlers.ts,apps/server/src/mcp/toolkits/project/handlers.test.tsEstimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
defaultModelSelection; the issue’s scripts problem is not addressed.Possibly related PRs
defaultModelSelection, while this PR changes how project handlers report that field.Suggested labels:
bugfixSuggested reviewers:
juliusmarmingeMerge Risk:
Moderate · previous review
019c4The read tools now show the Settings default model, but updating a project's default model through the tool may not take effect or clear it, and unrelated credential read errors can hide project data. Fix the update persistence before merging.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the main change: t3_project_read now shows the default model saved in Settings. The raw summary confirms the handler change and the new test for that behavior. The title is specific and follows the conventional commit format.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The problem is stated with reproduction context, and the change explains reuse of resolveProjectSettings. Scope links related PR
#35452and#14991and explains why no issue exists. Verification gives focused test results, typecheck, lint, and format results, and notes what was not checked (the patched server was not run against the user's install). The template's agent-model line is present at the end.Finishing Touches
Generate unit tests (beta)