The best way to control Claude Code, Codex and more from any computer or phone
fix(web): label inherited worktree cleanup modes correctly (#23678)
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Victor Vogel committed
Oct 30, 2026 at 15:56 UTC
13f9bc4e5575c6101e263282c21174f8d42448f3
2 files changed
+34
-1
apps/web/src/components/settings/SettingInheritance.test.ts
+30
@@ -7,6 +7,36 @@ import { settingInheritanceLayers } from "./SettingInheritance";
7
const environmentId = EnvironmentId.make("laptop");
8
const projectId = ProjectId.make("project");
9
10
+describe("worktree cleanup inheritance", () => {
11
+ it("distinguishes project and environment worktree cleanup policies", () => {
12
+ const settings = {
13
+ ...DEFAULT_SERVER_SETTINGS,
14
+ worktreeCleanup: {
15
+ mode: "custom" as const,
16
+ rules: DEFAULT_SERVER_SETTINGS.storageCleanup,
17
+ },
18
+ projectSettingsOverrides: {
19
+ [projectId]: { worktreeCleanup: { mode: "off" as const } },
20
+ },
21
+ };
22
+ const layers = settingInheritanceLayers(
23
+ {
24
+ environmentId,
25
+ label: "Laptop",
26
+ projectId,
27
+ ...resolveProjectSettings(settings, projectId),
28
+ },
29
+ settings,
30
+ "worktreeCleanup",
31
+ );
32
+ expect(layers.map((layer) => [layer.key, layer.value, layer.effective])).toEqual([
33
+ ["project", "Off", true],
34
+ ["environment", "Custom", false],
35
+ ["built-in", "Not set", false],
36
+ ]);
37
+ });
38
+});
39
+
40
describe("settingInheritanceLayers", () => {
41
it("identifies the background activity profile supplied by each layer", () => {
42
const settings = {
apps/web/src/components/settings/SettingInheritance.tsx
+4
-1
@@ -87,7 +87,10 @@ function formatValue(key: keyof ServerSettings, value: unknown): string {
87
}
88
if ("model" in value && typeof value.model === "string") return value.model;
89
if ("mode" in value && typeof value.mode === "string") {
90
- return WRITING_STYLE_LABELS[value.mode] ?? value.mode;
90
+ if (key === "worktreeCleanup") return value.mode === "off" ? "Off" : "Custom";
91
+ return key === "sourceControlWritingStyle"
92
+ ? (WRITING_STYLE_LABELS[value.mode] ?? value.mode)
93
+ : value.mode;
94
}
95
}
96
return "Custom";