JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(sandbox): accept gateway agent type
guozirui1396b1e538416
diff --git a/jiuwenswarm/server/handlers/sandbox.py b/jiuwenswarm/server/handlers/sandbox.pyindex 502dc6baca..e07bcdc4c5 100644--- a/jiuwenswarm/server/handlers/sandbox.py+++ b/jiuwenswarm/server/handlers/sandbox.py@@ -45,6 +45,7 @@ _SANDBOX_FILES_PARAMS = frozenset("project_dir","cwd","mode", # injected by gateway for agent routing+ "agent_type", # injected by gateway for AgentOS routing})diff --git a/tests/unit_tests/server/test_sandbox_params.py b/tests/unit_tests/server/test_sandbox_params.pynew file mode 100644index 0000000000..af2cf4bb10--- /dev/null+++ b/tests/unit_tests/server/test_sandbox_params.py@@ -0,0 +1,23 @@+"""Regression tests for gateway-injected sandbox command parameters."""++import pytest++from jiuwenswarm.server.handlers.sandbox import _reject_extra_sandbox_files_params+++def test_sandbox_files_accepts_gateway_agent_type() -> None:+ _reject_extra_sandbox_files_params(+ {+ "sub": "files.allow",+ "path": "/workspace",+ "mode": "agent",+ "agent_type": "opencode",+ }+ )+++def test_sandbox_files_still_rejects_unknown_params() -> None:+ with pytest.raises(ValueError, match="unexpected parameter.*unknown"):+ _reject_extra_sandbox_files_params(+ {"sub": "files.allow", "path": "/workspace", "unknown": True}+ )