mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
Refactor media payload handling to persist base64 blobs as attachment refs and keep non-turn model paths safe by degrading risky payloads.
This preserves multimodal fidelity for the latest user turn while preventing historical/tool replay bloat, and adds admin UI support for referenced attachment preview/download flows. Made-with: Cursor
This commit is contained in:
parent
3d27a01879
commit
6cfaff06f6
20 changed files with 1626 additions and 101 deletions
|
|
@ -138,7 +138,13 @@ def test_signature_metadata_not_replayed_by_default_for_non_whitelist_model() ->
|
|||
ensure_ascii=False,
|
||||
),
|
||||
event_type="tool_call",
|
||||
)
|
||||
),
|
||||
_Msg(
|
||||
"tool",
|
||||
json.dumps({"ok": True}),
|
||||
tool_calls=json.dumps({"tool_call_id": "call_1", "name": "t"}, ensure_ascii=False),
|
||||
event_type="tool_result",
|
||||
),
|
||||
]
|
||||
msgs = build_llm_messages(store_messages=rows, system_prompt="s", model=model, lang="zh")
|
||||
assistant = [m for m in msgs if m.get("role") == "assistant"][0]
|
||||
|
|
@ -158,7 +164,13 @@ def test_signature_metadata_can_be_forced_on_via_env(monkeypatch) -> None:
|
|||
ensure_ascii=False,
|
||||
),
|
||||
event_type="tool_call",
|
||||
)
|
||||
),
|
||||
_Msg(
|
||||
"tool",
|
||||
json.dumps({"ok": True}),
|
||||
tool_calls=json.dumps({"tool_call_id": "call_1", "name": "t"}, ensure_ascii=False),
|
||||
event_type="tool_result",
|
||||
),
|
||||
]
|
||||
msgs = build_llm_messages(store_messages=rows, system_prompt="s", model=model, lang="zh")
|
||||
assistant = [m for m in msgs if m.get("role") == "assistant"][0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue