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.
This commit is contained in:
1 parent
2328a4df0c
commit
e1ea099592
128 files changed
+4944
-700
No files matched your search
@@ -0,0 +1,40 @@
|
||||
"""Read the impact of deleting a task without deleting or stopping anything."""
|
||||
|
||||
from uuid import UUID
|
||||
|
||||
from artemis.exploration.store import ExplorationConflict, explorations
|
||||
from apps.admin_console.database.repositories.session_repository import session_repo
|
||||
from apps.admin_console.services.automation_store import store
|
||||
from apps.admin_console.services.exploration_deletion import _check_runs
|
||||
|
||||
|
||||
def deletion_preview(session_id: str) -> dict:
|
||||
session_id = str(UUID(session_id))
|
||||
run = explorations.run(session_id)
|
||||
if run and run["kind"] == "exploration":
|
||||
return exploration_deletion_preview(run["exploration_id"])
|
||||
if not session_repo.get_session_by_id(session_id) and not store.job(session_id):
|
||||
raise KeyError("任务不存在")
|
||||
_check_runs([{"id": session_id}])
|
||||
job = store.job(session_id) or {}
|
||||
if job.get("status") in {"pending", "queued", "running", "task_paused", "resuming"}:
|
||||
raise ExplorationConflict("任务仍在执行或排队,请先停止并等待结束")
|
||||
return {
|
||||
"session_ids": [session_id],
|
||||
"preserved_session_ids": [],
|
||||
"removes": ["任务历史", "报告", "截图、录像及附件"],
|
||||
}
|
||||
|
||||
|
||||
def exploration_deletion_preview(exploration_id: str) -> dict:
|
||||
session = explorations.get(exploration_id)
|
||||
runs = explorations.runs(exploration_id)
|
||||
_check_runs(runs)
|
||||
if session.get("active_run_id") or session.get("active_demonstration_id"):
|
||||
raise ExplorationConflict("探索尚有活动任务或示范,请先停止并等待结束")
|
||||
return {
|
||||
"exploration_id": exploration_id,
|
||||
"session_ids": [run["id"] for run in runs if run["kind"] == "exploration"],
|
||||
"preserved_session_ids": [run["id"] for run in runs if run["kind"] != "exploration"],
|
||||
"removes": ["探索对话", "用例版本", "探索执行历史及证据"],
|
||||
}
|
||||
Reference in new issue
Block a user