fix(config): don't export empty GT_ROOT/BEADS_DIR in AgentEnv (#385)

* fix(config): don't export empty GT_ROOT/BEADS_DIR in AgentEnv

Fix polecats not having GT_ROOT environment variable set. The symptom was
polecat sessions showing GT_ROOT="" instead of the expected town root.

Root cause: AgentEnvSimple doesn't set TownRoot, but AgentEnv was always
setting env["GT_ROOT"] = cfg.TownRoot even when empty. This empty value
in export commands would override the tmux session environment.

Changes:
- Only set GT_ROOT and BEADS_DIR in env map if non-empty
- Refactor daemon.go to use AgentEnv with full AgentEnvConfig instead
  of AgentEnvSimple + manual additions
- Update test to verify keys are absent rather than empty

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(lint): silence unparam for unused executeExternalActions args

The external action params (beadID, severity, description) are reserved
for future email/SMS/slack implementations but currently unused.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: julianknutsen <julianknutsen@users.noreply.github>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: max <steve.yegge@gmail.com>
This commit is contained in:
Julian Knutsen
2026-01-12 10:45:03 +00:00
committed by GitHub
parent 3cdc98651e
commit 3caf32f9f7
4 changed files with 44 additions and 16 deletions

View File

@@ -540,7 +540,7 @@ func extractMailTargetsFromActions(actions []string) []string {
// executeExternalActions processes external notification actions (email:, sms:, slack).
// For now, this logs warnings if contacts aren't configured - actual sending is future work.
func executeExternalActions(actions []string, cfg *config.EscalationConfig, beadID, severity, description string) {
func executeExternalActions(actions []string, cfg *config.EscalationConfig, _, _, _ string) {
for _, action := range actions {
switch {
case strings.HasPrefix(action, "email:"):