@@ -1539,6 +1539,44 @@ func handleDeleteMCPServerFrame(ctx context.Context, frame MessageFrame, runtime
15391539 return MessageFrame {Type : FrameTypeAck , Action : FrameActionDeleteMCPServer , RequestID : frame .RequestID , Payload : map [string ]any {"deleted" : true , "id" : input .ID }}
15401540}
15411541
1542+ // handleUserQuestionAnswerFrame 处理 gateway.user_question_answer 请求。
1543+ func handleUserQuestionAnswerFrame (ctx context.Context , frame MessageFrame , runtimePort RuntimePort ) MessageFrame {
1544+ if runtimePort == nil {
1545+ return runtimePortUnavailableFrame (frame )
1546+ }
1547+ subjectID , subjectErr := requireAuthenticatedSubjectID (ctx )
1548+ if subjectErr != nil {
1549+ return errorFrame (frame , subjectErr )
1550+ }
1551+
1552+ input , err := decodeUserQuestionAnswerPayload (frame .Payload )
1553+ if err != nil {
1554+ return errorFrame (frame , NewFrameError (ErrorCodeInvalidAction , "invalid user_question_answer payload" ))
1555+ }
1556+ input .SubjectID = subjectID
1557+ input .RequestID = strings .TrimSpace (input .RequestID )
1558+ if input .RequestID == "" {
1559+ return errorFrame (frame , NewMissingRequiredFieldError ("payload.request_id" ))
1560+ }
1561+
1562+ callCtx , cancel := withRuntimeOperationTimeout (ctx )
1563+ defer cancel ()
1564+ if err := runtimePort .ResolveUserQuestion (callCtx , input ); err != nil {
1565+ return runtimeCallFailedFrame (callCtx , frame , err , "user_question_answer" )
1566+ }
1567+
1568+ return MessageFrame {
1569+ Type : FrameTypeAck ,
1570+ Action : FrameActionUserQuestionAnswer ,
1571+ RequestID : frame .RequestID ,
1572+ Payload : map [string ]any {
1573+ "request_id" : input .RequestID ,
1574+ "status" : input .Status ,
1575+ "message" : "user question answered" ,
1576+ },
1577+ }
1578+ }
1579+
15421580// handleResolvePermissionFrame 处理 gateway.resolvePermission 请求。
15431581func handleResolvePermissionFrame (ctx context.Context , frame MessageFrame , runtimePort RuntimePort ) MessageFrame {
15441582 if runtimePort == nil {
0 commit comments