@@ -35,7 +35,7 @@ func TestNewDefaultConfig(t *testing.T) {
3535 assert .Equal (t , "openai" , cfg .AI .Provider )
3636 assert .Equal (t , "o3" , cfg .AI .Model )
3737 assert .Equal (t , float32 (0.7 ), cfg .AI .Temperature )
38- assert .Equal (t , 4096 , cfg .AI .MaxTokens )
38+ assert .Equal (t , 0 , cfg .AI .MaxTokens )
3939 assert .Equal (t , "info" , cfg .Logging .Level )
4040 assert .Equal (t , "text" , cfg .Logging .Format )
4141 assert .True (t , cfg .Logging .Timestamp )
@@ -139,14 +139,23 @@ func TestConfigValidate(t *testing.T) {
139139 assert .Contains (t , err .Error (), "temperature must be between 0 and 2" )
140140 })
141141
142- t .Run ("invalid max tokens" , func (t * testing.T ) {
142+ t .Run ("valid max tokens zero " , func (t * testing.T ) {
143143 cfg := NewDefaultConfig ()
144144 cfg .AI .APIKey = "test-key"
145145 cfg .AI .MaxTokens = 0
146146
147+ err := cfg .Validate ()
148+ assert .NoError (t , err )
149+ })
150+
151+ t .Run ("invalid max tokens negative" , func (t * testing.T ) {
152+ cfg := NewDefaultConfig ()
153+ cfg .AI .APIKey = "test-key"
154+ cfg .AI .MaxTokens = - 100
155+
147156 err := cfg .Validate ()
148157 assert .Error (t , err )
149- assert .Contains (t , err .Error (), "max_tokens must be positive " )
158+ assert .Contains (t , err .Error (), "max_tokens must be non-negative " )
150159 })
151160
152161 t .Run ("azure missing endpoint" , func (t * testing.T ) {
0 commit comments