fix(dog): set BD_ACTOR environment variable for dog sessions
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Successful in 26s
CI / Test (push) Failing after 1m39s
CI / Lint (push) Successful in 26s
CI / Integration Tests (push) Successful in 1m25s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled

Dogs spawned by gt dog dispatch couldn't find their mail because BD_ACTOR
wasn't set in their tmux environment. The AgentEnv function had no case for
the "dog" role.

Add "dog" case to AgentEnv that sets:
- BD_ACTOR=deacon/dogs/<name>
- GIT_AUTHOR_NAME=dog-<name>
- GIT_AUTHOR_EMAIL=dog-<name>@gastown.local

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 20:55:32 -08:00
committed by John Ogle
parent 4ed3e983f6
commit 169cc76e74
2 changed files with 22 additions and 0 deletions

View File

@@ -61,6 +61,11 @@ func AgentEnv(cfg AgentEnvConfig) map[string]string {
env["GIT_AUTHOR_NAME"] = "boot" env["GIT_AUTHOR_NAME"] = "boot"
env["GIT_AUTHOR_EMAIL"] = "boot@gastown.local" env["GIT_AUTHOR_EMAIL"] = "boot@gastown.local"
case "dog":
env["BD_ACTOR"] = fmt.Sprintf("deacon/dogs/%s", cfg.AgentName)
env["GIT_AUTHOR_NAME"] = fmt.Sprintf("dog-%s", cfg.AgentName)
env["GIT_AUTHOR_EMAIL"] = fmt.Sprintf("dog-%s@gastown.local", cfg.AgentName)
case "witness": case "witness":
env["GT_RIG"] = cfg.Rig env["GT_RIG"] = cfg.Rig
env["BD_ACTOR"] = fmt.Sprintf("%s/witness", cfg.Rig) env["BD_ACTOR"] = fmt.Sprintf("%s/witness", cfg.Rig)

View File

@@ -125,6 +125,23 @@ func TestAgentEnv_Boot(t *testing.T) {
assertNotSet(t, env, "BEADS_NO_DAEMON") assertNotSet(t, env, "BEADS_NO_DAEMON")
} }
func TestAgentEnv_Dog(t *testing.T) {
t.Parallel()
env := AgentEnv(AgentEnvConfig{
Role: "dog",
AgentName: "alpha",
TownRoot: "/town",
})
assertEnv(t, env, "GT_ROLE", "dog")
assertEnv(t, env, "BD_ACTOR", "deacon/dogs/alpha")
assertEnv(t, env, "GIT_AUTHOR_NAME", "dog-alpha")
assertEnv(t, env, "GIT_AUTHOR_EMAIL", "dog-alpha@gastown.local")
assertEnv(t, env, "GT_ROOT", "/town")
assertNotSet(t, env, "GT_RIG")
assertNotSet(t, env, "BEADS_NO_DAEMON")
}
func TestAgentEnv_WithRuntimeConfigDir(t *testing.T) { func TestAgentEnv_WithRuntimeConfigDir(t *testing.T) {
t.Parallel() t.Parallel()
env := AgentEnv(AgentEnvConfig{ env := AgentEnv(AgentEnvConfig{