fix(doctor): check deacon env vars after AgentEnv refactor
The env-vars doctor check was skipping deacon with a stale comment "it doesn't use standard env vars". After the AgentEnv refactor, deacon/manager.go now uses config.AgentEnv() like all other roles. - Remove the skip condition for deacon in env_check.go - Update test from TestEnvVarsCheck_DeaconSkipped to test deacon is actually checked (TestEnvVarsCheck_DeaconCorrect/DeaconMissing) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
64e1448981
commit
9b4c7ac28b
@@ -95,11 +95,6 @@ func (c *EnvVarsCheck) Run(ctx *CheckContext) *CheckResult {
|
||||
continue
|
||||
}
|
||||
|
||||
// Skip deacon - it doesn't use the standard env vars
|
||||
if identity.Role == session.RoleDeacon {
|
||||
continue
|
||||
}
|
||||
|
||||
// Get expected env vars based on role
|
||||
expected := config.AgentEnvSimple(string(identity.Role), identity.Rig, identity.Name)
|
||||
|
||||
|
||||
@@ -258,28 +258,37 @@ func TestEnvVarsCheck_MixedCorrectAndMismatch(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnvVarsCheck_DeaconSkipped(t *testing.T) {
|
||||
// Deacon should be skipped - it doesn't use standard env vars
|
||||
func TestEnvVarsCheck_DeaconCorrect(t *testing.T) {
|
||||
expected := config.AgentEnvSimple("deacon", "", "")
|
||||
reader := &mockEnvReader{
|
||||
sessions: []string{"hq-deacon"},
|
||||
sessionEnvs: map[string]map[string]string{
|
||||
"hq-deacon": {}, // Empty - but should be skipped
|
||||
"hq-deacon": expected,
|
||||
},
|
||||
}
|
||||
check := NewEnvVarsCheckWithReader(reader)
|
||||
result := check.Run(&CheckContext{})
|
||||
|
||||
// With only deacon (skipped), checkedCount=0, so should show "No Gas Town sessions"
|
||||
// Actually no - the session exists but is skipped. Let me check the logic...
|
||||
// The check filters to gt-* and hq-* first, then skips deacon. With deacon skipped,
|
||||
// checkedCount stays 0, but gtSessions has 1 entry.
|
||||
// Looking at the code, after skipping deacon, checkedCount=0 and mismatches is empty,
|
||||
// so it returns OK with "All 0 session(s) have correct environment variables"
|
||||
if result.Status != StatusOK {
|
||||
t.Errorf("Status = %v, want StatusOK", result.Status)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnvVarsCheck_DeaconMissing(t *testing.T) {
|
||||
reader := &mockEnvReader{
|
||||
sessions: []string{"hq-deacon"},
|
||||
sessionEnvs: map[string]map[string]string{
|
||||
"hq-deacon": {}, // Missing all env vars
|
||||
},
|
||||
}
|
||||
check := NewEnvVarsCheckWithReader(reader)
|
||||
result := check.Run(&CheckContext{})
|
||||
|
||||
if result.Status != StatusWarning {
|
||||
t.Errorf("Status = %v, want StatusWarning", result.Status)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnvVarsCheck_GetEnvError(t *testing.T) {
|
||||
reader := &mockEnvReader{
|
||||
sessions: []string{"gt-myrig-witness"},
|
||||
|
||||
Reference in New Issue
Block a user