@@ -718,6 +718,38 @@ func TestSession(t *testing.T) {
718718 t .Errorf ("Expected assistant message to contain '300', got %v" , assistantMessage .Data .Content )
719719 }
720720 })
721+
722+ t .Run ("should create session with custom config dir" , func (t * testing.T ) {
723+ ctx .ConfigureForTest (t )
724+
725+ customConfigDir := ctx .HomeDir + "/custom-config"
726+ session , err := client .CreateSession (& copilot.SessionConfig {
727+ ConfigDir : customConfigDir ,
728+ })
729+ if err != nil {
730+ t .Fatalf ("Failed to create session with custom config dir: %v" , err )
731+ }
732+
733+ matched , _ := regexp .MatchString (`^[a-f0-9-]+$` , session .SessionID )
734+ if ! matched {
735+ t .Errorf ("Expected session ID to match UUID pattern, got %q" , session .SessionID )
736+ }
737+
738+ // Session should work normally with custom config dir
739+ _ , err = session .Send (copilot.MessageOptions {Prompt : "What is 1+1?" })
740+ if err != nil {
741+ t .Fatalf ("Failed to send message: %v" , err )
742+ }
743+
744+ assistantMessage , err := testharness .GetFinalAssistantMessage (session , 60 * time .Second )
745+ if err != nil {
746+ t .Fatalf ("Failed to get assistant message: %v" , err )
747+ }
748+
749+ if assistantMessage .Data .Content == nil || ! strings .Contains (* assistantMessage .Data .Content , "2" ) {
750+ t .Errorf ("Expected assistant message to contain '2', got %v" , assistantMessage .Data .Content )
751+ }
752+ })
721753}
722754
723755func getSystemMessage (exchange testharness.ParsedHttpExchange ) string {
0 commit comments