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:
chenmingxuan committed 2026-10-18 14:18:37 +08:00
1 parent 2328a4df0c
commit e1ea099592
128 files changed
+4944 -700

No files matched your search

+30 -1
View File
@@ -249,6 +249,12 @@ async def exit_settlement_node(state: State, ctx: ArtemisContext):
if needs_exploration_turn(ctx):
return {"exit_settlement_route": "continue"}
if (
getattr(ctx, "exploration_id", None)
and not getattr(ctx, "assert_halt", False)
and not _execution_report(state)
):
return {"exit_settlement_route": "continue"}
stop_capture = getattr(ctx, "on_execution_review", None)
if stop_capture:
await stop_capture()
@@ -296,6 +302,17 @@ async def _exit_settlement_node(state: State, ctx: ArtemisContext):
logger.error(f"Failed to read task plan at settlement: {e}")
snapshot = parse_plan(plan_text)
execution_report = _execution_report(state)
report_delivery = None
if execution_report and getattr(ctx, "exploration_id", None):
from artemis.exploration.report import save_execution_report
# Delivery is a real, persisted event. The reviewer can inspect the
# complete answer without treating its business claims as evidence.
report_delivery = save_execution_report(ctx, execution_report)
if needs_exploration_turn(ctx):
return {"exit_settlement_route": "continue"}
setup = ctx.execution_setup
user_stopped = bool(getattr(state, "user_stop_requested", False))
halted = bool(getattr(ctx, "assert_halt", False))
@@ -336,6 +353,8 @@ async def _exit_settlement_node(state: State, ctx: ArtemisContext):
ledger=ledger,
check_items=list(snapshot.all_check_items),
attempt_id=final_attempt_id,
execution_report=execution_report,
report_delivery=report_delivery,
),
timeout=checkpoint_timeout,
)
@@ -951,6 +970,11 @@ def wrap_update_note_tool(ctx: ArtemisContext, original_tool):
)
def _execution_report(state: State) -> str | None:
report = getattr(state, "execution_report", None)
return report if isinstance(report, str) and report.strip() else None
def convergence_gate(
state: State, ctx: ArtemisContext
) -> Literal["continue", "exit_settlement", "end"]:
@@ -973,10 +997,15 @@ def convergence_gate(
except Exception:
return ""
def _terminal_route() -> Literal["exit_settlement", "end"]:
def _terminal_route() -> Literal["continue", "exit_settlement", "end"]:
"""Settlement and final review are decoupled from each other but share
the entry: any check item, in-flight/queued attempt, ledger record, or
an enabled final review forces the settlement node."""
if getattr(ctx, "exploration_id", None) and not getattr(ctx, "assert_halt", False):
if not _execution_report(state):
return "continue"
# Even with verification disabled, persist and deliver the report.
return "exit_settlement"
plan_snapshot = parse_plan(_read_plan())
needs_settlement = (
bool(plan_snapshot.all_check_items)
+5
View File
@@ -105,6 +105,11 @@ class State(BaseModel):
] = None
# ── Turn products (previous turn's decisions & results) ──────────────
execution_report: Annotated[
str | None,
"Executor's final answer, prepared before review; cleared on resumed execution",
take_last,
] = None
current_step_id: Annotated[str | None, "Current step ID from data engine", take_last] = None
structured_decisions: Annotated[
str | None,
+3 -2
View File
@@ -99,6 +99,7 @@ NODE_VISIBILITY: dict[str, NodeVisibility] = {
},
writes={
"structured_decisions",
"execution_report",
"operator_raw_thinking",
"operator_native_thinking",
"indexed_points",
@@ -164,11 +165,11 @@ NODE_VISIBILITY: dict[str, NodeVisibility] = {
writes=set(),
),
"convergence": _vis(
reads={"checker_success", "user_stop_requested"},
reads={"checker_success", "user_stop_requested", "execution_report"},
writes=set(),
),
"exit_settlement": _vis(
reads={"user_stop_requested", "initial_goal"},
reads={"user_stop_requested", "initial_goal", "execution_report"},
writes={"exit_settlement_route", "operator_feedback", "run_outcome"},
),
}