Skip to content

Commit 1564f50

Browse files
authored
Merge pull request #1402 from trheyi/main
Enhance Message Filtering in LLM Context Conversion
2 parents 1b4036d + 4d1b427 commit 1564f50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

agent/assistant/history.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ func (ast *Assistant) convertStoreMessageToContext(msg *storetypes.Message) *age
161161
return nil
162162
}
163163

164+
// Skip internal message types that should not be included in LLM context
165+
// These types are for UI/internal use only and can confuse the LLM
166+
// Note: "error" is kept so LLM can help troubleshoot issues
167+
switch msg.Type {
168+
case "tool_call", "loading", "action", "event":
169+
return nil
170+
}
171+
164172
// Extract content from Props
165173
content := ast.extractContentFromProps(msg.Props, msg.Type)
166174
if content == nil {

0 commit comments

Comments
 (0)