@@ -15,7 +15,7 @@ async function getBuiltInAgent(
1515 const response = await makeApiRequest ( {
1616 request,
1717 method : "get" ,
18- urlSuffix : "/api/agents?agentTypes=agent&limit=100" ,
18+ urlSuffix : "/api/agents?agentTypes=agent&scope=built_in& limit=100" ,
1919 } ) ;
2020 const result = await response . json ( ) ;
2121 const agents = result . data ?? result ;
@@ -159,10 +159,25 @@ test.describe("Built-In Agents API", () => {
159159 expect ( builtIn ) . toBeTruthy ( ) ;
160160 } ) ;
161161
162- test ( "built-in agent included in /api/agents (agents management page) " , async ( {
162+ test ( "built-in agent excluded from /api/agents by default, included with scope=built_in " , async ( {
163163 request,
164164 makeApiRequest,
165165 } ) => {
166+ // Without scope filter, built-in agents should be excluded
167+ const defaultResponse = await makeApiRequest ( {
168+ request,
169+ method : "get" ,
170+ urlSuffix : "/api/agents?agentTypes=agent&limit=100" ,
171+ } ) ;
172+ const defaultResult = await defaultResponse . json ( ) ;
173+ const defaultAgents = defaultResult . data ?? defaultResult ;
174+ const excluded = defaultAgents . find (
175+ ( a : { builtInAgentConfig ?: { name : string } } ) =>
176+ a . builtInAgentConfig ?. name === BUILT_IN_AGENT_IDS . POLICY_CONFIG ,
177+ ) ;
178+ expect ( excluded ) . toBeUndefined ( ) ;
179+
180+ // With scope=built_in, built-in agents should be included
166181 const builtIn = await getBuiltInAgent ( request , makeApiRequest ) ;
167182 expect ( builtIn ) . toBeTruthy ( ) ;
168183 expect ( builtIn . builtInAgentConfig ?. name ) . toBe (
0 commit comments