From 00d8ae1404ffe282a307bf4d63e41b70c7af2219 Mon Sep 17 00:00:00 2001 From: danielmeppiel Date: Tue, 28 Oct 2025 12:29:30 +0100 Subject: [PATCH] fix: pass env dict to setup_runtime_environment to preserve CI tokens The runtime manager was calling setup_runtime_environment() without passing the env dict, which caused it to create a new os.environ.copy() and lose any tokens set in the CI environment. This fixes integration test failures where GITHUB_TOKEN and other secrets configured in GitHub Actions weren't reaching the runtime setup scripts, causing unauthenticated API requests and rate limiting. Fixes integration test failures in PR #8 and similar CI environments. --- src/apm_cli/runtime/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apm_cli/runtime/manager.py b/src/apm_cli/runtime/manager.py index 870e0b2a..a737f2ed 100644 --- a/src/apm_cli/runtime/manager.py +++ b/src/apm_cli/runtime/manager.py @@ -131,7 +131,7 @@ def run_embedded_script(self, script_content: str, common_content: str, # - GITHUB_TOKEN: User authentication for GitHub Models (Codex CLI) # Setup GitHub tokens using centralized manager - env = setup_runtime_environment() # General token setup for scripts + env = setup_runtime_environment(env) # Pass env to preserve CI tokens result = subprocess.run( cmd,