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

+54 -2
View File
@@ -673,7 +673,7 @@ def test_format_history_uses_session_offsets_and_skips_empty_steps():
assert "'Login'" in lines[1]
async def _final_check_human_text(ctx) -> str:
async def _final_check_human_text(ctx, **kwargs) -> str:
report = CheckReport(verdicts=[])
structured = MagicMock()
structured.ainvoke = AsyncMock(return_value=report)
@@ -691,7 +691,9 @@ async def _final_check_human_text(ctx) -> str:
new=AsyncMock(return_value=(None, "elements")),
),
):
await run_final_check(ctx, goal="the goal", plan_text="- [x] G", ledger=[], check_items=[])
await run_final_check(
ctx, goal="the goal", plan_text="- [x] G", ledger=[], check_items=[], **kwargs
)
messages = acomplete_mock.await_args.args[1]
human = messages[-1]
@@ -730,6 +732,56 @@ async def test_final_review_reports_no_guidance_explicitly():
assert "# User guidance received during the run\n(none)\n" in text
@pytest.mark.asyncio
async def test_final_review_receives_verified_file_receipts_without_history_tool_call():
ctx = _mock_ctx()
ctx.data_engine.get_agent_friendly_steps.return_value = [
{
"step_number": 44,
"summary": "已写入报告",
"action_taken": {"action": "android_file"},
"last_execution_result": {
"result": '{"ok":true,"verified":true,"device_path":"/sdcard/report.md","bytes":8022}'
},
}
]
text = await _final_check_human_text(ctx, execution_report="报告保存情况未知")
assert "Recorded File Receipts (tool evidence, not report claims)" in text
assert '"step": 44' in text and '"verified": true' in text
assert "/sdcard/report.md" in text
@pytest.mark.parametrize("entry", ["checkpoint", "final"])
def test_visual_acceptance_requires_counter_evidence_without_exempting_real_defects(entry):
text = assemble_checker_prompt_segments(entry, [], probe_tool_registered=False)
assert "compare recorded pre/post screenshots and nearby steps" in text
assert "user permits this behavior" in text
assert "fixed navigation is not a blanket exemption" in text
assert "explicit visual standard" in text
assert "inconclusive, not failed or automatically passed" in text
@pytest.mark.asyncio
async def test_final_review_distinguishes_actual_delivery_from_report_claims():
text = await _final_check_human_text(
_mock_ctx(),
execution_report="# 完整报告\n实际发现与未测范围",
report_delivery={"report_path": "notes/output.md", "exploration_message_sequences": [12]},
)
assert "# 完整报告" in text
assert "Report Delivery Receipt (recorded by ARTEMIS, not a model claim)" in text
assert '"exploration_message_sequences": [12]' in text
assert "confirms delivery only" in text
assert "against actual device/tool evidence" in text
without_receipt = await _final_check_human_text(_mock_ctx(), execution_report="模型自述已交付")
assert "Report Delivery Receipt" not in without_receipt
failed = await _final_check_human_text(
_mock_ctx(), report_delivery={"ok": False, "verified": False, "error": "disk full"}
)
assert "whether the executor's report was saved" in failed
assert '"verified": false' in failed and "disk full" in failed
@pytest.mark.asyncio
async def test_exploration_review_sees_conversation_and_can_read_earlier_messages():
ctx = _mock_ctx()