INNER CODE UNIT · Python
_last_result_path
kevinpbuckley/VibeUE · Content/Python/vibeue.py:234
def _last_result_path(pid=None):
return os.path.join(_signals_dir(), "python-{}-last.json".format(pid or os.getpid()))
def _runs_path(pid=None):
return os.path.join(_signals_dir(), "python-{}-runs.jsonl".format(pid or os.getpid()))
def last_python_result(pid=None):
"""The persisted result of the most recent execute_python_code run in THIS editor process, as a
dict (keys: runId, pid, success, label, output, error, result, execution_time_ms, startedUtc,
finishedUtc), or None if nothing has been recorded.
Use after a call timed out: `execute_python_code("import vibeue; print(vibeue.last_python_result())")`
returns the lost run because the read happens before this call's own result is persisted. Note
that a SECOND such read reflects the first read, not the original run — use its runId with
python_run() for a stable handle, or read it once and keep it.
"""