Skip to content

Commit 713a821

Browse files
committed
refactor: move suppressWarnings to session-aware default
Per PR feedback, suppressWarnings is now a session-level setting instead of a per-tool parameter. This reduces tool schema surface area and aligns with the session-aware architecture. Changes: - Add suppressWarnings to SessionDefaults type and session_set_defaults - Remove suppressWarnings from all individual build/test tool schemas - Update build-utils.ts to read from sessionStore - Update tests to reflect the new session-based approach
1 parent b4a382c commit 713a821

23 files changed

+25
-77
lines changed

src/mcp/tools/device/__tests__/build_device.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ describe('build_device plugin', () => {
3737
expect(schema.safeParse({ projectPath: '/path/to/MyProject.xcodeproj' }).success).toBe(false);
3838

3939
const schemaKeys = Object.keys(buildDevice.schema).sort();
40-
expect(schemaKeys).toEqual([
41-
'derivedDataPath',
42-
'extraArgs',
43-
'preferXcodebuild',
44-
'suppressWarnings',
45-
]);
40+
expect(schemaKeys).toEqual(['derivedDataPath', 'extraArgs', 'preferXcodebuild']);
4641
});
4742
});
4843

src/mcp/tools/device/__tests__/test_device.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ describe('test_device plugin', () => {
5252
'extraArgs',
5353
'platform',
5454
'preferXcodebuild',
55-
'suppressWarnings',
5655
'testRunnerEnv',
5756
]);
5857
});

src/mcp/tools/device/build_device.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ const baseSchemaObject = z.object({
2525
derivedDataPath: z.string().optional().describe('Path to derived data directory'),
2626
extraArgs: z.array(z.string()).optional().describe('Additional arguments to pass to xcodebuild'),
2727
preferXcodebuild: z.boolean().optional().describe('Prefer xcodebuild over faster alternatives'),
28-
suppressWarnings: z
29-
.boolean()
30-
.optional()
31-
.describe('If true, suppresses warning messages from build output to reduce context usage'),
3228
});
3329

3430
const baseSchema = z.preprocess(nullifyEmptyStrings, baseSchemaObject);

src/mcp/tools/device/test_device.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ const baseSchemaObject = z.object({
4747
.describe(
4848
'Environment variables to pass to the test runner (TEST_RUNNER_ prefix added automatically)',
4949
),
50-
suppressWarnings: z
51-
.boolean()
52-
.optional()
53-
.describe('If true, suppresses warning messages from build output to reduce context usage'),
5450
});
5551

5652
const baseSchema = z.preprocess(nullifyEmptyStrings, baseSchemaObject);
@@ -225,7 +221,6 @@ export async function testDeviceLogic(
225221
configuration: params.configuration ?? 'Debug',
226222
derivedDataPath: params.derivedDataPath,
227223
extraArgs,
228-
suppressWarnings: params.suppressWarnings,
229224
},
230225
{
231226
platform: (params.platform as XcodePlatform) || XcodePlatform.iOS,

src/mcp/tools/macos/__tests__/build_macos.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ describe('build_macos plugin', () => {
4646
expect(schema.safeParse({ preferXcodebuild: 'yes' }).success).toBe(false);
4747

4848
const schemaKeys = Object.keys(buildMacOS.schema).sort();
49-
expect(schemaKeys).toEqual(
50-
['derivedDataPath', 'extraArgs', 'preferXcodebuild', 'suppressWarnings'].sort(),
51-
);
49+
expect(schemaKeys).toEqual(['derivedDataPath', 'extraArgs', 'preferXcodebuild'].sort());
5250
});
5351
});
5452

src/mcp/tools/macos/__tests__/build_run_macos.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ describe('build_run_macos', () => {
3939
expect(schema.safeParse({ preferXcodebuild: 'yes' }).success).toBe(false);
4040

4141
const schemaKeys = Object.keys(tool.schema).sort();
42-
expect(schemaKeys).toEqual(
43-
['derivedDataPath', 'extraArgs', 'preferXcodebuild', 'suppressWarnings'].sort(),
44-
);
42+
expect(schemaKeys).toEqual(['derivedDataPath', 'extraArgs', 'preferXcodebuild'].sort());
4543
});
4644
});
4745

src/mcp/tools/macos/__tests__/test_macos.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,7 @@ describe('test_macos plugin (unified)', () => {
4747

4848
const schemaKeys = Object.keys(testMacos.schema).sort();
4949
expect(schemaKeys).toEqual(
50-
[
51-
'derivedDataPath',
52-
'extraArgs',
53-
'preferXcodebuild',
54-
'suppressWarnings',
55-
'testRunnerEnv',
56-
].sort(),
50+
['derivedDataPath', 'extraArgs', 'preferXcodebuild', 'testRunnerEnv'].sort(),
5751
);
5852
});
5953
});

src/mcp/tools/macos/build_macos.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ const baseSchemaObject = z.object({
4646
.boolean()
4747
.optional()
4848
.describe('If true, prefers xcodebuild over the experimental incremental build system'),
49-
suppressWarnings: z
50-
.boolean()
51-
.optional()
52-
.describe('If true, suppresses warning messages from build output to reduce context usage'),
5349
});
5450

5551
const baseSchema = z.preprocess(nullifyEmptyStrings, baseSchemaObject);

src/mcp/tools/macos/build_run_macos.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ const baseSchemaObject = z.object({
3737
.boolean()
3838
.optional()
3939
.describe('If true, prefers xcodebuild over the experimental incremental build system'),
40-
suppressWarnings: z
41-
.boolean()
42-
.optional()
43-
.describe('If true, suppresses warning messages from build output to reduce context usage'),
4440
});
4541

4642
const baseSchema = z.preprocess(nullifyEmptyStrings, baseSchemaObject);

src/mcp/tools/macos/test_macos.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ const baseSchemaObject = z.object({
4848
.describe(
4949
'Environment variables to pass to the test runner (TEST_RUNNER_ prefix added automatically)',
5050
),
51-
suppressWarnings: z
52-
.boolean()
53-
.optional()
54-
.describe('If true, suppresses warning messages from build output to reduce context usage'),
5551
});
5652

5753
const baseSchema = z.preprocess(nullifyEmptyStrings, baseSchemaObject);
@@ -268,7 +264,6 @@ export async function testMacosLogic(
268264
configuration: params.configuration ?? 'Debug',
269265
derivedDataPath: params.derivedDataPath,
270266
extraArgs,
271-
suppressWarnings: params.suppressWarnings,
272267
},
273268
{
274269
platform: XcodePlatform.macOS,

0 commit comments

Comments
 (0)