@@ -614,6 +614,38 @@ func TestSession(t *testing.T) {
614614 t .Errorf ("Expected assistant message to contain '2', got %v" , assistantMessage .Data .Content )
615615 }
616616 })
617+
618+ t .Run ("should create session with custom config dir" , func (t * testing.T ) {
619+ ctx .ConfigureForTest (t )
620+
621+ customConfigDir := ctx .HomeDir + "/custom-config"
622+ session , err := client .CreateSession (& copilot.SessionConfig {
623+ ConfigDir : customConfigDir ,
624+ })
625+ if err != nil {
626+ t .Fatalf ("Failed to create session with custom config dir: %v" , err )
627+ }
628+
629+ matched , _ := regexp .MatchString (`^[a-f0-9-]+$` , session .SessionID )
630+ if ! matched {
631+ t .Errorf ("Expected session ID to match UUID pattern, got %q" , session .SessionID )
632+ }
633+
634+ // Session should work normally with custom config dir
635+ _ , err = session .Send (copilot.MessageOptions {Prompt : "What is 1+1?" })
636+ if err != nil {
637+ t .Fatalf ("Failed to send message: %v" , err )
638+ }
639+
640+ assistantMessage , err := testharness .GetFinalAssistantMessage (session , 60 * time .Second )
641+ if err != nil {
642+ t .Fatalf ("Failed to get assistant message: %v" , err )
643+ }
644+
645+ if assistantMessage .Data .Content == nil || ! strings .Contains (* assistantMessage .Data .Content , "2" ) {
646+ t .Errorf ("Expected assistant message to contain '2', got %v" , assistantMessage .Data .Content )
647+ }
648+ })
617649}
618650
619651func getSystemMessage (exchange testharness.ParsedHttpExchange ) string {
0 commit comments