| 1959 | } |
| 1960 | |
| 1961 | func TestResumeSessionRequest_RequestElicitation(t *testing.T) { |
| 1962 | t.Run("sends requestElicitation flag when OnElicitationRequest is provided", func(t *testing.T) { |
| 1963 | req := resumeSessionRequest{ |
| 1964 | SessionID: "s1", |
| 1965 | RequestElicitation: Bool(true), |
| 1966 | } |
| 1967 | data, err := json.Marshal(req) |
| 1968 | if err != nil { |
| 1969 | t.Fatalf("Failed to marshal: %v", err) |
| 1970 | } |
| 1971 | var m map[string]any |
| 1972 | if err := json.Unmarshal(data, &m); err != nil { |
| 1973 | t.Fatalf("Failed to unmarshal: %v", err) |
| 1974 | } |
| 1975 | if m["requestElicitation"] != true { |
| 1976 | t.Errorf("Expected requestElicitation to be true, got %v", m["requestElicitation"]) |
| 1977 | } |
| 1978 | }) |
| 1979 | |
| 1980 | t.Run("does not send requestElicitation when no handler provided", func(t *testing.T) { |
| 1981 | req := resumeSessionRequest{SessionID: "s1"} |
| 1982 | data, _ := json.Marshal(req) |
| 1983 | var m map[string]any |
| 1984 | json.Unmarshal(data, &m) |
| 1985 | if _, ok := m["requestElicitation"]; ok { |
| 1986 | t.Error("Expected requestElicitation to be omitted when not set") |
| 1987 | } |
| 1988 | }) |
| 1989 | } |
| 1990 | |
| 1991 | func TestCreateSessionRequest_RequestMCPApps(t *testing.T) { |
| 1992 | t.Run("sends requestMCPApps flag when EnableMCPApps is set", func(t *testing.T) { |