(state *AgentState)
| 211 | state.Messages = append(state.Messages, q.CoreEngine.skillRegistryMessage(*skill, *execution.Prompt)) |
| 212 | } |
| 213 | q.recordSkillInvocation(*skill, execution, state.TurnCount) |
| 214 | } |
| 215 | q.commitUserTurn(state, normalizedPrompt) |
| 216 | for event := range q.CoreEngine.QueryLoop(ctx, state) { |
| 217 | sendStream(ctx, out, event) |
| 218 | } |
| 219 | }() |
| 220 | return out |
| 221 | } |
| 222 | |
| 223 | func (q *QueryEngine) buildOrRefreshSystemPrompt(state *AgentState) { |
| 224 | if state == nil { |
| 225 | return |
| 226 | } |
| 227 | cfg := q.Config |
| 228 | cfg.CWD = skills.ResolveSkillContextCWD(q.Config.CWD, nil) |
| 229 | memorySection := "" |
| 230 | if q.Config.LongTermMemoryEnabled { |
| 231 | memorySection = agentContext.BuildMemorySection(&q.Config) |
no test coverage detected