fix: sync ~/.claude/.credentials.json to per-group session dirs

Without this, per-group credentials become stale when the home
credentials are refreshed elsewhere, causing 401 auth errors.
This commit is contained in:
Eyejoker
2026-03-11 16:49:09 +09:00
parent b0ef22e702
commit aed051fb96

View File

@@ -62,6 +62,14 @@ function prepareGroupEnvironment(
'.claude',
);
fs.mkdirSync(groupSessionsDir, { recursive: true });
// Sync credentials from user's home ~/.claude/ so per-group sessions stay fresh
const homeClaudeDir = path.join(os.homedir(), '.claude');
const credsSrc = path.join(homeClaudeDir, '.credentials.json');
if (fs.existsSync(credsSrc)) {
fs.copyFileSync(credsSrc, path.join(groupSessionsDir, '.credentials.json'));
}
const settingsFile = path.join(groupSessionsDir, 'settings.json');
if (!fs.existsSync(settingsFile)) {
fs.writeFileSync(