diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-16 03:51:43 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-16 03:51:43 +0200 |
| commit | de3e878ad12bbd3e609bd5b7d741fc792c72f255 (patch) | |
| tree | 06d92b93ea0ad532c5d3a761033baac05abe2a5e /internal/hexaimcp | |
| parent | 2e9cabb1c8bf1f0246e513fe1f86a552e07eee94 (diff) | |
Decompose App God struct into embedded section structs
Replace 60+ flat fields in App with 4 embedded section structs:
CoreConfig, ProviderConfig, PromptConfig, FeatureConfig. Go field
promotion preserves all existing field access patterns. Updated
flattenAppConfig to recurse into embedded structs for runtimeconfig.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/hexaimcp')
| -rw-r--r-- | internal/hexaimcp/run_test.go | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/internal/hexaimcp/run_test.go b/internal/hexaimcp/run_test.go index dac6542..6bfe771 100644 --- a/internal/hexaimcp/run_test.go +++ b/internal/hexaimcp/run_test.go @@ -112,7 +112,7 @@ func TestGetPromptsDir(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cfg := appconfig.App{ - MCPPromptsDir: tt.cfgValue, + FeatureConfig: appconfig.FeatureConfig{MCPPromptsDir: tt.cfgValue}, } result, err := getPromptsDir(cfg) @@ -424,7 +424,7 @@ func TestGetPromptsDir_XDGDataHome(t *testing.T) { // TestGetPromptsDir_TildeInConfig verifies tilde expansion for config path. func TestGetPromptsDir_TildeInConfig(t *testing.T) { cfg := appconfig.App{ - MCPPromptsDir: "~/my-prompts", + FeatureConfig: appconfig.FeatureConfig{MCPPromptsDir: "~/my-prompts"}, } result, err := getPromptsDir(cfg) @@ -449,7 +449,7 @@ func TestGetPromptsDir_TildeInConfig(t *testing.T) { func TestCreateSyncer_Disabled(t *testing.T) { logger := log.New(io.Discard, "", 0) cfg := appconfig.App{ - MCPSlashCommandSync: false, + FeatureConfig: appconfig.FeatureConfig{MCPSlashCommandSync: false}, } syncer, err := createSyncer(cfg, logger) @@ -467,8 +467,10 @@ func TestCreateSyncer_Enabled(t *testing.T) { tmpDir := t.TempDir() logger := log.New(io.Discard, "", 0) cfg := appconfig.App{ - MCPSlashCommandSync: true, - MCPSlashCommandDir: tmpDir, + FeatureConfig: appconfig.FeatureConfig{ + MCPSlashCommandSync: true, + MCPSlashCommandDir: tmpDir, + }, } syncer, err := createSyncer(cfg, logger) @@ -485,8 +487,10 @@ func TestCreateSyncer_Enabled(t *testing.T) { func TestCreateSyncer_Error(t *testing.T) { logger := log.New(io.Discard, "", 0) cfg := appconfig.App{ - MCPSlashCommandSync: true, - MCPSlashCommandDir: "", // empty directory triggers error + FeatureConfig: appconfig.FeatureConfig{ + MCPSlashCommandSync: true, + MCPSlashCommandDir: "", + }, } _, err := createSyncer(cfg, logger) @@ -646,9 +650,11 @@ func TestApplyOverrides(t *testing.T) { t.Run("does not overwrite with zero values", func(t *testing.T) { cfg := appconfig.App{ - MCPPromptsDir: "/existing/prompts", - MCPSlashCommandSync: true, - MCPSlashCommandDir: "/existing/cmds", + FeatureConfig: appconfig.FeatureConfig{ + MCPPromptsDir: "/existing/prompts", + MCPSlashCommandSync: true, + MCPSlashCommandDir: "/existing/cmds", + }, } overrides := MCPOverrides{} // all zero values applyOverrides(&cfg, overrides) |
