@@ -301,7 +301,7 @@ export class MCPInferencer extends RemoteInferencer implements ICompletions, IGe
301
301
private mcpClients : Map < string , MCPClient > = new Map ( ) ;
302
302
private connectionStatuses : Map < string , IMCPConnectionStatus > = new Map ( ) ;
303
303
private resourceCache : Map < string , IMCPResourceContent > = new Map ( ) ;
304
- private cacheTimeout : number = 300000 ; // 5 minutes
304
+ private cacheTimeout : number = 5000 ;
305
305
private intentAnalyzer : IntentAnalyzer = new IntentAnalyzer ( ) ;
306
306
private resourceScoring : ResourceScoring = new ResourceScoring ( ) ;
307
307
private remixMCPServer ?: any ; // Internal RemixMCPServer instance
@@ -560,7 +560,7 @@ export class MCPInferencer extends RemoteInferencer implements ICompletions, IGe
560
560
561
561
try {
562
562
// Try to get from cache first
563
- let content = this . resourceCache . get ( resource . uri ) ;
563
+ let content = null // this.resourceCache.get(resource.uri);
564
564
if ( ! content ) {
565
565
const client = this . mcpClients . get ( serverName ) ;
566
566
if ( client ) {
@@ -620,15 +620,7 @@ export class MCPInferencer extends RemoteInferencer implements ICompletions, IGe
620
620
continue ;
621
621
}
622
622
623
- let content = this . resourceCache . get ( resource . uri ) ;
624
- if ( ! content ) {
625
- content = await client . readResource ( resource . uri ) ;
626
- this . resourceCache . set ( resource . uri , content ) ;
627
- setTimeout ( ( ) => {
628
- this . resourceCache . delete ( resource . uri ) ;
629
- } , this . cacheTimeout ) ;
630
- }
631
-
623
+ const content = await client . readResource ( resource . uri ) ;
632
624
if ( content . text ) {
633
625
mcpContext += `\n--- Resource: ${ resource . name } (${ resource . uri } ) ---\n` ;
634
626
mcpContext += content . text ;
@@ -661,7 +653,7 @@ export class MCPInferencer extends RemoteInferencer implements ICompletions, IGe
661
653
console . log ( `[MCP Inferencer] Sending request with ${ llmFormattedTools . length } available tools in LLM format` ) ;
662
654
663
655
try {
664
- const response = await super . answer ( prompt , enhancedOptions ) ;
656
+ const response = await super . answer ( enrichedPrompt , enhancedOptions ) ;
665
657
console . log ( 'got initial response' , response )
666
658
667
659
const toolExecutionCallback = async ( tool_calls ) => {
0 commit comments