Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Copy fixture contents when `context.repo_fixture` names a directory symlink
in the `none` and OpenSandbox runtimes. Local uploads no longer fail with a directory
read error, and OpenSandbox no longer silently uploads an empty fixture.
- Reject YAML `.nan` as a judge pass threshold during validation. No pass
rate can meet that threshold.
- Reject a `rule_based` matcher that is present but holds no values to match.
`output_contains: {all: []}`, `output_matches: {}`, `turn_response_contains`
without `contains_all`/`contains_any`, and `turn_response_not_contains`
Expand Down
2 changes: 1 addition & 1 deletion internal/config/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ func validatePassThreshold(threshold *float64) []string {
if threshold == nil {
return nil
}
if *threshold < 0.0 || *threshold > 1.0 {
if math.IsNaN(*threshold) || *threshold < 0.0 || *threshold > 1.0 {
return []string{"judge.pass_threshold must be between 0.0 and 1.0"}
}
return nil
Expand Down
16 changes: 16 additions & 0 deletions internal/config/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@ package config
import (
"strings"
"testing"

"gopkg.in/yaml.v3"
)

func TestValidateEvalConfigRejectsNaNPassThreshold(t *testing.T) {
t.Parallel()
cfg := DefaultEvalConfig()
cfg.Cases.Files = []string{"case.yaml"}
cfg.Judge = JudgeConfig{Type: judgeTypeAgentJudge, Model: "test-model", Criteria: []string{"check"}}
if err := yaml.Unmarshal([]byte("pass_threshold: .nan"), &cfg.Judge); err != nil {
t.Fatal(err)
}
err := NewValidator().ValidateEvalConfig(cfg)
if err == nil || !strings.Contains(err.Error(), "judge.pass_threshold") {
t.Fatalf("ValidateEvalConfig() error = %v, want invalid pass_threshold", err)
}
}

func TestEnvironmentAgentHome(t *testing.T) {
for _, kind := range []string{runtimeTypeNone, runtimeTypeDocker, runtimeTypeOpenSandbox} {
for _, mode := range []string{"", "inherited", "temporary", "unknown"} {
Expand Down
Loading