Skip to content

Add org.opencontainers.image.title annotation to skill layer descriptors #70

@JAORMX

Description

@JAORMX

Problem

When pulling a published skill artifact with oras pull, the layer is skipped because it lacks the org.opencontainers.image.title annotation:

Skipped pulling layers without file name in "org.opencontainers.image.title"
Use 'oras copy ghcr.io/stacklok/toolhive/skills/toolhive-cli-user:latest --to-oci-layout <layout-dir>' to pull all layers.

oras pull uses this annotation to determine the output filename for each layer. Without it, ORAS has no way to know what to name the file, so it skips the layer entirely.

Root cause

In oci/skills/packager.go, the createManifest function builds the layer descriptor without any annotations:

Layers: []ocispec.Descriptor{
    {
        MediaType: ocispec.MediaTypeImageLayerGzip,
        Digest:    layerDigest,
        Size:      int64(len(layerBytes)),
    },
},

Proposed fix

Add org.opencontainers.image.title to the layer descriptor:

Layers: []ocispec.Descriptor{
    {
        MediaType: ocispec.MediaTypeImageLayerGzip,
        Digest:    layerDigest,
        Size:      int64(len(layerBytes)),
        Annotations: map[string]string{
            ocispec.AnnotationTitle: "skill.tar.gz",
        },
    },
},

This is a one-line change in packager.go and aligns with the OCI image spec and ORAS conventions for pullable artifacts.

Workaround

Until this is fixed, users can inspect skill artifacts using:

  • oras copy <ref> --to-oci-layout <dir> to get the full OCI layout
  • oras blob fetch <ref>@<digest> --output skill.tar.gz to fetch the layer by digest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions