[internal/cmd/pdatagen] Parsing of non-packed primitive arrays (#13730)
commit 826dfcd ↗ · open-telemetry/opentelemetry-collector · · committed Aug 29, 2025 · +491−256 · base 2b9b63d5bdd1
Agent prompt
what a new run launched now would send
The Collector’s pdatagen-generated Protobuf unmarshaller currently accepts only the packed encoding for repeated primitive fields (a single field tag with wire type LEN). Per the Protobuf encoding rules, parsers must also accept the non-packed form—repeating the field tag with wire type VARINT, I32, or I64 for each element—so that adding packed=true remains forward- and backward-compatible.
Slightly off-spec clients that emit unpacked repeated primitives therefore fail when exporting telemetry to the Collector (notably Histogram, ExponentialHistogram, and Profile payloads that rely on those repeated fields).
Make unmarshalling of repeated primitive fields accept both packed and unpacked wire encodings, keep packed decoding working, and still reject genuinely wrong wire types. Fix this in the pdatagen unmarshal code generator so regenerated pdata unmarshallers stay correct, regenerate as needed, and add tests under pdata/internal that manually encode unpacked HistogramDataPoint and ExponentialHistogramDataPoint_Buckets payloads and assert they unmarshal successfully to the expected values.
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_opentelemetry-collector_c826dfcda3a85`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
Reference diff
The task commit's diff against its first parent — the judge's comparison target.