fix: improve cross-device evidence, request diagnostics and prompt efficiency
This commit is contained in:
1 parent
621f30e437
commit
a66803651a
60 files changed
+3097
-160
No files matched your search
@@ -1,6 +1,7 @@
|
||||
"""Per-task archive quality overrides outrank JSON and saved environment defaults."""
|
||||
|
||||
import json
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -77,3 +78,37 @@ def test_worker_env_keeps_task_quality_separate_from_saved_defaults(monkeypatch)
|
||||
{}, "test-run", None, "fixture", "flash", AdbTarget(AdbEndpoint.local())
|
||||
)
|
||||
assert "ARTEMIS_TASK_RECORDING_CONFIG" not in clean_environment
|
||||
|
||||
|
||||
def test_sdk_preserves_task_recording_scope_through_recorder(tmp_path, monkeypatch):
|
||||
from artemis.plugins.models import EvidenceSource
|
||||
from artemis.plugins.recording import PluginRecordings, capture_rectangle
|
||||
from artemis.sdk.builders.agent_config_builder import AgentConfigBuilder
|
||||
|
||||
monkeypatch.setattr(
|
||||
settings,
|
||||
"ARTEMIS_TASK_RECORDING_CONFIG",
|
||||
{"computer_scope": "window", "codec": "h264", "fps": 7, "max_long_edge": 960},
|
||||
)
|
||||
builder = AgentConfigBuilder()
|
||||
config = builder.build()
|
||||
ctx = SimpleNamespace(
|
||||
agent_config=config,
|
||||
data_engine=SimpleNamespace(base_dir=tmp_path, session_start_time=100),
|
||||
execution_setup=SimpleNamespace(record_video_enabled=True),
|
||||
)
|
||||
recorder = PluginRecordings(ctx)
|
||||
source = EvidenceSource(
|
||||
kind="computer",
|
||||
target_id="fixture",
|
||||
window={"left": 40, "top": 50, "width": 800, "height": 600},
|
||||
screen={"left": 0, "top": 0, "width": 1920, "height": 1080},
|
||||
)
|
||||
assert recorder.config.computer_scope == "window"
|
||||
assert capture_rectangle(source, recorder.config.computer_scope) == source.window
|
||||
assert recorder.config.codec == "h264"
|
||||
assert recorder.config.fps == 7
|
||||
assert recorder.config.max_long_edge == 960
|
||||
# Building another task must not share a mutable recording configuration.
|
||||
config.recording.fps = 12
|
||||
assert builder.build().recording.fps == 7
|
||||
Reference in new issue
Block a user