Skip to content

Commit a8895af

Browse files
wishket-pjwJeremyDev87
authored andcommitted
fix: Reload config in suggest_config_updates and update gitignore
- Reload config from disk before comparing in suggest_config_updates - Ignore codingbuddy.config.js in git - Add reload mock and test verification
1 parent 2c35e77 commit a8895af

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ coverage/
4848

4949
# AI
5050
.mcp.json
51+
52+
# codingbuddy.config.js
53+
codingbuddy.config.js

apps/mcp-server/src/mcp/mcp.service.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ const createMockConfigService = (
116116
getSettings: vi.fn().mockResolvedValue(config),
117117
getLanguage: vi.fn().mockResolvedValue(config.language),
118118
getFormattedContext: vi.fn().mockResolvedValue(''),
119+
reload: vi.fn().mockResolvedValue({
120+
settings: config,
121+
ignorePatterns: ['node_modules', '.git'],
122+
contextFiles: [],
123+
sources: {
124+
config: '/test/codingbuddy.config.js',
125+
ignore: null,
126+
context: null,
127+
},
128+
} as ProjectConfig),
119129
});
120130

121131
const createMockConfigDiffService = (): Partial<ConfigDiffService> => ({
@@ -302,6 +312,9 @@ describe('McpService', () => {
302312
const parsedContent = JSON.parse(result.content[0].text);
303313
expect(parsedContent).toHaveProperty('isUpToDate');
304314
expect(parsedContent).toHaveProperty('suggestions');
315+
316+
// Verify reload is called to get fresh config
317+
expect(mockConfigService.reload).toHaveBeenCalledTimes(1);
305318
});
306319

307320
it('should include language setting in parse_mode response', async () => {

apps/mcp-server/src/mcp/mcp.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ export class McpService implements OnModuleInit {
351351
// Analyze project
352352
const analysis = await this.analyzerService.analyzeProject(projectRoot);
353353

354+
// Reload config from disk to get latest changes
355+
await this.configService.reload();
356+
354357
// Get current config
355358
const currentConfig = await this.configService.getSettings();
356359

0 commit comments

Comments
 (0)