mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 09:20:49 +08:00
feat(video): DashScope video specialist with correct i2v request bodies
- 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>
This commit is contained in:
parent
398d85ba06
commit
4335040a27
21 changed files with 1152 additions and 56 deletions
27
tests/test_chat_attachments_payload.py
Normal file
27
tests/test_chat_attachments_payload.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"""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
|
||||
Loading…
Add table
Add a link
Reference in a new issue