diff --git a/agent/runtime_cwd.py b/agent/runtime_cwd.py index ad084ac89..d25d38cce 100644 --- a/agent/runtime_cwd.py +++ b/agent/runtime_cwd.py @@ -25,7 +25,9 @@ def resolve_agent_cwd() -> Path: def resolve_context_cwd() -> Path | None: - # None is load-bearing: it signals "skip context-file discovery" so the - # gateway install dir's AGENTS.md isn't slurped (see system_prompt.py). + # None means "no configured cwd": build_context_files_prompt then falls back + # to the launch dir (os.getcwd()) — correct for the local CLI. The gateway + # avoids slurping its install dir by setting TERMINAL_CWD (see system_prompt.py). + # No getcwd arm here: that fallback is owned by the caller, not this resolver. raw = os.environ.get("TERMINAL_CWD", "").strip() return Path(raw).expanduser() if raw else None