-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
Description
The documentation claims state persists between run() calls (code-execution.mdx Step 5, core-concepts.mdx). In practice, each run() call starts a fresh Python process — variables and functions defined in a previous run() are not available.
Reproduction
import asyncio
import boxlite
async def main():
async with boxlite.CodeBox() as codebox:
await codebox.run("""
import json
def process(data):
return {k: v * 2 for k, v in data.items()}
""")
result = await codebox.run("""
output = process({"a": 1, "b": 2, "c": 3})
print(json.dumps(output))
""")
print(result)
asyncio.run(main())Expected
Second run() can access process() and json from the first run(). Output: {"a": 2, "b": 4, "c": 6}
Actual
NameError: name 'process' is not defined
Environment
- boxlite 0.5.10
- macOS Apple Silicon
- Python 3.12
Notes
Files written to disk do persist (same VM), but Python-level state (variables, imports, function definitions) does not carry over between run() calls.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels