Files
Artemis-Eapil/tests/unit/test_exploration_report_output.py
T
chenmingxuan e1ea099592 feat: add official Codex skill and harden task execution
Install and update artemis-use with task diagnostics and plugin guidance. Preserve cross-device file receipts, review canonical reports, guard stage transitions and reduce small history summaries. Improve exploration lifecycle, request recovery and browser live connections.
2026-10-18 14:18:37 +08:00

40 lines
1.4 KiB
Python

"""The default SDK path must return the answer already prepared for review."""
import json
from types import SimpleNamespace
from unittest.mock import AsyncMock
import pytest
from artemis.config import OutputConfig
from artemis.graph.state import State
from artemis.sdk.agent import Agent
@pytest.mark.asyncio
@pytest.mark.parametrize("outputter_enabled", [True, False])
async def test_default_output_reuses_executor_report_without_another_model(
tmp_path, monkeypatch, outputter_enabled
):
synthesize = AsyncMock()
monkeypatch.setattr("artemis.sdk.agent.outputter", synthesize)
ctx = SimpleNamespace(
execution_setup=SimpleNamespace(
outputter=SimpleNamespace(enabled=outputter_enabled, force_synthesis=False),
disable_outputter=not outputter_enabled,
)
)
result_path = tmp_path / "result.json"
body = "# 调查结果\n双端检查已完成;未测功能不能记为通过。"
result = await Agent._extract_output(
object.__new__(Agent),
task_name="exploration",
ctx=ctx,
request=SimpleNamespace(llm_output_path=result_path),
output_config=OutputConfig(structured_output=None, output_description=None),
state=State(initial_goal="调查", execution_report=body),
)
assert result == body
assert json.loads(result_path.read_text(encoding="utf-8")) == {"result": body}
synthesize.assert_not_called()