feat(persistence): enforce image reference storage contract

- Reject structured inline images on ORM and Core writes
- Route plugin run results through the media-aware journal
- Redact legacy inline images before merging run metadata
- Cover storage contracts and regressions on SQLite and PostgreSQL
This commit is contained in:
BiFangKNT
2026-10-18 12:26:09 +08:00
parent 1e5aeb6032
commit b73f66a234
17 changed files with 577 additions and 21 deletions
+8 -4
View File
@@ -469,12 +469,16 @@ def register(h):
if payload_error:
return handler.ActionResponse.error(message=payload_error)
event = await store.append_event(
from ..agent.runner.run_journal import AgentRunJournal
event = await AgentRunJournal(h.ap).append_run_result(
run_id=str(target_run_id),
sequence=sequence,
event_type=str(event_type),
data=event_payload,
usage=usage if isinstance(usage, dict) else None,
result_dict={
'type': str(event_type),
'data': event_payload,
'usage': usage if isinstance(usage, dict) else None,
},
source=str(data.get('source') or result.get('source') or 'runner'),
metadata=metadata,
)