File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,3 +48,6 @@ coverage/
4848
4949# AI
5050.mcp.json
51+
52+ # codingbuddy.config.js
53+ codingbuddy.config.js
Original file line number Diff line number Diff 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
121131const 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 ( ) => {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments