Fix Persona source index routing

This commit is contained in:
Meta Vens 2026-07-11 13:58:57 +01:00
commit 25be0251aa
4 changed files with 38 additions and 19 deletions

View file

@ -134,24 +134,23 @@ async function runWorker() {
}
try {
const child =
process.platform === "win32"
? spawn(
"cmd.exe",
["/d", "/s", "/c", "npm.cmd", "run", "rag:index-sources", "--", "--repo", args.repoName],
{
cwd: voidbotRoot,
windowsHide: true,
env: process.env,
stdio: ["ignore", "pipe", "pipe"],
},
)
: spawn("npm", ["run", "rag:index-sources", "--", "--repo", args.repoName], {
cwd: voidbotRoot,
windowsHide: true,
env: process.env,
stdio: ["ignore", "pipe", "pipe"],
});
const tsxCliPath = join(voidbotRoot, "node_modules", "tsx", "dist", "cli.mjs");
if (!(await pathExists(tsxCliPath))) {
throw new Error(
`VoidBot's repo-local tsx runtime is missing at ${tsxCliPath}; run npm ci in ${voidbotRoot} before retrying source indexing.`,
);
}
const child = spawn(
process.execPath,
[tsxCliPath, join(voidbotRoot, "scripts", "index-source-repos.ts"), "--repo", args.repoName],
{
cwd: voidbotRoot,
windowsHide: true,
env: process.env,
stdio: ["ignore", "pipe", "pipe"],
},
);
child.stdout.on("data", (chunk) => {
process.stdout.write(chunk);

View file

@ -12,6 +12,7 @@ import {
ContextBuilder,
createStateStorage,
ensureRepoFaceInitialized,
getRepoFaceSourceRepoName,
getRepoDiscordIdentityAllowedChannelIds,
faceRegistryAsRepoDiscordRegistry,
projectRepoFaceSleepCycleForNow,
@ -3187,12 +3188,15 @@ async function renderRepoFaceCuriosityGraphFacts(
try {
const retrieval = createRepoFaceCuriosityRetrievalService(config);
const nodesById = new Map<string, RepoFaceCuriosityNode>();
const sourceRepoName = getRepoFaceSourceRepoName(identity);
for (const seed of seedQueries) {
const [historyResults, sourceResults, homeSourceResults] = await Promise.all([
retrieval.searchHistory(seed.query, 8),
retrieval.searchRepositorySources(seed.query, 8),
retrieval.searchRepositorySources(seed.query, 6, { repoName: identity.repoName }),
sourceRepoName
? retrieval.searchRepositorySources(seed.query, 6, { repoName: sourceRepoName })
: Promise.resolve([]),
]);
for (const result of [...historyResults, ...sourceResults, ...homeSourceResults]) {
const id = `${result.sourceKind}:${result.chunkId}`;