Context
PR #2447 (ADR-0045 Phase 4, PR 2: stop writing agents block during install) merged with three medium-severity review findings from @waynesun09 that should be addressed in a follow-up.
Findings
1. assert.Empty → assert.Nil in TestNewOrgConfig (internal/config/config_test.go:53)
TestNewOrgConfig uses assert.Empty(t, cfg.Agents) which passes for both nil and []AgentEntry{}. Since NewOrgConfig no longer sets the field at all, cfg.Agents should be nil (Go zero value). Use assert.Nil to enforce the stronger invariant and document that the field is truly unset, not merely empty. This matters because YAML omitempty behavior for nil vs empty slices is implementation-dependent.
Fix: Change assert.Empty(t, cfg.Agents) to assert.Nil(t, cfg.Agents).
2. Missing integration test for agents-free config.yaml output (internal/layers/configrepo_test.go)
After removing the agents parameter from newTestConfig, no test in configrepo_test.go verifies the key behavioral change: that ConfigRepoLayer.Install() writes a config.yaml that does NOT contain an agents: key. While unit-level marshal tests exist in config_test.go, there is no integration-level assertion in the layers package confirming the end-to-end behavior.
Fix: Add an assertion in TestConfigRepoLayer_Install_CreatesRepo (or a new test) that reads back the written config.yaml from client.CreatedFiles and asserts it does not contain the string agents:.
3. Consider options struct for NewOrgConfig (internal/config/config.go:115)
After removing agents, NewOrgConfig still takes 5 positional parameters including two adjacent string types (inferenceProvider, org), making call sites like NewOrgConfig(nil, nil, nil, "", "") opaque. A NewOrgConfigOpts struct would improve readability and extensibility.
Note: This is a design improvement suggestion, not a blocker. The current signature is functional and all callers are correct. Track for future consideration.
Source
PR: #2447
Reviewer: @waynesun09
Context
PR #2447 (ADR-0045 Phase 4, PR 2: stop writing agents block during install) merged with three medium-severity review findings from @waynesun09 that should be addressed in a follow-up.
Findings
1.
assert.Empty→assert.Nilin TestNewOrgConfig (internal/config/config_test.go:53)TestNewOrgConfigusesassert.Empty(t, cfg.Agents)which passes for bothniland[]AgentEntry{}. SinceNewOrgConfigno longer sets the field at all,cfg.Agentsshould benil(Go zero value). Useassert.Nilto enforce the stronger invariant and document that the field is truly unset, not merely empty. This matters because YAMLomitemptybehavior for nil vs empty slices is implementation-dependent.Fix: Change
assert.Empty(t, cfg.Agents)toassert.Nil(t, cfg.Agents).2. Missing integration test for agents-free config.yaml output (
internal/layers/configrepo_test.go)After removing the agents parameter from
newTestConfig, no test inconfigrepo_test.goverifies the key behavioral change: thatConfigRepoLayer.Install()writes a config.yaml that does NOT contain anagents:key. While unit-level marshal tests exist inconfig_test.go, there is no integration-level assertion in the layers package confirming the end-to-end behavior.Fix: Add an assertion in
TestConfigRepoLayer_Install_CreatesRepo(or a new test) that reads back the written config.yaml fromclient.CreatedFilesand asserts it does not contain the stringagents:.3. Consider options struct for
NewOrgConfig(internal/config/config.go:115)After removing
agents,NewOrgConfigstill takes 5 positional parameters including two adjacentstringtypes (inferenceProvider,org), making call sites likeNewOrgConfig(nil, nil, nil, "", "")opaque. ANewOrgConfigOptsstruct would improve readability and extensibility.Note: This is a design improvement suggestion, not a blocker. The current signature is functional and all callers are correct. Track for future consideration.
Source
PR: #2447
Reviewer: @waynesun09