43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package codex
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
// TestCodexEffortCatalogLive reads the installed App Server's model/list
|
|
// through this adapter. It is read-only (no thread, no turn) and opt-in,
|
|
// because it attaches to the user's Codex connection host.
|
|
func TestCodexEffortCatalogLive(t *testing.T) {
|
|
if os.Getenv("PIPELINES_LIVE_CODEX_EFFORT") == "" {
|
|
t.Skip("set PIPELINES_LIVE_CODEX_EFFORT=1 to read the real Codex model catalog")
|
|
}
|
|
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
|
defer cancel()
|
|
chat, err := Open(ctx)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer chat.Close()
|
|
catalog, err := chat.catalog(ctx)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
withLevels := 0
|
|
for _, model := range catalog {
|
|
ids := []string{}
|
|
for _, effort := range model.Efforts {
|
|
ids = append(ids, effort.ID)
|
|
}
|
|
t.Logf("%s default=%q levels=%v", model.ID, model.DefaultEffort, ids)
|
|
if len(model.Efforts) > 0 {
|
|
withLevels++
|
|
}
|
|
}
|
|
if withLevels == 0 {
|
|
t.Fatal("no Codex model reported reasoning efforts")
|
|
}
|
|
}
|