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:
@@ -81,8 +81,14 @@ func AgentEnv(cfg AgentEnvConfig) map[string]string {
|
||||
env["GIT_AUTHOR_NAME"] = cfg.AgentName
|
||||
}
|
||||
|
||||
env["GT_ROOT"] = cfg.TownRoot
|
||||
env["BEADS_DIR"] = cfg.BeadsDir
|
||||
// Only set GT_ROOT and BEADS_DIR if provided
|
||||
// Empty values would override tmux session environment
|
||||
if cfg.TownRoot != "" {
|
||||
env["GT_ROOT"] = cfg.TownRoot
|
||||
}
|
||||
if cfg.BeadsDir != "" {
|
||||
env["BEADS_DIR"] = cfg.BeadsDir
|
||||
}
|
||||
|
||||
// Set BEADS_AGENT_NAME for polecat/crew (uses same format as BD_ACTOR)
|
||||
if cfg.Role == "polecat" || cfg.Role == "crew" {
|
||||
|
||||
Reference in New Issue
Block a user