mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
refactor: enhance context loading strategy in AgentService and AutoModeService
- Updated both services to conditionally load CLAUDE.md based on the autoLoadClaudeMd setting, preventing duplication. - Improved clarity in comments regarding the loading process of context files. - Ensured consistent retrieval of the autoLoadClaudeMd setting across different methods.
This commit is contained in:
@@ -198,11 +198,14 @@ export class AgentService {
|
||||
);
|
||||
|
||||
// Load project context files (CLAUDE.md, CODE_QUALITY.md, etc.)
|
||||
// Note: When autoLoadClaudeMd is enabled, SDK handles CLAUDE.md loading via settingSources
|
||||
const { formattedPrompt: contextFilesPrompt } = await loadContextFiles({
|
||||
projectPath: effectiveWorkDir,
|
||||
fsModule: secureFs as Parameters<typeof loadContextFiles>[0]['fsModule'],
|
||||
});
|
||||
// Note: When autoLoadClaudeMd is enabled, skip loading CLAUDE.md here since SDK handles it
|
||||
// to avoid duplication. The SDK's settingSources will load CLAUDE.md from standard locations.
|
||||
const { formattedPrompt: contextFilesPrompt } = autoLoadClaudeMd
|
||||
? { formattedPrompt: '' }
|
||||
: await loadContextFiles({
|
||||
projectPath: effectiveWorkDir,
|
||||
fsModule: secureFs as Parameters<typeof loadContextFiles>[0]['fsModule'],
|
||||
});
|
||||
|
||||
// Build combined system prompt with base prompt and context files
|
||||
const baseSystemPrompt = this.getSystemPrompt();
|
||||
|
||||
Reference in New Issue
Block a user