Skip to content

Register event_blobs (tag 11) in conversation-bundle type registry #18

Description

@colombod

Summary

The conversation-bundle.json type registry only declares tags 1–4 (role, content, tool_calls, timestamp). The cxdb.ConversationItem v3 schema used by amplifier-bundle-context-intelligence defines additional fields, including event_blobs at AssistantTurn tag 11 — a map<string, array<bytes>> that links BLAKE3 blob hashes to the turns they belong to.

Because tag 11 is not registered, the server's typed projection (view=typed, the default) silently drops event_blobs from HTTP responses. Clients must pass ?include_unknown=1&bytes_render=hex as a workaround, which surfaces the field in the "unknown" section with numeric string keys (e.g., "11" instead of "event_blobs").

Current Behavior

GET /v1/contexts/{id}/turns
→ response.data contains only tags 1-4 (role, content, tool_calls, timestamp)
→ tag 11 (event_blobs) is silently dropped

With workaround:

GET /v1/contexts/{id}/turns?include_unknown=1&bytes_render=hex
→ response.unknown["11"] contains the event_blobs data with hex-encoded BLAKE3 hashes

Expected Behavior

Tag 11 should appear in the default view=typed response under its named key event_blobs, with BLAKE3 hashes rendered per the bytes_render parameter (default: base64).

Proposed Fix

Update fixtures/registry/conversation-bundle.json to declare tag 11:

{"tag": 11, "name": "event_blobs", "type": "map", "required": false}

Ideally the full ConversationItem v3 schema should be registered (tags 1–13 for the top-level item, plus nested AssistantTurn, ToolCallItem, TurnMetrics, etc.), but registering tag 11 alone would unblock the most critical use case: linking blob-stored raw LLM request/response data back to the turns they belong to.

Context

  • Client module: cxdb-session-storage in amplifier-bundle-context-intelligence
  • Write path: Blobs are written via PutBlob (binary protocol), BLAKE3 hashes are stored in AssistantTurn.event_blobs (msgpack tag 11) and correctly persisted
  • Read path: HTTP get_turns drops the field because the projection system skips unregistered tags
  • Current client workaround: include_unknown=1&bytes_render=hex + merge unknown section + dual-key lookup ("event_blobs" / "11")
  • Server code: server/src/projection/mod.rs:68-82 — only iterates descriptor.fields, unknown tags require include_unknown flag

Broader Discussion

The current conversation-bundle.json only has 4 fields from what appears to be an older schema version. The actual ConversationItem v3 used by the Amplifier ecosystem has ~30 fields across nested structures (ConversationItem → AssistantTurn → ToolCallItem → TurnMetrics, etc.). It would be worth discussing whether to:

  1. Minimal fix: Just add tag 11 for event_blobs
  2. Full registration: Register the complete ConversationItem v3 schema with all nested types
  3. Client-published registry: Allow clients to publish their own type bundles via PUT /v1/registry/bundles/{id} at connection time (the endpoint already exists)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions