| 228 | cfg.CWD = skills.ResolveSkillContextCWD(q.Config.CWD, nil) |
| 229 | memorySection := "" |
| 230 | if q.Config.LongTermMemoryEnabled { |
| 231 | memorySection = agentContext.BuildMemorySection(&q.Config) |
| 232 | } |
| 233 | if prompt, err := agentContext.BuildSystemPromptWithConfig(cfg, memorySection); err == nil && strings.TrimSpace(prompt) != "" { |
| 234 | state.SystemPrompt = appendHarnessSystemPrompt(prompt, cfg.HarnessMode) |
| 235 | return |
| 236 | } |
| 237 | state.SystemPrompt = appendHarnessSystemPrompt(BuildSystemPrompt(cfg.CWD), cfg.HarnessMode) |