Skip to content

Inline media artifact events (follow-up to #956) #966

Description

@heavygee

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.

Ask for @Necmttn

Please review this field list and comment:

  1. Confirm this is the right minimal artifact shape, or
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCLI, runner, agent wrappersarea:hubHub server (API, sync, store)area:webWeb PWA / React clientenhancementNew feature or requeststatus:needs-triageNot yet classifiedtype:rfcArchitecture / design discussion

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions