mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:13:19 +08:00
- Add video_generation_client: async video-synthesis, t2v vs i2v (Wan 2.7 input.media first_frame vs legacy img_url). - Coerce *-t2v* to *-i2v* when first frame present; AIA_VIDEO_I2V_INPUT_STYLE / I2V_MODEL overrides. - Gateway/direct_loop early return for video specialist; workspace video + factory allowlist. - Normalize WS and admin chat attachments (image_ref parity); mp4 attachment store roundtrip tests. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
916 B
Python
27 lines
916 B
Python
"""Regression: admin REST and WS share attachment normalization (typed refs must survive parsing)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from oclaw.interfaces.admin.chat_api import _parse_attachments_payload
|
|
|
|
|
|
def test_parse_attachments_payload_preserves_image_ref() -> None:
|
|
att: dict = {"type": "image_ref", "attachment_id": "a" * 64, "mime": "image/png"}
|
|
out = _parse_attachments_payload([att])
|
|
assert out == [att]
|
|
|
|
|
|
def test_parse_attachments_payload_preserves_relay_pointer_image() -> None:
|
|
att: dict = {
|
|
"type": "relay_pointer",
|
|
"mime": "image/jpeg",
|
|
"attachment_id": "b" * 64,
|
|
"pointer_uri": "relay://attachments/x/" + "b" * 64,
|
|
}
|
|
out = _parse_attachments_payload([att])
|
|
assert out == [att]
|
|
|
|
|
|
def test_parse_attachments_payload_empty() -> None:
|
|
assert _parse_attachments_payload(None) is None
|
|
assert _parse_attachments_payload([]) is None
|