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
@@ -19,9 +19,65 @@ from artemis.data_engine.models import ImageRecord, SessionMetadata, StepRecord
|
||||
from artemis.data_engine.storage import StorageManager
|
||||
from artemis.memory.transcript import TranscriptLedger
|
||||
from artemis.plugins.results import plugin_result_messages
|
||||
from artemis.plugins.models import PluginCallResult
|
||||
from artemis.plugins.runtime import PluginRuntime
|
||||
from artemis.tools.history.screenshot import load_step_screenshot
|
||||
|
||||
|
||||
def test_large_tree_deduplicates_without_mutating_raw_evidence():
|
||||
tree = "- Button abc\n" * 3000
|
||||
result = PluginCallResult(
|
||||
status="success",
|
||||
plugin_id="test",
|
||||
content=[{"type": "text", "text": "Screenshot\n" + tree}],
|
||||
structured_content={
|
||||
"tree_markdown": tree,
|
||||
"capture_id": "capture-current",
|
||||
"window_bounds": {"width": 2560},
|
||||
},
|
||||
)
|
||||
text = result.text()
|
||||
assert text.count(tree) == 1
|
||||
assert result.structured_content["tree_markdown"] == tree
|
||||
assert "capture-current" in text and "2560" in text
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mode", ["flash", "pro"])
|
||||
def test_verified_receipts_survive_observation_truncation_for_both_modes(mode):
|
||||
receipt = {
|
||||
"path": "artifacts/plugins/test/screen.png",
|
||||
"sha256": "a" * 64,
|
||||
"bytes": 123,
|
||||
"media_type": "image/png",
|
||||
}
|
||||
result = PluginCallResult(
|
||||
status="success",
|
||||
plugin_id="test",
|
||||
content=[{"type": "text", "text": "TREE " * 10000}],
|
||||
attachments=[receipt],
|
||||
)
|
||||
if mode == "flash":
|
||||
blocks = PluginRuntime.content_blocks(result)
|
||||
else:
|
||||
action = _action("call", attachments=[receipt])
|
||||
action["result"] = result.text()
|
||||
blocks = plugin_result_messages({"execution": [action]}, None)["call"][0].content
|
||||
text = str(blocks)
|
||||
assert receipt["path"] in text and receipt["sha256"] in text
|
||||
assert "verified file receipts" in text
|
||||
assert "观察文本已节选" in text
|
||||
assert len(text) < 14000
|
||||
|
||||
|
||||
def test_plugin_claim_does_not_become_runtime_receipt():
|
||||
result = PluginCallResult(
|
||||
status="success",
|
||||
plugin_id="test",
|
||||
structured_content={"attachments": [{"path": "pretend.png", "verified": True}]},
|
||||
)
|
||||
assert "verified file receipts" not in str(PluginRuntime.content_blocks(result))
|
||||
|
||||
|
||||
def _action(call_id, name="plug_test_get_app_state", **kwargs):
|
||||
return dict(
|
||||
action=name,
|
||||
|
||||
Reference in new issue
Block a user