The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 07:45 UTC
feat(web): add pull request merge defaults (#8088)
Bilal Bakr committed
Sep 8, 2026 at 10:37 UTC
7d9aaf6a7eb22d5e85b0e3b21686cc437fe68576
9 files changed
+219
-21
apps/desktop/src/settings/DesktopClientSettings.test.ts
+1
@@ -64,6 +64,7 @@ const clientSettings: ClientSettings = {
64
legacySidebarEnabled: false,
65
loadBalancingEnabled: false,
66
loadBalancingWeights: { "environment-1": 75, "environment-2": 0 },
67
+ pullRequestMergeMethodOverrides: {},
68
timestampFormat: "24-hour",
69
wordWrap: true,
70
};
apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
+65
-20
@@ -53,14 +53,21 @@ import {
53
54
import { type DraftId, useComposerDraftStore } from "~/composerDraftStore";
55
import { useNewThreadHandler } from "~/hooks/useHandleNewThread";
56
+import { useClientSettings } from "~/hooks/useSettings";
57
import { useCopyToClipboard, writeTextToClipboard } from "~/hooks/useCopyToClipboard";
58
+import {
59
+ deriveLogicalProjectKeyFromSettings,
60
+ derivePhysicalProjectKey,
61
+ selectProjectGroupingSettings,
62
+} from "~/logicalProject";
63
import { changeRequestRepositoryUrl, gitHubPullRequestBrowserUrl } from "~/lib/openPullRequestLink";
64
import { usePreparePullRequestThreadAction } from "~/lib/sourceControlActions";
65
import { cn } from "~/lib/utils";
66
import { readLocalApi } from "~/localApi";
67
import type { ReviewCommentContext } from "~/reviewCommentContext";
68
+import { buildPhysicalToLogicalProjectKeyMap } from "~/sidebarProjectGrouping";
69
import { useProjects } from "~/state/entities";
63
-import { useEnvironments } from "~/state/environments";
70
+import { useEnvironments, usePrimaryEnvironmentId } from "~/state/environments";
71
import { useEnvironmentQuery } from "~/state/query";
72
import { useLiveRefresh } from "~/hooks/useLiveRefresh";
73
import {
@@ -71,6 +78,7 @@ import {
78
import { useAtomCommand } from "~/state/use-atom-command";
79
import { vcsEnvironment } from "~/state/vcs";
80
import { formatRelativeTimeLabel } from "~/timestampFormat";
81
+import { useUiStateStore } from "~/uiStateStore";
82
83
import {
84
AlertDialog,
@@ -124,11 +132,13 @@ import {
132
pullRequestCheckoutCommand,
133
pullRequestFindingKey,
134
pullRequestHandoffLabels,
135
+ PULL_REQUEST_MERGE_METHOD_LABELS,
136
readableFailure,
137
readPullRequestDetailSnapshot,
138
resolveDisplayedPullRequestDetail,
139
resolvePullRequestPrimaryControl,
140
resolveBaseFreshness,
141
+ resolvePullRequestMergeMethod,
142
type PullRequestFinding,
143
shouldRefreshPullRequestActivity,
144
writePullRequestDetailSnapshot,
@@ -168,12 +178,6 @@ const ACTION_SUCCESS_LABELS: Record<PullRequestAction, string> = {
178
"approve-workflows": "Workflows approved",
179
};
180
171
-const MERGE_METHOD_LABELS: Record<PullRequestMergeMethod, string> = {
172
- merge: "Merge",
173
- squash: "Squash",
174
- rebase: "Rebase",
175
-};
176
-
181
/** Said as the thing that did not happen, rather than as the operation that returned an error. */
182
const ACTION_FAILURE_LABELS: Record<PullRequestAction, string> = {
183
merge: "Could not merge this pull request",
@@ -553,12 +557,16 @@ export function PullRequestDetailPanel({
557
compensationRef.current = null;
558
if (scroller) scroller.scrollTop = Math.max(0, scroller.scrollTop + delta);
559
}, [condensed]);
560
+ const lastSelectedMergeMethod = useUiStateStore((state) => state.pullRequestMergeMethod);
561
+ const setLastSelectedMergeMethod = useUiStateStore((state) => state.setPullRequestMergeMethod);
562
+ const mergeMethodOverrides = useClientSettings(
563
+ (settings) => settings.pullRequestMergeMethodOverrides,
564
+ );
565
+ const projectGroupingSettings = useClientSettings(selectProjectGroupingSettings);
566
const [mergeMethodSelection, setMergeMethodSelection] = useState<{
567
readonly pullRequestKey: string;
568
readonly method: PullRequestMergeMethod;
559
- }>(() => ({ pullRequestKey, method: "merge" }));
560
- const mergeMethod =
561
- mergeMethodSelection.pullRequestKey === pullRequestKey ? mergeMethodSelection.method : "merge";
569
+ } | null>(null);
570
const setMergeMethod = (method: PullRequestMergeMethod) => {
571
setMergeMethodSelection({ pullRequestKey, method });
572
};
@@ -763,6 +771,7 @@ export function PullRequestDetailPanel({
771
const [titleSaving, setTitleSaving] = useState(false);
772
const newThread = useNewThreadHandler();
773
const { environments } = useEnvironments();
774
+ const primaryEnvironmentId = usePrimaryEnvironmentId();
775
const projects = useProjects();
776
const unavailableGitHubUrl = useMemo(() => {
777
const identity = projects.find(
@@ -770,6 +779,30 @@ export function PullRequestDetailPanel({
779
)?.repositoryIdentity;
780
return gitHubPullRequestBrowserUrl(identity, reference.repository, reference.number);
781
}, [environmentId, projects, reference.number, reference.projectId, reference.repository]);
782
+ // Project settings store the override under the sidebar group's key, which a duplicate row
783
+ // borrows from its siblings, so the project alone does not always name the same key.
784
+ const projectDefaultMergeMethod = useMemo(() => {
785
+ const project = projects.find(
786
+ (candidate) =>
787
+ candidate.environmentId === environmentId && candidate.id === reference.projectId,
788
+ );
789
+ if (!project) return undefined;
790
+ const projectKey =
791
+ buildPhysicalToLogicalProjectKeyMap({
792
+ projects,
793
+ settings: projectGroupingSettings,
794
+ primaryEnvironmentId,
795
+ }).get(derivePhysicalProjectKey(project)) ??
796
+ deriveLogicalProjectKeyFromSettings(project, projectGroupingSettings);
797
+ return mergeMethodOverrides[projectKey];
798
+ }, [
799
+ environmentId,
800
+ mergeMethodOverrides,
801
+ primaryEnvironmentId,
802
+ projectGroupingSettings,
803
+ projects,
804
+ reference.projectId,
805
+ ]);
806
// Beside a thread there is nothing to pick: the hand-offs land in that thread's composer, and
807
// the thread is already on one server's copy of the branch.
808
const pickableEnvironments = useMemo(
@@ -1234,10 +1267,15 @@ export function PullRequestDetailPanel({
1267
const allowedMergeMethods = detail
1268
? detail.capabilities.mergeMethods.filter((method) => detail.mergeCapabilities[method])
1269
: [];
1237
- const selectedMergeMethod = allowedMergeMethods.includes(mergeMethod)
1238
- ? mergeMethod
1239
- : (allowedMergeMethods[0] ?? "merge");
1240
- const selectedMergeMethodLabel = MERGE_METHOD_LABELS[selectedMergeMethod];
1270
+ const currentMergeMethod =
1271
+ mergeMethodSelection?.pullRequestKey === pullRequestKey ? mergeMethodSelection.method : null;
1272
+ const selectedMergeMethod = resolvePullRequestMergeMethod(
1273
+ allowedMergeMethods,
1274
+ currentMergeMethod,
1275
+ projectDefaultMergeMethod,
1276
+ lastSelectedMergeMethod,
1277
+ );
1278
+ const selectedMergeMethodLabel = PULL_REQUEST_MERGE_METHOD_LABELS[selectedMergeMethod];
1279
const pendingAutoMergeLabel = `Auto-merge (${selectedMergeMethodLabel.toLowerCase()})`;
1280
const conflicting = detail?.state === "open" && detail.mergeability === "conflicting";
1281
// Only an outright yes arms it. A host that reports nothing has not said the merge is already
@@ -1245,7 +1283,7 @@ export function PullRequestDetailPanel({
1283
const autoMergeArmed = detail?.state === "open" && detail.autoMergeEnabled === true;
1284
const armedMergeMethod = detail?.autoMergeMethod;
1285
const armedAutoMergeLabel = armedMergeMethod
1248
- ? `Auto-merge (${MERGE_METHOD_LABELS[armedMergeMethod].toLowerCase()})`
1286
+ ? `Auto-merge (${PULL_REQUEST_MERGE_METHOD_LABELS[armedMergeMethod].toLowerCase()})`
1287
: "Auto-merge";
1288
const workflowApprovalsRequired =
1289
detail?.state === "open" ? (detail.workflowApprovalsRequired ?? 0) : 0;
@@ -1783,17 +1821,24 @@ export function PullRequestDetailPanel({
1821
) : null}
1822
<MenuRadioGroup
1823
value={selectedMergeMethod}
1786
- onValueChange={(method) =>
1787
- setMergeMethod(method as PullRequestMergeMethod)
1788
- }
1824
+ onValueChange={(method) => {
1825
+ const selectedMethod = method as PullRequestMergeMethod;
1826
+ setMergeMethod(selectedMethod);
1827
+ setLastSelectedMergeMethod(selectedMethod);
1828
+ }}
1829
>
1830
{allowedMergeMethods.map((method) => (
1791
- <MenuRadioItem key={method} value={method} disabled={actionPending}>
1831
+ <MenuRadioItem
1832
+ key={method}
1833
+ value={method}
1834
+ disabled={actionPending}
1835
+ closeOnClick
1836
+ >
1837
{/* The radio item lays its children out as one block, so the
1838
icon and the label need their own row to share a line. */}
1839
<span className="flex min-w-0 items-center gap-2">
1840
<GitMergeIcon className="size-3.5" />
1796
- <span>{MERGE_METHOD_LABELS[method]}</span>
1841
+ <span>{PULL_REQUEST_MERGE_METHOD_LABELS[method]}</span>
1842
</span>
1843
</MenuRadioItem>
1844
))}
apps/web/src/components/pullRequest/pullRequestDetail.logic.test.ts
+16
@@ -37,6 +37,7 @@ import {
37
resolvePullRequestPrimaryControl,
38
shouldRefreshPullRequestActivity,
39
resolveBaseFreshness,
40
+ resolvePullRequestMergeMethod,
41
buildPullRequestTimeline,
42
editPullRequestThreadComment,
43
writePullRequestDetailSnapshot,
@@ -85,6 +86,21 @@ const TIMELINE_SOURCE: Pick<
86
closedAt: null,
87
};
88
89
+describe("pull request merge method", () => {
90
+ it("uses the current choice, then the project default, then the last choice", () => {
91
+ expect(
92
+ resolvePullRequestMergeMethod(["merge", "squash", "rebase"], null, "squash", "rebase"),
93
+ ).toBe("squash");
94
+ expect(
95
+ resolvePullRequestMergeMethod(["merge", "squash", "rebase"], "rebase", "squash", "merge"),
96
+ ).toBe("rebase");
97
+ expect(resolvePullRequestMergeMethod(["merge", "rebase"], null, "squash", "rebase")).toBe(
98
+ "rebase",
99
+ );
100
+ expect(resolvePullRequestMergeMethod(["squash"], null, "merge", "rebase")).toBe("squash");
101
+ });
102
+});
103
+
104
describe("pull request activity refresh", () => {
105
const first = {
106
key: "project:acme/web#7",
apps/web/src/components/pullRequest/pullRequestDetail.logic.ts
+19
@@ -11,6 +11,7 @@ import {
11
type PullRequestCommit,
12
type PullRequestDetailView,
13
type PullRequestMergeability,
14
+ type PullRequestMergeMethod,
15
type PullRequestReaction,
16
type PullRequestReviewThread,
17
type PullRequestState,
@@ -21,6 +22,24 @@ import {
22
23
import { inferReviewCommentFenceLanguage, type ReviewCommentContext } from "~/reviewCommentContext";
24
25
+export const PULL_REQUEST_MERGE_METHOD_LABELS: Record<PullRequestMergeMethod, string> = {
26
+ merge: "Merge",
27
+ squash: "Squash and merge",
28
+ rebase: "Rebase and merge",
29
+};
30
+
31
+export function resolvePullRequestMergeMethod(
32
+ allowed: ReadonlyArray<PullRequestMergeMethod>,
33
+ current: PullRequestMergeMethod | null,
34
+ projectDefault: PullRequestMergeMethod | undefined,
35
+ lastSelected: PullRequestMergeMethod,
36
+): PullRequestMergeMethod {
37
+ for (const method of [current, projectDefault, lastSelected]) {
38
+ if (method && allowed.includes(method)) return method;
39
+ }
40
+ return allowed[0] ?? "merge";
41
+}
42
+
43
const safeShellArgument = /^[A-Za-z0-9._/@+=,-]+$/;
44
const bitbucketRepositoryName = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
45
apps/web/src/components/settings/ProjectSettingsPanel.tsx
+51
@@ -21,6 +21,7 @@ import {
21
type ResolvedKeybindingsConfig,
22
type ServerSettings,
23
type ProviderDriverKind,
24
+ type PullRequestMergeMethod,
25
type SidebarProjectGroupingMode,
26
type T3ProjectFileScript,
27
type ThreadEnvMode,
@@ -79,6 +80,7 @@ import { useAtomCommand } from "../../state/use-atom-command";
80
import { ProviderModelPicker } from "../chat/ProviderModelPicker";
81
import { TraitsPicker } from "../chat/TraitsPicker";
82
import { ProjectFavicon } from "../ProjectFavicon";
83
+import { PULL_REQUEST_MERGE_METHOD_LABELS } from "../pullRequest/pullRequestDetail.logic";
84
import {
85
EMPTY_PROJECT_SCRIPT_INPUT,
86
editorRequestForScript,
@@ -480,6 +482,19 @@ function ProjectDetail({
482
setBooleanOverride("projectAgentBrowserAccessOverrides", enabled);
483
const deleteProject = useAtomCommand(projectEnvironment.delete, { reportFailure: false });
484
const projectNameEditedRef = useRef(false);
485
+ const mergeMethodOverrides = useClientSettings(
486
+ (settings) => settings.pullRequestMergeMethodOverrides,
487
+ );
488
+ const projectMergeMethod = mergeMethodOverrides[group.projectKey];
489
+ const setProjectMergeMethod = (method: PullRequestMergeMethod | null) => {
490
+ const nextOverrides = { ...mergeMethodOverrides };
491
+ if (method === null) {
492
+ delete nextOverrides[group.projectKey];
493
+ } else {
494
+ nextOverrides[group.projectKey] = method;
495
+ }
496
+ updateClientSettings({ pullRequestMergeMethodOverrides: nextOverrides });
497
+ };
498
499
const faviconPath = representative.faviconPath ?? null;
500
const projectIcon = representative.projectIcon ?? null;
@@ -983,6 +998,42 @@ function ProjectDetail({
998
</div>
999
}
1000
/>
1001
+ <SettingsRow
1002
+ title="Default merge method"
1003
+ description="Pull requests in this project start with this method. It overrides the last method selected."
1004
+ resetAction={
1005
+ projectMergeMethod !== undefined ? (
1006
+ <SettingResetButton
1007
+ label="project merge method"
1008
+ onClick={() => setProjectMergeMethod(null)}
1009
+ />
1010
+ ) : null
1011
+ }
1012
+ control={
1013
+ <Select
1014
+ value={projectMergeMethod ?? "inherit"}
1015
+ onValueChange={(value) =>
1016
+ setProjectMergeMethod(
1017
+ value === "inherit" ? null : (value as PullRequestMergeMethod),
1018
+ )
1019
+ }
1020
+ >
1021
+ <SelectTrigger aria-label="Default pull request merge method">
1022
+ <SelectValue>
1023
+ {projectMergeMethod === undefined
1024
+ ? "Last selected"
1025
+ : PULL_REQUEST_MERGE_METHOD_LABELS[projectMergeMethod]}
1026
+ </SelectValue>
1027
+ </SelectTrigger>
1028
+ <SelectPopup align="end" alignItemWithTrigger={false}>
1029
+ <SelectItem value="inherit">Last selected</SelectItem>
1030
+ <SelectItem value="merge">{PULL_REQUEST_MERGE_METHOD_LABELS.merge}</SelectItem>
1031
+ <SelectItem value="squash">{PULL_REQUEST_MERGE_METHOD_LABELS.squash}</SelectItem>
1032
+ <SelectItem value="rebase">{PULL_REQUEST_MERGE_METHOD_LABELS.rebase}</SelectItem>
1033
+ </SelectPopup>
1034
+ </Select>
1035
+ }
1036
+ />
1037
<SettingsRow
1038
title="Model"
1039
status={
apps/web/src/uiStateStore.test.ts
+15
@@ -26,6 +26,7 @@ function makeUiState(overrides: Partial<UiState> = {}): UiState {
26
threadLastVisitedAtById: {},
27
threadChangedFilesExpandedById: {},
28
defaultAdvertisedEndpointKey: null,
29
+ pullRequestMergeMethod: "merge",
30
...overrides,
31
};
32
}
@@ -158,6 +159,18 @@ describe("uiStateStore pure functions", () => {
159
});
160
161
describe("parsePersistedState", () => {
162
+ it("hydrates the last selected pull request merge method", () => {
163
+ const parsed = parsePersistedState({
164
+ pullRequestMergeMethod: "squash",
165
+ });
166
+ const invalid = parsePersistedState({
167
+ pullRequestMergeMethod: "fast-forward",
168
+ });
169
+
170
+ expect(parsed.pullRequestMergeMethod).toBe("squash");
171
+ expect(invalid.pullRequestMergeMethod).toBe("merge");
172
+ });
173
+
174
it("hydrates raw UI-owned state without server entities", () => {
175
const parsed = parsePersistedState({
176
projectExpandedById: {
@@ -189,6 +202,7 @@ describe("parsePersistedState", () => {
202
},
203
defaultAdvertisedEndpointKey: "desktop-core:lan:http",
204
sidebarProjectScopeKey: null,
205
+ pullRequestMergeMethod: "merge",
206
threadChangedFilesExpandedById: {
207
"environment:thread-1": {
208
"turn-1": false,
@@ -317,6 +331,7 @@ describe("uiStateStore persistence", () => {
331
"turn-2": true,
332
},
333
},
334
+ pullRequestMergeMethod: "merge",
335
});
336
expect(parsePersistedState(persisted)).toEqual({
337
...state,
apps/web/src/uiStateStore.ts
+25
-1
@@ -1,4 +1,5 @@
1
import { Debouncer } from "@tanstack/react-pacer";
2
+import type { PullRequestMergeMethod } from "@t3tools/contracts";
3
import { create } from "zustand";
4
import { normalizeProjectPathForComparison } from "./lib/projectPaths";
5
@@ -29,6 +30,7 @@ export interface PersistedUiState {
30
sidebarProjectScopeKey?: string | null;
31
threadChangedFilesExpansionVersion?: number;
32
threadChangedFilesExpandedById?: Record<string, Record<string, boolean>>;
33
+ pullRequestMergeMethod?: string;
34
}
35
36
export interface UiProjectState {
@@ -49,7 +51,12 @@ export interface UiEndpointState {
51
defaultAdvertisedEndpointKey: string | null;
52
}
53
52
-export interface UiState extends UiProjectState, UiThreadState, UiEndpointState {}
54
+export interface UiPullRequestState {
55
+ pullRequestMergeMethod: PullRequestMergeMethod;
56
+}
57
+
58
+export interface UiState
59
+ extends UiProjectState, UiThreadState, UiEndpointState, UiPullRequestState {}
60
61
const initialState: UiState = {
62
projectExpandedById: {},
@@ -58,6 +65,7 @@ const initialState: UiState = {
65
threadLastVisitedAtById: {},
66
threadChangedFilesExpandedById: {},
67
defaultAdvertisedEndpointKey: null,
68
+ pullRequestMergeMethod: "merge",
69
};
70
71
const LEGACY_PROJECT_CWD_PREFERENCE_PREFIX = "legacy-project-cwd:";
@@ -109,6 +117,10 @@ function sanitizeTimestampRecord(value: unknown): Record<string, string> {
117
);
118
}
119
120
+function isPullRequestMergeMethod(value: unknown): value is PullRequestMergeMethod {
121
+ return value === "merge" || value === "squash" || value === "rebase";
122
+}
123
+
124
export function parsePersistedState(parsed: PersistedUiState): UiState {
125
const projectExpandedById =
126
parsed.projectExpandedById === undefined
@@ -143,6 +155,9 @@ export function parsePersistedState(parsed: PersistedUiState): UiState {
155
: {},
156
defaultAdvertisedEndpointKey: sanitizeOptionalKey(parsed.defaultAdvertisedEndpointKey),
157
sidebarProjectScopeKey: sanitizeOptionalKey(parsed.sidebarProjectScopeKey),
158
+ pullRequestMergeMethod: isPullRequestMergeMethod(parsed.pullRequestMergeMethod)
159
+ ? parsed.pullRequestMergeMethod
160
+ : initialState.pullRequestMergeMethod,
161
};
162
}
163
@@ -216,6 +231,7 @@ export function persistState(state: UiState): void {
231
sidebarProjectScopeKey: state.sidebarProjectScopeKey,
232
threadChangedFilesExpansionVersion: THREAD_CHANGED_FILES_EXPANSION_VERSION,
233
threadChangedFilesExpandedById: state.threadChangedFilesExpandedById,
234
+ pullRequestMergeMethod: state.pullRequestMergeMethod,
235
} satisfies PersistedUiState),
236
);
237
if (!legacyKeysCleanedUp) {
@@ -324,6 +340,12 @@ export function setSidebarProjectScopeKey(state: UiState, projectKey: string | n
340
};
341
}
342
343
+function setPullRequestMergeMethod(state: UiState, method: PullRequestMergeMethod): UiState {
344
+ return state.pullRequestMergeMethod === method
345
+ ? state
346
+ : { ...state, pullRequestMergeMethod: method };
347
+}
348
+
349
export function resolveProjectExpanded(
350
projectExpandedById: Readonly<Record<string, boolean>>,
351
preferenceKeys: readonly string[],
@@ -407,6 +429,7 @@ interface UiStateStore extends UiState {
429
setThreadChangedFilesExpanded: (threadId: string, turnId: string, expanded: boolean) => void;
430
setDefaultAdvertisedEndpointKey: (key: string | null) => void;
431
setSidebarProjectScopeKey: (projectKey: string | null) => void;
432
+ setPullRequestMergeMethod: (method: PullRequestMergeMethod) => void;
433
setProjectExpanded: (projectIds: string | readonly string[], expanded: boolean) => void;
434
reorderProjects: (
435
currentProjectOrder: readonly string[],
@@ -427,6 +450,7 @@ export const useUiStateStore = create<UiStateStore>((set) => ({
450
set((state) => setDefaultAdvertisedEndpointKey(state, key)),
451
setSidebarProjectScopeKey: (projectKey) =>
452
set((state) => setSidebarProjectScopeKey(state, projectKey)),
453
+ setPullRequestMergeMethod: (method) => set((state) => setPullRequestMergeMethod(state, method)),
454
setProjectExpanded: (projectIds, expanded) =>
455
set((state) => setProjectExpanded(state, projectIds, expanded)),
456
reorderProjects: (currentProjectOrder, draggedProjectIds, targetProjectIds) =>
packages/contracts/src/settings.test.ts
+19
@@ -455,6 +455,25 @@ describe("ServerSettings thread settlement", () => {
455
});
456
});
457
458
+describe("ClientSettings pull request merge methods", () => {
459
+ it("defaults to no project overrides and accepts supported methods", () => {
460
+ expect(decodeClientSettings({}).pullRequestMergeMethodOverrides).toEqual({});
461
+ expect(
462
+ decodeClientSettingsPatch({
463
+ pullRequestMergeMethodOverrides: { project: "squash" },
464
+ }).pullRequestMergeMethodOverrides,
465
+ ).toEqual({ project: "squash" });
466
+ });
467
+
468
+ it("rejects unsupported project merge methods", () => {
469
+ expect(() =>
470
+ decodeClientSettingsPatch({
471
+ pullRequestMergeMethodOverrides: { project: "fast-forward" },
472
+ }),
473
+ ).toThrow();
474
+ });
475
+});
476
+
477
describe("ServerSettings.providerInstances (slice-2 invariant)", () => {
478
it("defaults text generation to Luna at low reasoning effort", () => {
479
expect(DEFAULT_SERVER_SETTINGS.textGenerationModelSelection).toEqual({
packages/contracts/src/settings.ts
+8
@@ -32,6 +32,7 @@ import {
32
ProviderInstanceId,
33
type ProviderDriverKind,
34
} from "./providerInstance.ts";
35
+import { PullRequestMergeMethod } from "./pullRequest.ts";
36
37
// ── Client Settings (local-only) ───────────────────────────────
38
@@ -391,6 +392,10 @@ export const ClientSettingsSchema = Schema.Struct({
392
modelOrder: Schema.Array(Schema.String).pipe(Schema.withDecodingDefault(Effect.succeed([]))),
393
}),
394
).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
395
+ pullRequestMergeMethodOverrides: Schema.Record(
396
+ TrimmedNonEmptyString,
397
+ PullRequestMergeMethod,
398
+ ).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
399
// Legacy plan mode. The composer's Build/Plan toggle was removed from the
400
// default UI; this beta flag restores it (plus the /plan and /default slash
401
// commands) for users who still rely on the old workflow.
@@ -1341,6 +1346,9 @@ export const ClientSettingsPatch = Schema.Struct({
1346
}),
1347
),
1348
),
1349
+ pullRequestMergeMethodOverrides: Schema.optionalKey(
1350
+ Schema.Record(TrimmedNonEmptyString, PullRequestMergeMethod),
1351
+ ),
1352
planModeEnabled: Schema.optionalKey(Schema.Boolean),
1353
contextWindowMeterEnabled: Schema.optionalKey(Schema.Boolean),
1354
composerCollapseOnScroll: Schema.optionalKey(Schema.Boolean),