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
@@ -74,7 +74,9 @@ __all__ = ["McpActionExecutor"]
|
||||
|
||||
#: Non-device tools executed agent-side (never behind the action server).
|
||||
AGENT_TOOL_NAMES: frozenset[str] = (
|
||||
frozenset({"read_note", "list_notes", "ask_explorer", "video_analyzer", "android_file"})
|
||||
frozenset(
|
||||
{"read_note", "list_notes", "save_note", "ask_explorer", "video_analyzer", "android_file"}
|
||||
)
|
||||
| HISTORY_TOOL_NAMES
|
||||
)
|
||||
|
||||
@@ -764,6 +766,8 @@ class McpActionExecutor:
|
||||
)
|
||||
elif raw_name == "list_notes":
|
||||
text = await self._list_notes()
|
||||
elif raw_name == "save_note":
|
||||
text = await self._save_note(args)
|
||||
elif raw_name == "video_analyzer":
|
||||
text, ok = await self._video_analyzer(
|
||||
args.get("time_description") or args.get("TimeDescription") or "",
|
||||
@@ -801,6 +805,23 @@ class McpActionExecutor:
|
||||
raw_result=blocks,
|
||||
)
|
||||
|
||||
async def _save_note(self, args: dict) -> str:
|
||||
from artemis.core.tool_failure import ToolFailure
|
||||
from artemis.tools.scratchpad import SaveNoteArgs
|
||||
from artemis.utils.notes import save_verified_note
|
||||
|
||||
try:
|
||||
value = SaveNoteArgs.model_validate(args)
|
||||
base_dir = getattr(self.ctx.data_engine, "base_dir", None)
|
||||
if not isinstance(base_dir, (str, Path)):
|
||||
raise ValueError("当前任务没有可用的 trace 目录")
|
||||
if value.key.lower().removesuffix(".md") == "output":
|
||||
raise ValueError("output 由最终答复自动保存;独立报告请使用 report 等其他 key")
|
||||
receipt = save_verified_note(base_dir, value.key, value.content)
|
||||
return json.dumps(receipt, ensure_ascii=False)
|
||||
except (OSError, ValueError) as exc:
|
||||
return ToolFailure(f"任务文本保存失败:{exc}")
|
||||
|
||||
async def _read_note(self, key: str, start_line: int | None, end_line: int | None) -> str:
|
||||
try:
|
||||
base_dir = self.ctx.data_engine.base_dir if self.ctx.data_engine else None
|
||||
|
||||
Reference in new issue
Block a user