File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,14 +245,19 @@ describe("MCP Servers and Custom Agents", async () => {
245245 expect ( message ?. data . content ) . toBeDefined ( ) ;
246246 const content = message ! . data . content || "" ;
247247
248- // Check that the custom agent is mentioned (either by name or in the list)
249- // The CLI should include custom agents in the task tool description
250- expect (
251- content . toLowerCase ( ) . includes ( "test-agent" ) ||
252- content . toLowerCase ( ) . includes ( "test agent" ) ||
253- content . toLowerCase ( ) . includes ( "user-defined" ) ||
254- content . toLowerCase ( ) . includes ( "user-provided" )
255- ) . toBe ( true ) ;
248+ // Check that the custom agent name is mentioned AND
249+ // that it's mentioned in a positive context (available/configured)
250+ // This ensures the agent is actually surfaced, not just mentioned as missing
251+ const lowerContent = content . toLowerCase ( ) ;
252+ const hasAgentName = lowerContent . includes ( "test-agent" ) || lowerContent . includes ( "test agent" ) ;
253+ const hasPositiveIndicator =
254+ lowerContent . includes ( "available" ) ||
255+ lowerContent . includes ( "configured" ) ||
256+ lowerContent . includes ( "following" ) ||
257+ lowerContent . includes ( "include" ) ;
258+
259+ expect ( hasAgentName ) . toBe ( true ) ;
260+ expect ( hasPositiveIndicator ) . toBe ( true ) ;
256261
257262 await session . destroy ( ) ;
258263 } ) ;
You can’t perform that action at this time.
0 commit comments