Skip to content

Commit 8486366

Browse files
fix(interpreter): resolve state file path before chdir
The state file path is resolved to an absolute path before temp_working_directory() changes the working directory. A relative state file (e.g. the default state.kore) would otherwise be looked up inside the temp dir, causing krun to fail with "File does not exist". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c0bd64f commit 8486366

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/komet_node/interpreter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ def run_request_file(self, input_file: Path, request_str: str) -> InterpreterRes
337337
empty and request.json exists, reads the file, dispatches #handleRequest, then
338338
removes the file and halts — leaving the updated idle state as output.
339339
"""
340+
# Resolve to an absolute path before temp_working_directory() chdir's away,
341+
# otherwise a relative state file (e.g. the default `state.kore`) would be
342+
# looked up inside the temp dir and krun would fail with "File does not exist".
343+
input_file = input_file.resolve()
340344
with temp_working_directory() as root:
341345
(root / REQUEST_FILE).write_text(request_str)
342346

0 commit comments

Comments
 (0)