You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
systemPrompt=`You are an elite coding agent with access to VectorCode MCP tools. Solve the task step-by-step. Use tools when needed.
330
+
if(task.targetRepos&&task.targetRepos.length>0){
331
+
constrepos=JSON.stringify(task.targetRepos);
332
+
if(task.targetRepos.length>=3){
333
+
// Cross-repo task: guide the agent to search each repo individually
334
+
systemPrompt=`You are an elite coding agent with access to VectorCode MCP tools. Solve the task step-by-step. Use tools when needed.
335
+
336
+
IMPORTANT — CROSS-REPO SEARCH STRATEGY:
337
+
The task involves ${task.targetRepos.length} repositories: ${repos}.
338
+
When using vec_search, results are merged from ALL repos unless you scope them. To get useful results for each repository:
339
+
340
+
1. Make SEPARATE vec_search calls for EACH repository using the "workspaces" parameter. For example:
341
+
- vec_search({ query: "public API entry point", workspaces: ["thiserror"] })
342
+
- vec_search({ query: "public API entry point", workspaces: ["defu"] })
343
+
- vec_search({ query: "public API entry point", workspaces: ["itsdangerous"] })
344
+
2. After gathering information per-repo, synthesize your findings into a comparison or cross-repo analysis.
345
+
3. Be efficient — you have limited steps. Make parallel calls when independent.
346
+
4. After gathering enough information, STOP exploring and produce your final answer. Do not use all available steps on exploration.`;
347
+
}else{
348
+
systemPrompt=`You are an elite coding agent with access to VectorCode MCP tools. Solve the task step-by-step. Use tools when needed.
332
349
333
-
IMPORTANT: When using vec_search, always pass the "workspaces" parameter with value ${JSON.stringify(task.targetRepos)} to scope your search to the relevant repositories.`;
350
+
IMPORTANT: When using vec_search, always pass the "workspaces" parameter with value ${repos} to scope your search to the relevant repositories.`;
@@ -446,6 +464,21 @@ IMPORTANT: When using vec_search, always pass the "workspaces" parameter with va
446
464
});
447
465
}
448
466
467
+
// If the agent exhausted all steps without producing a final answer,
468
+
// force one more LLM call (without tools) to synthesize findings.
469
+
if(!finalAnswer&&steps>=maxSteps){
470
+
console.log(`[reactLoop] Agent used all ${maxSteps} steps without final answer. Forcing synthesis...`);
471
+
messages.push({
472
+
role: 'user',
473
+
content: [{type: 'text',text: 'You have used all available steps. Stop using tools and synthesize everything you have found into your final answer now.'}]
0 commit comments