feat(builder): pinpoint settings a server can't start without
Booting drafts as deployed catches a server that stops when a setting is empty, but the server's own output rarely says why, so the model guessed (more memory) for three rounds and the draft ended as WIP. When a draft fails with its defaults and has blank password-like settings without x-generate, the builder boots it once more with those filled. If that boot passes, the cause is certain, and the model is told exactly that: these settings stop the server when empty; give them x-generate (a password per server) or a working default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cc4a8e357d
commit
98ba043bec
2 files changed
+122
-36
No files matched your search
@@ -1,6 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -48,3 +50,30 @@ func TestVariantNotes(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestBlankRequiredLookingSettings(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
game := filepath.Join(dir, "example")
|
||||
os.MkdirAll(game, 0o755)
|
||||
os.WriteFile(filepath.Join(game, "game.yaml"), []byte(`id: example
|
||||
defaultConfig:
|
||||
JoinPassword: ""
|
||||
AdminPassword: ""
|
||||
ServerPassword: set-by-default
|
||||
ServerName: x
|
||||
configSchema:
|
||||
properties:
|
||||
JoinPassword: {type: string}
|
||||
AdminPassword: {type: string, x-generate: {type: password}}
|
||||
ServerPassword: {type: string}
|
||||
ServerName: {type: string}
|
||||
`), 0o644)
|
||||
got := blankRequiredLooking(dir, "example")
|
||||
if len(got) != 1 || got[0] != "JoinPassword" {
|
||||
t.Errorf("got %v, want only JoinPassword (AdminPassword is generated, ServerPassword has a default)", got)
|
||||
}
|
||||
msg := emptySettingsProblem(got, "FAILED: server crashed")
|
||||
if !strings.Contains(msg, "stops when JoinPassword is empty") || !strings.Contains(msg, `"x-generate": {"type": "password"}`) {
|
||||
t.Errorf("message: %s", msg)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user