feat: merge per-group codex config overlay

This commit is contained in:
Eyejoker
2026-03-23 04:20:55 +09:00
parent f49d0f1732
commit 83d7bf3d51
2 changed files with 90 additions and 0 deletions

View File

@@ -253,6 +253,26 @@ function prepareGroupEnvironment(
fs.copyFileSync(src, dst);
}
}
const groupCodexConfigOverlayPath = path.join(
groupDir,
'.codex',
'config.toml',
);
const sessionCodexConfigPath = path.join(sessionCodexDir, 'config.toml');
if (fs.existsSync(groupCodexConfigOverlayPath)) {
const overlayToml = fs
.readFileSync(groupCodexConfigOverlayPath, 'utf-8')
.trim();
if (overlayToml) {
const baseToml = fs.existsSync(sessionCodexConfigPath)
? fs.readFileSync(sessionCodexConfigPath, 'utf-8').trimEnd()
: '';
const mergedToml = [baseToml, overlayToml]
.filter((value) => value.length > 0)
.join('\n\n');
fs.writeFileSync(sessionCodexConfigPath, mergedToml + '\n');
}
}
const sessionAgentsPath = path.join(sessionCodexDir, 'AGENTS.md');
const codexPlatformPrompt = readPlatformPrompt('codex', projectRoot);
const codexPairedRoomPrompt = isPairedRoom