Merge pull request #85 from phj1081/codex/owner/ejclaw

This commit is contained in:
Eyejoker
2026-04-28 22:03:53 +09:00
committed by GitHub
2 changed files with 29 additions and 27 deletions

View File

@@ -72,10 +72,6 @@
"maxFunctionLines": 277,
"owner": "codex warmup test hotspot"
},
"src/config/load-config.ts": {
"maxFunctionLines": 187,
"owner": "config loading hotspot"
},
"src/db/base-schema.ts": {
"maxFunctionLines": 436,
"owner": "db schema hotspot"

View File

@@ -135,6 +135,34 @@ function assertNoLegacyEnvAliasesConfigured(): void {
);
}
function buildPathsConfig(
projectRoot: string,
homeDir: string,
): AppConfig['paths'] {
return {
projectRoot,
homeDir,
senderAllowlistPath: path.join(
homeDir,
'.config',
'ejclaw',
'sender-allowlist.json',
),
storeDir: path.resolve(
readNonEmptyText('EJCLAW_STORE_DIR') ?? path.join(projectRoot, 'store'),
),
groupsDir: path.resolve(
readNonEmptyText('EJCLAW_GROUPS_DIR') ?? path.join(projectRoot, 'groups'),
),
dataDir: path.resolve(
readNonEmptyText('EJCLAW_DATA_DIR') ?? path.join(projectRoot, 'data'),
),
cacheDir: path.resolve(
readNonEmptyText('EJCLAW_CACHE_DIR') ?? path.join(projectRoot, 'cache'),
),
};
}
export function loadConfig(): AppConfig {
assertNoLegacyEnvAliasesConfigured();
@@ -176,29 +204,7 @@ export function loadConfig(): AppConfig {
codexMainId: codexMainServiceId,
codexReviewId: codexReviewServiceId,
},
paths: {
projectRoot,
homeDir,
senderAllowlistPath: path.join(
homeDir,
'.config',
'ejclaw',
'sender-allowlist.json',
),
storeDir: path.resolve(
readNonEmptyText('EJCLAW_STORE_DIR') ?? path.join(projectRoot, 'store'),
),
groupsDir: path.resolve(
readNonEmptyText('EJCLAW_GROUPS_DIR') ??
path.join(projectRoot, 'groups'),
),
dataDir: path.resolve(
readNonEmptyText('EJCLAW_DATA_DIR') ?? path.join(projectRoot, 'data'),
),
cacheDir: path.resolve(
readNonEmptyText('EJCLAW_CACHE_DIR') ?? path.join(projectRoot, 'cache'),
),
},
paths: buildPathsConfig(projectRoot, homeDir),
runtime: {
pollInterval: 2000,
schedulerPollInterval: 60000,