The best way to control Claude Code, Codex and more from any computer or phone
fix(git): honor project provider settings (#23672)
Co-authored-by: Tejas Parmar <parmartejas@vanojay.in> Co-authored-by: maria-rcks <maria@kuuro.net>
parmartejas committed
Oct 29, 2026 at 23:25 UTC
1e95da77c41968eee9e7fce1f6d29b27a9e39339
3 files changed
+60
-11
apps/mobile/src/features/threads/DraftThreadHeader.tsx
+5
-1
@@ -87,7 +87,11 @@ export function DraftThreadHeader(props: {
87
},
88
onRunAction: async (input) => {
89
if (!canWriteGit || !props.cwd) return null;
90
- const result = await runAction({ ...input, actionId: uuidv4() });
90
+ const result = await runAction({
91
+ ...input,
92
+ projectId: props.project.id,
93
+ actionId: uuidv4(),
94
+ });
95
if (AsyncResult.isFailure(result)) {
96
Dialog.alert("Git action failed", String(Cause.squash(result.cause)));
97
return null;
apps/server/src/git/GitManager.test.ts
+40
-1
@@ -2599,7 +2599,45 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
2599
}),
2600
);
2601
2602
- it.effect("applies a V2-native thread's project settings to generated commit text", () =>
2602
+ it.effect("uses an explicit project's provider settings for generated commit text", () =>
2603
+ Effect.gen(function* () {
2604
+ const repoDir = yield* makeTempDir("t3code-git-manager-");
2605
+ yield* initRepo(repoDir);
2606
+ NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello\nproject\n");
2607
+ const projectId = ProjectId.make("project:git-action-settings");
2608
+ const disabledInstanceId = DEFAULT_SERVER_SETTINGS.textGenerationModelSelection.instanceId;
2609
+ let generatedModelSelection:
2610
+ | TextGeneration.CommitMessageGenerationInput["modelSelection"]
2611
+ | undefined;
2612
+
2613
+ const { manager } = yield* makeManager({
2614
+ serverSettings: {
2615
+ projectSettingsOverrides: {
2616
+ [projectId]: {
2617
+ providerInstances: { [disabledInstanceId]: { enabled: false } },
2618
+ },
2619
+ },
2620
+ },
2621
+ textGeneration: {
2622
+ generateCommitMessage: (input) => {
2623
+ generatedModelSelection = input.modelSelection;
2624
+ return Effect.succeed({ subject: "Use the project writer", body: "" });
2625
+ },
2626
+ },
2627
+ });
2628
+
2629
+ yield* manager.runStackedAction({
2630
+ actionId: "test-project-action-settings",
2631
+ cwd: repoDir,
2632
+ action: "commit",
2633
+ projectId,
2634
+ });
2635
+
2636
+ expect(generatedModelSelection?.instanceId).toBe(ProviderInstanceId.make("claudeAgent"));
2637
+ }),
2638
+ );
2639
+
2640
+ it.effect("prefers a V2-native thread's project settings over an explicit project", () =>
2641
Effect.gen(function* () {
2642
const repoDir = yield* makeTempDir("t3code-git-manager-");
2643
yield* initRepo(repoDir);
@@ -2686,6 +2724,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
2724
cwd: repoDir,
2725
action: "commit",
2726
threadId,
2727
+ projectId: ProjectId.make("project:other"),
2728
});
2729
2730
expect(generatedModelSelection).toEqual(projectModel);
apps/server/src/git/GitManager.ts
+15
-9
@@ -672,19 +672,25 @@ export const make = Effect.gen(function* () {
672
const projectSettingsFor = Effect.fnUntraced(function* (input: {
673
readonly cwd: string;
674
readonly threadId?: ThreadId | undefined;
675
+ readonly projectId?: ProjectId | undefined;
676
}) {
677
const settings = yield* serverSettingsService.getSettings;
678
if (!hasProjectSettingsOverrides(settings))
679
return { settings, projectId: null as ProjectId | null };
679
- const projectId: ProjectId | null = yield* input.threadId !== undefined
680
- ? threads.getThreadShell(input.threadId).pipe(
681
- Effect.map((thread) => thread?.projectId ?? null),
682
- Effect.orElseSucceed(() => null),
683
- )
684
- : projects.findActiveByWorkspaceRoot(input.cwd).pipe(
685
- Effect.map((project) => Option.getOrNull(project)?.projectId ?? null),
686
- Effect.orElseSucceed(() => null),
687
- );
680
+ const threadProjectId =
681
+ input.threadId === undefined
682
+ ? null
683
+ : yield* threads.getThreadShell(input.threadId).pipe(
684
+ Effect.map((thread) => thread?.projectId ?? null),
685
+ Effect.orElseSucceed(() => null),
686
+ );
687
+ const projectId =
688
+ threadProjectId ??
689
+ input.projectId ??
690
+ (yield* projects.findActiveByWorkspaceRoot(input.cwd).pipe(
691
+ Effect.map((project) => Option.getOrNull(project)?.projectId ?? null),
692
+ Effect.orElseSucceed(() => null),
693
+ ));
694
return { settings: resolveProjectSettings(settings, projectId).settings, projectId };
695
});
696
const readThreadContext = Effect.fnUntraced(