@@ -687,6 +687,38 @@ func TestSession(t *testing.T) {
687687 t .Errorf ("Expected assistant message to contain '300', got %v" , assistantMessage .Data .Content )
688688 }
689689 })
690+
691+ t .Run ("should create session with custom config dir" , func (t * testing.T ) {
692+ ctx .ConfigureForTest (t )
693+
694+ customConfigDir := ctx .HomeDir + "/custom-config"
695+ session , err := client .CreateSession (& copilot.SessionConfig {
696+ ConfigDir : customConfigDir ,
697+ })
698+ if err != nil {
699+ t .Fatalf ("Failed to create session with custom config dir: %v" , err )
700+ }
701+
702+ matched , _ := regexp .MatchString (`^[a-f0-9-]+$` , session .SessionID )
703+ if ! matched {
704+ t .Errorf ("Expected session ID to match UUID pattern, got %q" , session .SessionID )
705+ }
706+
707+ // Session should work normally with custom config dir
708+ _ , err = session .Send (copilot.MessageOptions {Prompt : "What is 1+1?" })
709+ if err != nil {
710+ t .Fatalf ("Failed to send message: %v" , err )
711+ }
712+
713+ assistantMessage , err := testharness .GetFinalAssistantMessage (session , 60 * time .Second )
714+ if err != nil {
715+ t .Fatalf ("Failed to get assistant message: %v" , err )
716+ }
717+
718+ if assistantMessage .Data .Content == nil || ! strings .Contains (* assistantMessage .Data .Content , "2" ) {
719+ t .Errorf ("Expected assistant message to contain '2', got %v" , assistantMessage .Data .Content )
720+ }
721+ })
690722}
691723
692724func getSystemMessage (exchange testharness.ParsedHttpExchange ) string {
0 commit comments