From 8c2c597687c083138ac449339962deab57f20beb Mon Sep 17 00:00:00 2001 From: Aaron Nelson Date: Wed, 20 May 2026 00:51:41 +0000 Subject: [PATCH] =?UTF-8?q?api.py:=20save=5Fdocument=20=E2=80=94=20disting?= =?UTF-8?q?uish=20PATH=20miss=20from=20missing=20install=20in=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The systemd unit pins PATH to the venv only, so subprocess.run(['pandoc', ...]) raised FileNotFoundError even though pandoc was installed at /usr/bin/pandoc. The handler's "pandoc not installed" message was misleading — pandoc was reachable from a login shell but not from the service. Rephrased to point at the actual cause: the service's PATH. The systemd drop-in to extend PATH is not committed here (lives at /etc/systemd/system/aaronai.service.d/path.conf on the host). --- scripts/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/api.py b/scripts/api.py index 4647471..c19f94b 100644 --- a/scripts/api.py +++ b/scripts/api.py @@ -537,7 +537,8 @@ def _execute_save_document(tool_input): except subprocess.TimeoutExpired: return "save_document: pandoc timed out (>120s)." except FileNotFoundError: - return "save_document: pandoc not installed." + return ("save_document: pandoc binary not reachable from the api process " + "(check that PATH in aaronai.service includes /usr/bin).") if proc.returncode != 0: err = proc.stderr.decode("utf-8", errors="replace")[:400] return f"save_document: pandoc failed: {err}"