@@ -560,12 +560,13 @@ describe('AgentRuntime', () => {
560560 } ) ;
561561
562562 describe ( 'loadAgent' , ( ) => {
563- it ( 'should return agent definition from metadata service' , async ( ) => {
563+ it ( 'should return agent definition from metadata service (legacy name resolves via alias) ' , async ( ) => {
564564 ( metadataService . get as any ) . mockResolvedValue ( DATA_CHAT_AGENT ) ;
565565 const agent = await runtime . loadAgent ( 'data_chat' ) ;
566566
567- expect ( metadataService . get ) . toHaveBeenCalledWith ( 'agent' , 'data_chat' ) ;
568- expect ( agent ?. name ) . toBe ( 'data_chat' ) ;
567+ // Path A: `data_chat` is an alias for the renamed `ask` agent.
568+ expect ( metadataService . get ) . toHaveBeenCalledWith ( 'agent' , 'ask' ) ;
569+ expect ( agent ?. name ) . toBe ( 'ask' ) ;
569570 expect ( agent ?. role ) . toBe ( 'Business Application Assistant' ) ;
570571 } ) ;
571572
@@ -717,7 +718,7 @@ describe('AgentRuntime', () => {
717718 ] ) ;
718719 const agents = await runtime . listAgents ( ) ;
719720 expect ( agents ) . toHaveLength ( 2 ) ;
720- expect ( agents [ 0 ] ) . toEqual ( { name : 'data_chat ' , label : 'Assistant' , role : 'Business Application Assistant' } ) ;
721+ expect ( agents [ 0 ] ) . toEqual ( { name : 'ask ' , label : 'Assistant' , role : 'Business Application Assistant' } ) ;
721722 expect ( agents [ 1 ] ) . toEqual ( { name : 'metadata_assistant' , label : 'Metadata Assistant' , role : 'Schema Architect' } ) ;
722723 } ) ;
723724
@@ -728,7 +729,7 @@ describe('AgentRuntime', () => {
728729 ] ) ;
729730 const agents = await runtime . listAgents ( ) ;
730731 expect ( agents ) . toHaveLength ( 1 ) ;
731- expect ( agents [ 0 ] . name ) . toBe ( 'data_chat ' ) ;
732+ expect ( agents [ 0 ] . name ) . toBe ( 'ask ' ) ;
732733 } ) ;
733734
734735 it ( 'should return empty array when no agents registered' , async ( ) => {
@@ -744,7 +745,7 @@ describe('AgentRuntime', () => {
744745 ] ) ;
745746 const agents = await runtime . listAgents ( ) ;
746747 expect ( agents ) . toHaveLength ( 1 ) ;
747- expect ( agents [ 0 ] . name ) . toBe ( 'data_chat ' ) ;
748+ expect ( agents [ 0 ] . name ) . toBe ( 'ask ' ) ;
748749 } ) ;
749750 } ) ;
750751} ) ;
@@ -765,7 +766,8 @@ describe('Agent Routes', () => {
765766 aiService = new AIService ( { adapter, logger : silentLogger , toolRegistry : registry } ) ;
766767 metadataService = createMockMetadataService ( {
767768 get : vi . fn ( async ( _type , name ) => {
768- if ( name === 'data_chat' ) return DATA_CHAT_AGENT ;
769+ // Canonical name after Path A rename; `data_chat` resolves here via alias.
770+ if ( name === 'ask' ) return DATA_CHAT_AGENT ;
769771 if ( name === 'inactive_agent' ) return { ...DATA_CHAT_AGENT , name : 'inactive_agent' , active : false } ;
770772 return undefined ;
771773 } ) ,
@@ -791,7 +793,7 @@ describe('Agent Routes', () => {
791793 expect ( resp . status ) . toBe ( 200 ) ;
792794 const body = resp . body as { agents : Array < { name : string ; label : string ; role : string } > } ;
793795 expect ( body . agents ) . toHaveLength ( 2 ) ;
794- expect ( body . agents [ 0 ] . name ) . toBe ( 'data_chat ' ) ;
796+ expect ( body . agents [ 0 ] . name ) . toBe ( 'ask ' ) ;
795797 expect ( body . agents [ 1 ] . name ) . toBe ( 'metadata_assistant' ) ;
796798 } ) ;
797799
@@ -1047,7 +1049,8 @@ describe('Agent Routes', () => {
10471049
10481050describe ( 'DATA_CHAT_AGENT' , ( ) => {
10491051 it ( 'should be a valid agent definition' , ( ) => {
1050- expect ( DATA_CHAT_AGENT . name ) . toBe ( 'data_chat' ) ;
1052+ // Path A rename: canonical id is now `ask` (was `data_chat`).
1053+ expect ( DATA_CHAT_AGENT . name ) . toBe ( 'ask' ) ;
10511054 expect ( DATA_CHAT_AGENT . role ) . toBe ( 'Business Application Assistant' ) ;
10521055 expect ( DATA_CHAT_AGENT . active ) . toBe ( true ) ;
10531056 expect ( DATA_CHAT_AGENT . visibility ) . toBe ( 'global' ) ;
0 commit comments