mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
fix: remove prompt caching to enable hot reload of custom prompts
Remove caching from Auto Mode and Agent services to allow custom prompts to take effect immediately without requiring app restart. Changes: - Auto Mode: Load prompts on every feature execution instead of caching - Agent Service: Load prompts on every chat message instead of caching - Remove unused class fields: planningPrompts, agentSystemPrompt This makes custom prompts work consistently across all features: ✓ Auto Mode - hot reload enabled ✓ Agent Runner - hot reload enabled ✓ Backlog Plan - already had hot reload ✓ Enhancement - already had hot reload Users can now modify prompts in Settings and see changes immediately without restarting the app. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,7 +76,6 @@ export class AgentService {
|
||||
private metadataFile: string;
|
||||
private events: EventEmitter;
|
||||
private settingsService: SettingsService | null = null;
|
||||
private agentSystemPrompt: string | null = null;
|
||||
|
||||
constructor(dataDir: string, events: EventEmitter, settingsService?: SettingsService) {
|
||||
this.stateDir = path.join(dataDir, 'agent-sessions');
|
||||
@@ -784,12 +783,9 @@ export class AgentService {
|
||||
}
|
||||
|
||||
private async getSystemPrompt(): Promise<string> {
|
||||
// Load from settings if not already cached
|
||||
if (!this.agentSystemPrompt) {
|
||||
const prompts = await getPromptCustomization(this.settingsService, '[AgentService]');
|
||||
this.agentSystemPrompt = prompts.agent.systemPrompt;
|
||||
}
|
||||
return this.agentSystemPrompt;
|
||||
// Load from settings (no caching - allows hot reload of custom prompts)
|
||||
const prompts = await getPromptCustomization(this.settingsService, '[AgentService]');
|
||||
return prompts.agent.systemPrompt;
|
||||
}
|
||||
|
||||
private generateId(): string {
|
||||
|
||||
Reference in New Issue
Block a user