diff --git a/scripts/run_integration.py b/scripts/run_integration.py index f252dd3f3..28078c626 100644 --- a/scripts/run_integration.py +++ b/scripts/run_integration.py @@ -735,6 +735,11 @@ def run(command, *, cwd=output, env=base_env, timeout=600) -> str: runtime_paths = [runtime_bin, agent_bin, tool_bin] if os.name == "nt": system_root = Path(base_env["SYSTEMROOT"]) + # Copilot's shell tool tries pwsh first; Windows PowerShell alone can miss its 40s + # startup probe on a cold runner and leave Copilot without a shell. + pwsh = shutil.which("pwsh", path=base_env.get("PATH")) + if "copilot" in agents and pwsh: + runtime_paths.append(Path(pwsh).parent) runtime_paths.extend( [ system_root / "System32", diff --git a/tests/integration/test_ug_copilot_headless.py b/tests/integration/test_ug_copilot_headless.py index cae6f08a7..5983853de 100644 --- a/tests/integration/test_ug_copilot_headless.py +++ b/tests/integration/test_ug_copilot_headless.py @@ -68,7 +68,7 @@ def test_ug_copilot_headless_gpt_responses_task(live_session, workspace): "--model", CODEX_TEST_MODEL, "-p", - task.prompt, + task.prompt_with_path, *COPILOT_HEADLESS_FLAGS, timeout=180, ) diff --git a/tests/integration/test_ug_copilot_lifecycle.py b/tests/integration/test_ug_copilot_lifecycle.py index 5781578b8..5d30cdff3 100644 --- a/tests/integration/test_ug_copilot_lifecycle.py +++ b/tests/integration/test_ug_copilot_lifecycle.py @@ -205,7 +205,7 @@ def test_ug_configure_copilot_repeat_and_revert(live_session, workspace): "--model", CODEX_TEST_MODEL, "-p", - task.prompt, + task.prompt_with_path, *COPILOT_HEADLESS_FLAGS, timeout=180, ) @@ -261,7 +261,7 @@ def test_ug_copilot_upgrade_scrubs_token_saved_by_older_ug(live_session, workspa "--model", CODEX_TEST_MODEL, "-p", - task.prompt, + task.prompt_with_path, *COPILOT_HEADLESS_FLAGS, timeout=180, ) diff --git a/tests/integration/utils/evidence.py b/tests/integration/utils/evidence.py index 0e6e32c55..e5f19f8db 100644 --- a/tests/integration/utils/evidence.py +++ b/tests/integration/utils/evidence.py @@ -169,6 +169,11 @@ def __init__(self, session): f"Read the local file {self.filename} in the current directory using a tool. " "Reply with only its contents." ) + # Small models can drop path segments after a space when rebuilding the absolute path. + self.prompt_with_path = ( + f"Read the local file {session.cwd / self.filename} using a tool. " + "Reply with only its contents." + ) self.delegate_prompt = ( f"Delegate this task to one subagent: read the local file {self.filename} in the " "current directory using a tool and return its contents. Do not read the file "