childenv

package
v1.9.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package childenv builds the environment for a child process that agent-deck spawns (claude workers, pooled MCP servers), guaranteed not to inherit the conductor's telegram pollution.

It lives in its own leaf package — not in internal/session — because internal/session imports internal/mcppool, so mcppool cannot import session. Both packages (and cmd/agent-deck) import this leaf so a single filter is the only way to construct a child env. Direct os.Environ() in the spawn-path packages is forbidden by golangci forbidigo (see .golangci.yml); this is the one allowlisted home for it.

Issue #1163: a child must NEVER inherit the parent's CLAUDE_CONFIG_DIR. The conductor's config dir points at a worker-scratch profile whose settings.json enables the telegram plugin; inheriting it makes the child load telegram and spawn a duplicate poller. #1152 stripped TELEGRAM_* but not CLAUDE_CONFIG_DIR — this closes that gap structurally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterEnv

func FilterEnv(env []string, childConfigDir string) []string

FilterEnv returns env with every TELEGRAM_* var and any inherited CLAUDE_CONFIG_DIR removed. If childConfigDir is non-empty, a single CLAUDE_CONFIG_DIR=<childConfigDir> is appended so the child is pinned to its own config dir. The input slice is not mutated.

func ForLaunch

func ForLaunch(childConfigDir string) []string

ForLaunch is FilterEnv applied to the current process environment. This is the only place os.Environ() is called from a spawn path.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL