fix: refresh stale agent-runner source cache on code changes
Closes #1361 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -191,8 +191,17 @@ function buildVolumeMounts(
|
|||||||
group.folder,
|
group.folder,
|
||||||
'agent-runner-src',
|
'agent-runner-src',
|
||||||
);
|
);
|
||||||
if (!fs.existsSync(groupAgentRunnerDir) && fs.existsSync(agentRunnerSrc)) {
|
if (fs.existsSync(agentRunnerSrc)) {
|
||||||
fs.cpSync(agentRunnerSrc, groupAgentRunnerDir, { recursive: true });
|
const srcIndex = path.join(agentRunnerSrc, 'index.ts');
|
||||||
|
const cachedIndex = path.join(groupAgentRunnerDir, 'index.ts');
|
||||||
|
const needsCopy =
|
||||||
|
!fs.existsSync(groupAgentRunnerDir) ||
|
||||||
|
!fs.existsSync(cachedIndex) ||
|
||||||
|
(fs.existsSync(srcIndex) &&
|
||||||
|
fs.statSync(srcIndex).mtimeMs > fs.statSync(cachedIndex).mtimeMs);
|
||||||
|
if (needsCopy) {
|
||||||
|
fs.cpSync(agentRunnerSrc, groupAgentRunnerDir, { recursive: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mounts.push({
|
mounts.push({
|
||||||
hostPath: groupAgentRunnerDir,
|
hostPath: groupAgentRunnerDir,
|
||||||
|
|||||||
Reference in New Issue
Block a user