Default Flash final review to off and persist the setting across the UI, MCP, SDK and queued tasks. Keep execution separate from test verdicts. Bundle UI fonts and licenses to remove Google Fonts from startup builds. Align backend/frontend versions and document installation and upgrades.
58 lines
2.7 KiB
Python
58 lines
2.7 KiB
Python
"""Credential-free execution settings persisted for repeatable favorites."""
|
|
|
|
from apps.admin_console.services.task_import import TaskOptions
|
|
from artemis.config import load_agent_config, parse_llm_config, verification_level_for_checker
|
|
from artemis.config.settings import settings
|
|
|
|
|
|
def execution_config(item: dict) -> dict:
|
|
agent = load_agent_config()
|
|
model = parse_llm_config().operator
|
|
overrides = item.get("runtime_overrides") or {}
|
|
profile = overrides.get("profile") or item.get("profile") or "flash"
|
|
options = {
|
|
"profile": profile,
|
|
"model": model.model,
|
|
"reasoning_effort": model.reasoning_effort or "default",
|
|
"request_timeout_seconds": model.timeout,
|
|
"max_retries": model.max_retries,
|
|
"retry_interval_seconds": settings.OPENAI_RETRY_INTERVAL_SECONDS,
|
|
"record_video": settings.ARTEMIS_RECORDING_ENABLED,
|
|
"recording": agent.recording.model_dump(),
|
|
"analyze_video": agent.video_analyzer.enable_ledger,
|
|
"timeout_seconds": settings.ARTEMIS_TASK_TIMEOUT_SECONDS,
|
|
"verification_level": verification_level_for_checker(agent.checker),
|
|
"explorer_mode": agent.explorer.resolve(profile=profile),
|
|
"observation_timeout_seconds": settings.ARTEMIS_OBSERVATION_TIMEOUT_SECONDS,
|
|
"observation_max_attempts": settings.ARTEMIS_OBSERVATION_MAX_ATTEMPTS,
|
|
"device_command_timeout_seconds": settings.ARTEMIS_DEVICE_COMMAND_TIMEOUT_SECONDS,
|
|
"action_failure_attempts": settings.ARTEMIS_ACTION_FAILURE_ATTEMPTS,
|
|
"worker_cleanup_timeout_seconds": settings.ARTEMIS_WORKER_CLEANUP_TIMEOUT_SECONDS,
|
|
}
|
|
for key in ("device_serial", "verification_level", "explorer_mode", "locked_app_package"):
|
|
if item.get(key) is not None:
|
|
options[key] = item[key]
|
|
options["recording"] = {**options["recording"], **(overrides.get("recording") or {})}
|
|
options.update({k: v for k, v in overrides.items() if k != "recording" and v is not None})
|
|
return {
|
|
"flash_final_check_enabled": agent.flash.final_check_enabled
|
|
if profile == "flash"
|
|
else None,
|
|
"runtime_overrides": TaskOptions.model_validate(options).model_dump(exclude_none=True),
|
|
"expected_output": item.get("expected_output"),
|
|
"enable_outputter": item.get("enable_outputter")
|
|
if item.get("enable_outputter") is not None
|
|
else agent.outputter.enabled,
|
|
"app_path": item.get("app_path"),
|
|
}
|
|
|
|
|
|
def persist_execution_config(item: dict) -> None:
|
|
from apps.admin_console.services.automation_store import store
|
|
|
|
snapshot = execution_config(item)
|
|
item["execution_config"] = snapshot
|
|
if job := store.job(str(item["session_id"])):
|
|
job["execution_config"] = snapshot
|
|
store.save_job(job)
|