From 742bed62eb5c950c3da8735c7e25977ec29f328e Mon Sep 17 00:00:00 2001 From: bowei Date: Mon, 20 Jul 2026 19:19:14 +0800 Subject: [PATCH] langgraph-plan-review: replace hardcoded C:\Users\bowei paths with Path.home()/relative resolution Co-Authored-By: Claude Opus 4.8 (1M context) --- langgraph-plan-review/scripts/review_task.py | 9 +++++---- langgraph-plan-review/scripts/run_langgraph.ps1 | 5 ----- langgraph-plan-review/scripts/run_workflow.py | 3 ++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/langgraph-plan-review/scripts/review_task.py b/langgraph-plan-review/scripts/review_task.py index eed1a1b..70b22c0 100644 --- a/langgraph-plan-review/scripts/review_task.py +++ b/langgraph-plan-review/scripts/review_task.py @@ -77,12 +77,13 @@ def resolve_codex() -> str: if exe and Path(exe).exists(): return exe # 2. Known install paths (checked before PATH to avoid picking up wrong codex variant) + home = Path.home() for candidate in [ - r"C:\Users\bowei\miniconda3\envs\langgraph\codex.cmd", - r"C:\Users\bowei\.conda\envs\langgraph\codex.cmd", + home / "miniconda3" / "envs" / "langgraph" / "codex.cmd", + home / ".conda" / "envs" / "langgraph" / "codex.cmd", ]: - if Path(candidate).exists(): - return candidate + if candidate.exists(): + return str(candidate) # 3. PATH lookup fallback found = shutil.which("codex") or shutil.which("codex.cmd") if found: diff --git a/langgraph-plan-review/scripts/run_langgraph.ps1 b/langgraph-plan-review/scripts/run_langgraph.ps1 index 457b0db..e102b7c 100644 --- a/langgraph-plan-review/scripts/run_langgraph.ps1 +++ b/langgraph-plan-review/scripts/run_langgraph.ps1 @@ -44,11 +44,6 @@ function Resolve-CondaExe { } } - $LegacyFallback = "C:\Users\bowei\miniconda3\Scripts\conda.exe" - if (Test-Path -LiteralPath $LegacyFallback) { - return $LegacyFallback - } - throw "Unable to locate conda. Set -CondaExe or CONDA_EXE, or ensure conda is on PATH." } diff --git a/langgraph-plan-review/scripts/run_workflow.py b/langgraph-plan-review/scripts/run_workflow.py index 490c401..955fd54 100644 --- a/langgraph-plan-review/scripts/run_workflow.py +++ b/langgraph-plan-review/scripts/run_workflow.py @@ -108,10 +108,11 @@ def run_workflow( try: httpx.get(f"{server_url}/ok", timeout=5).raise_for_status() except Exception as exc: + manage_script = Path(__file__).resolve().with_name("manage_dev_server.ps1") raise RuntimeError( f"langgraph dev server not reachable at {server_url}.\n" f"Start it first:\n" - f" PowerShell -File C:\\Users\\bowei\\.claude\\skills\\langgraph-plan-review\\scripts\\manage_dev_server.ps1 start\n" + f" PowerShell -File {manage_script} start\n" f"Error: {exc}" )