feat: add custom environment variables for conductor sessions#341
Merged
asheshgoplani merged 1 commit intoasheshgoplani:mainfrom Mar 17, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for conductor-specific environment variables by allowing conductor setup to persist env / env_file into meta.json and sourcing them when launching conductor sessions.
Changes:
- Extends
ConductorMetaandSetupConductor()to persist inline env vars and an env file path. - Adds conductor-specific env sourcing to the existing
buildEnvSourceCommand()pipeline with highest precedence. - Introduces
-env(repeatable) and-env-fileflags toagent-deck conductor setup, plus new/updated unit tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
internal/session/conductor.go |
Adds Env / EnvFile to conductor metadata and persists them during setup. |
internal/session/env.go |
Adds getConductorEnv() and sources conductor env last (highest priority) in env pipeline. |
cmd/agent-deck/conductor_cmd.go |
Adds CLI flags and parsing for repeatable -env KEY=VALUE and -env-file. |
internal/session/conductor_test.go |
Updates existing SetupConductor call sites and adds env-focused setup tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
6c17423 to
12dab6d
Compare
Conductors can now be configured with custom environment variables via -env KEY=VALUE (repeatable) and -env-file flags on conductor setup. This enables running conductors with alternative AI backends (e.g. Z.ai GLM models) by setting ANTHROPIC_BASE_URL and related env vars, matching the existing env support already available for custom tools. - Add Env and EnvFile fields to ConductorMeta (stored in meta.json) - Add getConductorEnv() to env.go that loads conductor env at session start - Add -env and -env-file flags to conductor setup CLI - Add tests for env var storage and retrieval Closes asheshgoplani#256
12dab6d to
def498d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
-env KEY=VALUE(repeatable) and-env-fileflags toconductor setup, enabling conductors to run with custom environment variables. This matches the existing env support already available for custom tools via[tools.X].env.Closes #256
Changes
internal/session/conductor.go: AddEnv map[string]stringandEnvFile stringfields toConductorMeta, updateSetupConductor()signatureinternal/session/env.go: AddgetConductorEnv()— detects conductor sessions by title prefix, loadsmeta.json, and builds export commands. Applied as step 6 inbuildEnvSourceCommand()(highest priority, overrides tool env)cmd/agent-deck/conductor_cmd.go: Add-envand-env-fileflags withenvVarFlagstype for repeatable KEY=VALUE parsing, update help textinternal/session/conductor_test.go: Update existing test calls + addTestSetupConductor_WithEnvVarsandTestSetupConductor_WithoutEnvVarsUsage
Env vars are stored in
meta.jsonand exported before the conductor command launches via the existingbuildEnvSourceCommand()pipeline.Test plan
TestSetupConductor_WithEnvVars— verifies env vars and env_file are stored in meta.jsonTestSetupConductor_WithoutEnvVars— verifies nil env when none providedconductor setupwith-envflags correctly writes to meta.jsonbuildEnvSourceCommand→getConductorEnv) follows the same proven pattern used by custom tools.Note on pre-existing test failures
TestLifecycle_StoppedRestartedRunningErrorandTestStatusCycle_ShellSessionWithCommandfail onmainas well — they are flaky tmux timing tests unrelated to this change.