Skip to content

fix: export sourced environment variables - #2

Open
VailElla wants to merge 1 commit into
mcncarl:mainfrom
VailElla:agent/fix-env-exports
Open

fix: export sourced environment variables#2
VailElla wants to merge 1 commit into
mcncarl:mainfrom
VailElla:agent/fix-env-exports

Conversation

@VailElla

@VailElla VailElla commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • export every active variable in .env.example so commands launched after source .env inherit the configured paths and identities
  • generate POSIX shell-safe export statements from bootstrap.py --write-env with shlex.quote
  • add integration tests that source both the example and generated files, then verify values from a Python child process
  • cover current AGENT_MEMORY_* additions, including invariants and local-model configuration

Root cause

The quick start sources .env and then launches Python scripts. Plain shell assignments are visible in the current shell but are not inherited by child processes, so the scripts can silently fall back to the template vault and default state database.

Generated configuration also needs shell quoting because valid vault and configuration paths may contain spaces or shell metacharacters.

Impact

Sourcing either .env.example or an environment file generated by bootstrap.py --write-env now makes the configuration available to child commands. Generated values remain safe for POSIX shells, including paths with spaces and values containing # or single quotes.

The branch is rebased onto current main at 3097fe4 and uses the supported AGENT_MEMORY_* namespace only.

Safety and privacy

  • the change contains only public configuration examples, bootstrap logic, and synthetic tests
  • no real .env, vault content, local configuration, database, logs, credentials, or personal absolute paths are included
  • the current commit uses the GitHub noreply author and committer address
  • the full diff passed private-path, credential, private-key, forbidden-artifact, and whitespace scans

Validation

  • GitHub Actions push run — Python 3.11 and 3.12 jobs passed
  • /usr/bin/python3 -m unittest discover -s tests -p 'test_*.py' — 42 tests passed
  • Python 3.14 full suite — 42 tests passed
  • /usr/bin/python3 -m compileall -q scripts tests
  • /bin/sh -n .env.example
  • /usr/bin/python3 scripts/agent_memory_check.py --skip-state-db
  • isolated child-process check confirms AGENT_MEMORY_ROOT is inherited after sourcing
  • git diff --check upstream/main

Related context: #1

@VailElla
VailElla force-pushed the agent/fix-env-exports branch from 1b59fef to b786c2b Compare July 12, 2026 18:13
@VailElla VailElla changed the title Fix exported memory environment variables fix: export sourced environment variables Jul 12, 2026
@VailElla
VailElla marked this pull request as ready for review July 12, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant