Skip to content

Commit 4bdc2c4

Browse files
fix(box): repair sdk runtime entrypoints and nsjail session parity
1 parent 31c6a85 commit 4bdc2c4

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ authors = [
99
requires-python = ">=3.10"
1010
dependencies = [
1111
"aiofiles>=24.1.0",
12+
"aiohttp>=3.9.0",
1213
"dotenv>=0.9.9",
1314
"httpx>=0.28.1",
1415
"jinja2>=3.1.6",

src/langbot_plugin/box/nsjail_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ async def start_session(self, spec: BoxSpec) -> BoxSessionInfo:
151151
cpus=spec.cpus,
152152
memory_mb=spec.memory_mb,
153153
pids_limit=spec.pids_limit,
154-
read_only_rootfs=True, # always true for nsjail
154+
read_only_rootfs=spec.read_only_rootfs,
155155
created_at=now,
156156
last_used_at=now,
157157
)
@@ -233,7 +233,7 @@ async def start_managed_process(
233233
cpus=session.cpus,
234234
memory_mb=session.memory_mb,
235235
pids_limit=session.pids_limit,
236-
read_only_rootfs=True,
236+
read_only_rootfs=session.read_only_rootfs,
237237
)
238238

239239
args = self._build_nsjail_args(session, pseudo_spec, session_dir)

src/langbot_plugin/box/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,14 @@ async def new_connection_callback(connection: Connection) -> None:
251251
await runner.cleanup()
252252

253253

254-
def main() -> None:
254+
def main(argv: list[str] | None = None) -> None:
255255
parser = argparse.ArgumentParser(description='LangBot Box Runtime Service')
256256
parser.add_argument('--host', default='0.0.0.0', help='Bind address')
257257
parser.add_argument('--port', type=int, default=5410, help='Bind port (ws relay)')
258258
parser.add_argument(
259259
'--mode', choices=['stdio', 'ws'], default='stdio', help='Control channel transport (default: stdio)'
260260
)
261-
args = parser.parse_args()
261+
args = parser.parse_args(argv)
262262

263263
configure_process_logging(stream=sys.stderr)
264264
asyncio.run(_run_server(args.host, args.port, args.mode))

src/langbot_plugin/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def main():
158158
runtime_app.main(args)
159159
case "box":
160160
from langbot_plugin.box.server import main as box_main
161-
box_main()
161+
box_main(sys.argv[2:])
162162
case _:
163163
cli_print("unknown_command", args.command)
164164
sys.exit(1)

0 commit comments

Comments
 (0)