Merge pull request #1315 from trheyi/main

Enhance message handling in OpenAI adapter to skip non-delta "done" m…
This commit is contained in:
Max 2025-11-17 06:23:12 +08:00 committed by GitHub
commit b7b586b505
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,6 +68,13 @@ func (a *Adapter) Adapt(msg *message.Message) ([]interface{}, error) {
return []interface{}{}, nil // Return empty array, nothing to send return []interface{}{}, nil // Return empty array, nothing to send
} }
// Skip "done" messages that are not delta updates
// These are final confirmation messages for CUI clients
// OpenAI clients don't need them - they use finish_reason instead
if msg.Done && !msg.Delta {
return []interface{}{}, nil // Return empty array, nothing to send
}
// Get converter for this message type // Get converter for this message type
converter, exists := a.registry.GetConverter(msg.Type) converter, exists := a.registry.GetConverter(msg.Type)
if !exists { if !exists {