1+ import { AgentTemplateTypes } from '@codebuff/common/types/session-state'
12import { resolveAgentId } from '@codebuff/common/util/agent-name-normalization'
23import { describe , expect , it , beforeEach } from 'bun:test'
34
@@ -22,8 +23,8 @@ describe('Agent ID Resolution', () => {
2223 parentPrompt : 'Test' ,
2324 inputSchema : { } ,
2425 } ,
25- file_picker : {
26- id : ' file_picker' ,
26+ [ AgentTemplateTypes . file_picker ] : {
27+ id : AgentTemplateTypes . file_picker ,
2728 displayName : 'Fletcher' ,
2829 systemPrompt : 'Test' ,
2930 instructionsPrompt : 'Test' ,
@@ -86,7 +87,7 @@ describe('Agent ID Resolution', () => {
8687 describe ( 'Direct ID Resolution' , ( ) => {
8788 it ( 'should resolve built-in agent IDs directly' , ( ) => {
8889 expect ( resolveAgentId ( 'base' , mockRegistry ) ) . toBe ( 'base' )
89- expect ( resolveAgentId ( 'file_picker ' , mockRegistry ) ) . toBe ( 'file_picker ' )
90+ expect ( resolveAgentId ( 'file-picker ' , mockRegistry ) ) . toBe ( 'file-picker ' )
9091 } )
9192
9293 it ( 'should resolve custom agent IDs directly' , ( ) => {
@@ -115,7 +116,7 @@ describe('Agent ID Resolution', () => {
115116 it ( 'should not add prefix to built-in agents' , ( ) => {
116117 // Built-in agents should be found directly, not with prefix
117118 expect ( resolveAgentId ( 'base' , mockRegistry ) ) . toBe ( 'base' )
118- expect ( resolveAgentId ( 'file_picker ' , mockRegistry ) ) . toBe ( 'file_picker ' )
119+ expect ( resolveAgentId ( 'file-picker ' , mockRegistry ) ) . toBe ( 'file-picker ' )
119120 } )
120121 } )
121122
0 commit comments