Skip to content

Address review findings from ADR-0045 Phase 4 PR 2 (#2447) #2511

Description

@ggallen

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.Emptyassert.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/installCLI install and app setuppriority/lowNice to have, address when convenientready-to-codeTriaged and ready for the code agenttype/choreMaintenance and housekeeping tasks

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions