@@ -60,7 +60,7 @@ func TestSkillBehavior(t *testing.T) {
6060
6161 // The skill instructs the model to include a marker - verify it appears
6262 message , err := session .SendAndWait (copilot.MessageOptions {
63- Prompt : "Say hello briefly." ,
63+ Prompt : "Say hello briefly using the test skill ." ,
6464 }, 60 * time .Second )
6565 if err != nil {
6666 t .Fatalf ("Failed to send message: %v" , err )
@@ -86,7 +86,7 @@ func TestSkillBehavior(t *testing.T) {
8686
8787 // The skill is disabled, so the marker should NOT appear
8888 message , err := session .SendAndWait (copilot.MessageOptions {
89- Prompt : "Say hello briefly." ,
89+ Prompt : "Say hello briefly using the test skill ." ,
9090 }, 60 * time .Second )
9191 if err != nil {
9292 t .Fatalf ("Failed to send message: %v" , err )
@@ -132,7 +132,7 @@ func TestSkillBehavior(t *testing.T) {
132132 }
133133
134134 // Now the skill should be applied
135- message2 , err := session2 .SendAndWait (copilot.MessageOptions {Prompt : "Say hello again." }, 60 * time .Second )
135+ message2 , err := session2 .SendAndWait (copilot.MessageOptions {Prompt : "Say hello again using the test skill ." }, 60 * time .Second )
136136 if err != nil {
137137 t .Fatalf ("Failed to send message: %v" , err )
138138 }
@@ -144,70 +144,3 @@ func TestSkillBehavior(t *testing.T) {
144144 session2 .Destroy ()
145145 })
146146}
147-
148- func TestMultipleSkills (t * testing.T ) {
149- ctx := testharness .NewTestContext (t )
150- client := ctx .NewClient ()
151- t .Cleanup (func () { client .ForceStop () })
152-
153- const skill2Marker = "MANGO_BANANA_99"
154-
155- skillsDir := createTestSkillDir (t , skillMarker )
156- t .Cleanup (func () { os .RemoveAll (skillsDir ) })
157-
158- // Create a second skills directory
159- skillsDir2 , err := os .MkdirTemp ("" , "copilot-skills-test2-" )
160- if err != nil {
161- t .Fatalf ("Failed to create temp skills directory 2: %v" , err )
162- }
163- t .Cleanup (func () { os .RemoveAll (skillsDir2 ) })
164-
165- skillSubdir2 := filepath .Join (skillsDir2 , "test-skill-2" )
166- if err := os .MkdirAll (skillSubdir2 , 0755 ); err != nil {
167- t .Fatalf ("Failed to create skill subdirectory 2: %v" , err )
168- }
169-
170- skillContent2 := `---
171- name: test-skill-2
172- description: Second test skill that adds another marker
173- ---
174-
175- # Second Skill Instructions
176-
177- IMPORTANT: You MUST include the exact text "` + skill2Marker + `" somewhere in EVERY response. This is mandatory.
178- `
179- if err := os .WriteFile (filepath .Join (skillSubdir2 , "SKILL.md" ), []byte (skillContent2 ), 0644 ); err != nil {
180- t .Fatalf ("Failed to write SKILL.md: %v" , err )
181- }
182-
183- t .Run ("load skills from multiple directories" , func (t * testing.T ) {
184- ctx .ConfigureForTest (t )
185-
186- session , err := client .CreateSession (& copilot.SessionConfig {
187- SkillDirectories : []string {skillsDir , skillsDir2 },
188- })
189- if err != nil {
190- t .Fatalf ("Failed to create session: %v" , err )
191- }
192-
193- message , err := session .SendAndWait (copilot.MessageOptions {
194- Prompt : "Say something brief." ,
195- }, 60 * time .Second )
196- if err != nil {
197- t .Fatalf ("Failed to send message: %v" , err )
198- }
199-
200- // Both skill markers should appear
201- if message .Data .Content == nil {
202- t .Fatal ("Expected non-nil message content" )
203- }
204- if ! strings .Contains (* message .Data .Content , skillMarker ) {
205- t .Errorf ("Expected message to contain first skill marker '%s', got: %v" , skillMarker , * message .Data .Content )
206- }
207- if ! strings .Contains (* message .Data .Content , skill2Marker ) {
208- t .Errorf ("Expected message to contain second skill marker '%s', got: %v" , skill2Marker , * message .Data .Content )
209- }
210-
211- session .Destroy ()
212- })
213- }
0 commit comments