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:
mlogclub
2026-05-27 22:18:43 +08:00
parent 498932de61
commit c246b85a9e
30 changed files with 504 additions and 59 deletions
@@ -18,3 +18,8 @@ type LoginResponse struct {
Permissions []string `json:"permissions"`
Roles []string `json:"roles"`
}
type AuthOptionsResponse struct {
WxWorkEnabled bool `json:"wxworkEnabled"`
OIDCEnabled bool `json:"oidcEnabled"`
}
@@ -5,6 +5,7 @@ import "cs-agent/internal/pkg/enums"
type MessageResponse struct {
ID int64 `json:"id"`
ConversationID int64 `json:"conversationId"`
RequestID string `json:"requestId,omitempty"`
ClientMsgID string `json:"clientMsgId,omitempty"`
SenderType enums.IMSenderType `json:"senderType"`
SenderID int64 `json:"senderId"`
@@ -44,6 +44,7 @@ type AgentRunLogResponse struct {
ID int64 `json:"id"`
ConversationID int64 `json:"conversationId"`
MessageID int64 `json:"messageId"`
RequestID string `json:"requestId"`
AIAgentID int64 `json:"aiAgentId"`
AIConfigID int64 `json:"aiConfigId"`
UserMessage string `json:"userMessage"`