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
v1.87.0, I found that host.promiseQueue causes the cache to miss, resulting in repeated requests.
// repomap-test.genai.mjsscript({title: "generate repomap for the repo",model: "openai:deepseek-chat",cache: "repomap-test",files: ["src/greeter.ts","src/counting.py"],})letprompts=[`summarize the file in one sentence.`]asyncfunctionprocessFile(current_file,prompts){letresult=[];for(constpromptofprompts){const{ text }=awaitrunPrompt((_)=>{_.def("FILE",current_file);_.$`=============`;_.$`${prompt}`;},{system: [],cache: "repomap-test"});result.push(text);}console.log(result)}// this does not hit "src/counting.py" cacheconstqueue=host.promiseQueue(2)constsummaries=awaitqueue.mapAll(env.files,(file)=>processFile(file,prompts))// // this work fine// for (const file of env.files) {// await processFile(file, prompts)// }
The text was updated successfully, but these errors were encountered:
The issue described is that host.promiseQueue is causing cache misses and repeated requests. This is likely due to the fact that the queue is not respecting the cache settings applied individually within each processFile call.
To resolve this, you should ensure that each call to runPrompt within processFile respected the cache options provided. This means that if a specific file's result is already cached under "repomap-test", it shouldn't be re-run for that file in a separate queue task. Instead, you might want to manually check the cache before running the prompt and only proceed if the result is not found.
Additionally, consider using host.promiseQueue options or passing additional context to ensure that each task within the queue respects its own caching settings correctly. This would prevent unnecessary reprocessing of files that have already been cached.
v1.87.0, I found that
host.promiseQueue
causes the cache to miss, resulting in repeated requests.The text was updated successfully, but these errors were encountered: