feat: add support for request ID tracking across services
- Implemented request ID handling in various services and handlers to improve traceability of requests. - Added new AuthOptions endpoint to expose WxWork and OIDC configuration options. - Updated message and event logging to include request ID for better debugging. - Enhanced login form to dynamically show available authentication options based on server configuration. - Introduced utility functions for normalizing and ensuring valid request IDs. - Updated tests to verify request ID functionality in message sending and event logging.
This commit is contained in:
@@ -36,7 +36,7 @@ func (s *replyCommitService) SendAIReply(input replyCommitInput) (*models.Messag
|
||||
return nil, nil
|
||||
}
|
||||
commitStartedAt := time.Now()
|
||||
replyMessage, err := svc.MessageService.SendAIMessage(
|
||||
replyMessage, err := svc.MessageService.SendAIMessageWithRequestID(
|
||||
input.Conversation.ID,
|
||||
input.AIAgent.ID,
|
||||
fmt.Sprintf("%s_%d", strings.TrimSpace(input.ClientPrefix), input.Message.ID),
|
||||
@@ -44,6 +44,7 @@ func (s *replyCommitService) SendAIReply(input replyCommitInput) (*models.Messag
|
||||
replyText,
|
||||
"",
|
||||
s.buildAIPrincipal(input.AIAgent),
|
||||
input.Message.RequestID,
|
||||
)
|
||||
if input.Trace != nil {
|
||||
input.Trace.CommitMs = time.Since(commitStartedAt).Milliseconds()
|
||||
|
||||
Reference in New Issue
Block a user