fix(hypotheses): symlink .env into worktree for local dev
load_dotenv() in tradingagents/config.py searches the cwd for .env. Worktrees in /tmp/ don't have one, so symlink the main repo's .env into the worktree root before running discovery. In CI, secrets are passed as env vars directly — symlink is a no-op. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a956863c48
commit
9e1c800f01
|
|
@ -131,6 +131,13 @@ def run_hypothesis(hyp: dict) -> bool:
|
|||
run(["git", "fetch", "origin", branch], check=False)
|
||||
run(["git", "worktree", "add", worktree, branch])
|
||||
|
||||
# Symlink .env from main repo into worktree so load_dotenv() finds it locally.
|
||||
# In CI, secrets are env vars already — the symlink is a no-op there.
|
||||
env_src = ROOT / ".env"
|
||||
env_dst = Path(worktree) / ".env"
|
||||
if env_src.exists() and not env_dst.exists():
|
||||
env_dst.symlink_to(env_src)
|
||||
|
||||
try:
|
||||
result = subprocess.run(
|
||||
[
|
||||
|
|
|
|||
Loading…
Reference in New Issue