mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-12 22:00:57 +00:00
fix(box): tighten sandbox exposure and restore box integration coverage
This commit is contained in:
@@ -1,22 +1,16 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import AsyncMock, Mock
|
||||
|
||||
import pytest
|
||||
|
||||
# TODO: unskip once runner.py adopts TYPE_CHECKING guard to break the circular import
|
||||
pytest.skip(
|
||||
'circular import between runner ↔ app; will be unblocked once resolved',
|
||||
allow_module_level=True,
|
||||
)
|
||||
import langbot_plugin.api.entities.builtin.pipeline.query as pipeline_query
|
||||
import langbot_plugin.api.entities.builtin.provider.message as provider_message
|
||||
import langbot_plugin.api.entities.builtin.provider.session as provider_session
|
||||
|
||||
import json # noqa: E402
|
||||
from types import SimpleNamespace # noqa: E402
|
||||
from unittest.mock import AsyncMock, Mock # noqa: E402
|
||||
|
||||
import langbot_plugin.api.entities.builtin.pipeline.query as pipeline_query # noqa: E402
|
||||
import langbot_plugin.api.entities.builtin.provider.message as provider_message # noqa: E402
|
||||
import langbot_plugin.api.entities.builtin.provider.session as provider_session # noqa: E402
|
||||
|
||||
from langbot.pkg.provider.runners.localagent import LocalAgentRunner # noqa: E402
|
||||
from langbot.pkg.provider.runners.localagent import LocalAgentRunner
|
||||
|
||||
|
||||
class RecordingProvider:
|
||||
@@ -168,6 +162,8 @@ async def test_localagent_uses_sandbox_exec_for_exact_calculation():
|
||||
return_value=(
|
||||
'When sandbox_exec is available, use it for exact calculations, statistics, '
|
||||
'structured data parsing, and code execution instead of estimating mentally. '
|
||||
'Unless the user explicitly asks for the script, code, or implementation details, '
|
||||
'do not include the generated script in the final answer. '
|
||||
'A default host workspace is mounted at /workspace for file tasks.'
|
||||
)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user