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:
Stephan Rieche
2025-12-29 23:25:15 +01:00
parent bc0ef47323
commit ec3d78922e
2 changed files with 12 additions and 28 deletions

View File

@@ -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 {