Context
Follow-up to #956 / PR #958 (cross-flavor inline image + video). v1 ships a unified generated-image wire path with optional source provenance (ingress, flavor, toolCallId, toolName). This issue tracks the full artifact-event model proposed by @Necmttn on #956.
Problem
Inline media enters HAPI through multiple ingress paths (display_image / display_video MCP, ACP image blocks, Codex/tool-result images, future #508 tool-result base64). Operators and overseer tooling need one comparable record per inline artifact, not just bytes + a chat card.
Proposed v2 artifact event (seed spec — please confirm)
Each inline media display should be traceable as an artifact linked to its producer:
| Field |
Purpose |
sessionId |
HAPI session row |
ingress |
mcp | acp | tool_result (v1 source.ingress) |
flavor |
Agent flavor when known (cursor, codex, gemini, …) |
toolCallId |
Producer tool call when applicable |
toolName |
e.g. display_image, display_video, or native tool name |
artifactId |
Stable id (= current imageId / generated-media store key in v1) |
mimeType |
e.g. image/png, video/mp4 |
byteSize |
Stored payload size |
contentHash |
Optional digest for dedup / audit |
hubRoute |
e.g. GET /api/sessions/:id/generated-images/:artifactId |
renderStatus |
e.g. registered | fetched | failed |
visibilityOutcome |
e.g. inline chat card shown | empty card | fetch error |
v1 already emits a subset on the chat message (source + imageId + mime). v2 would persist/query artifact rows (likely overseer/events substrate or hub-side registry) without changing the chat card UX.
Please review this field list and comment:
- Confirm this is the right minimal artifact shape, or
- Revise (add/remove/rename fields — especially
ingress vs path, and whether renderStatus / visibilityOutcome should be hub-owned vs web-reported)
Non-goals (this issue)
- Renaming
generated-image message type or hub route (can be a separate cleanup)
- Cursor IDE composer inline media (HAPI web only)
References
Context
Follow-up to #956 / PR #958 (cross-flavor inline image + video). v1 ships a unified
generated-imagewire path with optionalsourceprovenance (ingress,flavor,toolCallId,toolName). This issue tracks the full artifact-event model proposed by @Necmttn on #956.Problem
Inline media enters HAPI through multiple ingress paths (
display_image/display_videoMCP, ACP image blocks, Codex/tool-result images, future #508 tool-result base64). Operators and overseer tooling need one comparable record per inline artifact, not just bytes + a chat card.Proposed v2 artifact event (seed spec — please confirm)
Each inline media display should be traceable as an artifact linked to its producer:
sessionIdingressmcp|acp|tool_result(v1source.ingress)flavortoolCallIdtoolNamedisplay_image,display_video, or native tool nameartifactIdimageId/ generated-media store key in v1)mimeTypeimage/png,video/mp4byteSizecontentHashhubRouteGET /api/sessions/:id/generated-images/:artifactIdrenderStatusregistered|fetched|failedvisibilityOutcomev1 already emits a subset on the chat message (
source+imageId+ mime). v2 would persist/query artifact rows (likely overseer/events substrate or hub-side registry) without changing the chat card UX.Ask for @Necmttn
Please review this field list and comment:
ingressvspath, and whetherrenderStatus/visibilityOutcomeshould be hub-owned vs web-reported)Non-goals (this issue)
generated-imagemessage type or hub route (can be a separate cleanup)References
cli/src/modules/common/inlineMediaSource.ts, wire fieldsourceongenerated-imagemessages