Merge pull request #1447 from trheyi/main

Refactor context ID generation to use UUID
This commit is contained in:
Max 2026-02-02 18:15:11 +08:00 committed by GitHub
commit 7da36965c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,7 @@ import (
"fmt"
"sync"
"github.com/google/uuid"
"github.com/yaoapp/yao/agent/memory"
"github.com/yaoapp/yao/agent/output/message"
"github.com/yaoapp/yao/config"
@ -410,12 +411,12 @@ func SendInterrupt(contextID string, signal *InterruptSignal) error {
// generateContextID generates a unique context ID
func generateContextID() string {
return message.GenerateNanoID()
return uuid.New().String()
}
// RequestID returns a unique request ID using NanoID
func (ctx *Context) RequestID() string {
return message.GenerateNanoID()
return ctx.ID
}
// TraceID returns the trace ID for the context