docs(agent): correct resolve_context_cwd comment (None → caller getcwd fallback, not skip)

This commit is contained in:
firefly
2026-05-29 17:44:32 -04:00
committed by Teknium
parent f90777a6b8
commit eadfeef60e

View File

@ -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