Skip to content

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
703 B
Raw Blame
"""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}
        )