Description
codexlb2otel emits agent names such as codexlb/codex-tui. OpenTelemetry permits the value, but Grafana Agent Observability interprets a slash as a subagent marker, so normal turns are misclassified and agent filters and counts break.
Acceptance Criteria
- #1 All emitted generation, metric, and trace agent names for known originators contain no slash and preserve distinct originator identity
- #2 An absent originator still emits the stable codexlb fallback rather than becoming anonymous
- #3 Targeted tests and the repository gate pass
Definition of Done
- #1 make check passes: gofmt -l . reports nothing, go vet ./… clean, go test ./… green
- #2 go build ./… succeeds
Implementation Plan
- Change the pinned agent-name expectations to slash-free codexlb-
values and observe the targeted failure. - Change the shared AgentName prefix and update its contract comments and bounded registry catalogue.
- Run targeted tests, make check, and go build ./…; review the staged code; then finalize, commit, and push.
Implementation Notes
Added a focused AgentName regression test covering all three known originators and the missing-originator fallback. Observed it fail against the slash prefix, then changed the shared prefix to a hyphen and updated generation, metric, trace, and bounded-registry expectations. Targeted tests pass.
Verification: the focused regression test failed before the production change and passed after it; generation wire-format, OTLP metric, and OTLP trace contract tests passed; make check passed including the 206-second corpus-backed internal/attr package; go build ./… passed; CodeRabbit reviewed all seven staged files with zero findings.
Final Summary
Changed the shared agent-name prefix from codexlb/ to codexlb- so Grafana Agent Observability no longer classifies ordinary turns as subagents. Preserved distinct originator identities and the non-anonymous codexlb fallback. Verified every sink contract, the full repository gate, the full build, and a zero-finding CodeRabbit review.