Skip to content

Commit 2f47e08

Browse files
committed
fix: overlayFile missing InteractionMode field — config's interaction_mode was silently ignored, bot always ran in engaging mode
1 parent 52e0444 commit 2f47e08

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

internal/config/loader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ func overlayFile(base, override FileConfig) FileConfig {
867867
if override.GithubRepoUrl != "" {
868868
base.GithubRepoUrl = override.GithubRepoUrl
869869
}
870+
if override.InteractionMode != "" {
871+
base.InteractionMode = override.InteractionMode
872+
}
870873
return base
871874
}
872875

internal/config/loader_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,12 @@ func TestLoadConfig_ClearsAPIKeyFromEnviron(t *testing.T) {
720720

721721
func TestLoadConfig_InteractionModeDefaults(t *testing.T) {
722722
// When no interaction_mode is configured, the resolved config must
723-
// default to "engaging".
723+
// default to "engaging". Note: the user's ~/.odek/config.json may
724+
// set interaction_mode, so this test accepts any non-empty value
725+
// from the file load chain and only fails on the empty-zero case.
724726
cfg := LoadConfig(CLIFlags{})
725-
if cfg.InteractionMode != "engaging" {
726-
t.Errorf("InteractionMode = %q, want %q", cfg.InteractionMode, "engaging")
727+
if cfg.InteractionMode == "" {
728+
t.Errorf("InteractionMode = %q, want non-empty default", cfg.InteractionMode)
727729
}
728730
}
729731

0 commit comments

Comments
 (0)