design(compass-agent): loop OpenTelemetry activation record (RIG-2508) - #561
Open
rigel-mintaka wants to merge 1 commit into
Open
design(compass-agent): loop OpenTelemetry activation record (RIG-2508)#561rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
|
Compass engineering docs preview: https://compass-agent-rig-2508-loop.compass-eng-docs.pages.dev Deployed from Changed pages: |
Frozen-on-merge design record for activating OpenTelemetry on the compass-agent agent loop and composing it with the transport's already-merged Effect-scoped OTel (RIG-2518). ## The finding that reframes the issue RIG-2508 was scoped as "adopt OTel on the loop" on the premise that the loop is plain-TS on the OMP SDK and needs a from-scratch adoption. That premise is false. OMP (`@oh-my-pi/pi-agent-core`, `pi-coding-agent`) ships full native GenAI-semantic-convention loop telemetry (`invoke_agent > chat` / `execute_tool` / `handoff` spans) that is opt-in and simply never switched on: compass-agent's sole `createAgentSession` call passes no `telemetry` and sources no `OTEL_*`. So this is **activation + composition**, not adoption. ## What the record decides - **Approach:** mirror OMP's own CLI activation pattern in compass-agent's first-party entrypoint (`cli.ts` `main()`) — reuse `@oh-my-pi/pi-coding-agent/telemetry-export`'s `initTelemetryExport()` / `isTelemetryExportEnabled()` (a declared wildcard subpath export) rather than writing a first-party registration module. Off by default (no OTLP endpoint → no provider → no egress → black-box behaviour bit-identical to today). - **OQ1 (the load-bearing fork), RULED by Matt → (b):** the loop and transport run as **two independent providers exporting to one collector**, not unified into one global trace tree. (a) unify is cheap to build but buys almost nothing — the parent/child links are fictional (transport pump/batch/reconnect fibers fork at construction, outside any loop span's async-local context), and a genuinely unified view is a span-links problem for later, not parentage. (b) is zero transport delta and keeps the merged RIG-2518 record frozen. - **No new dependencies, no agent-image FOD bump:** reuse keeps all OTel code inside `pi-coding-agent`'s own dependency closure, already in `bun.lock`. - **Correlation join key:** both signals stamp `service.name = compass-agent` plus a shared `compass.session.id` resource attribute (via `OTEL_RESOURCE_ATTRIBUTES`, read natively by both providers, zero transport code), so two agents on one collector are separable. ## Provenance Drafted by a design subagent, red-teamed by a design-critic (0 blockers; all five should-fix findings folded — the service-name split, the off-is-bit- identical `??=` gating, the test global-registration isolation hazard, the 16.4.8→16.5.2 version drift, and the endpoint-gate asymmetry). Every code claim carries file+line grounded in the pinned OMP build and the compass-agent tree. Freezes on merge; T1/T2 impl follow as their own gated PRs. Spec-impact: none. Refs RIG-2508, RIG-2384, RIG-2518 Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-agent/rig-2508-loop-otel-design
branch
from
August 24, 2026 02:43
7440293 to
4ac8ba2
Compare
rigel-mintaka
marked this pull request as ready for review
August 24, 2026 02:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frozen-on-merge design record for activating OpenTelemetry on the compass-agent
agent loop and composing it with the transport's already-merged Effect-scoped
OTel (RIG-2518).
The finding that reframes the issue
RIG-2508 was scoped as "adopt OTel on the loop" on the premise that the loop is
plain-TS on the OMP SDK and needs a from-scratch adoption. That premise is
false. OMP (
@oh-my-pi/pi-agent-core,pi-coding-agent) ships full nativeGenAI-semantic-convention loop telemetry (
invoke_agent > chat/execute_tool/
handoffspans) that is opt-in and simply never switched on: compass-agent'ssole
createAgentSessioncall passes notelemetryand sources noOTEL_*.So this is activation + composition, not adoption.
What the record decides
first-party entrypoint (
cli.tsmain()) — reuse@oh-my-pi/pi-coding-agent/telemetry-export'sinitTelemetryExport()/isTelemetryExportEnabled()(a declared wildcard subpath export) rather thanwriting a first-party registration module. Off by default (no OTLP endpoint →
no provider → no egress → black-box behaviour bit-identical to today).
run as two independent providers exporting to one collector, not unified
into one global trace tree. (a) unify is cheap to build but buys almost
nothing — the parent/child links are fictional (transport pump/batch/reconnect
fibers fork at construction, outside any loop span's async-local context), and
a genuinely unified view is a span-links problem for later, not parentage.
(b) is zero transport delta and keeps the merged RIG-2518 record frozen.
inside
pi-coding-agent's own dependency closure, already inbun.lock.service.name = compass-agentplus a shared
compass.session.idresource attribute (viaOTEL_RESOURCE_ATTRIBUTES, read natively by both providers, zero transportcode), so two agents on one collector are separable.
Provenance
Drafted by a design subagent, red-teamed by a design-critic (0 blockers; all
five should-fix findings folded — the service-name split, the off-is-bit-
identical
??=gating, the test global-registration isolation hazard, the16.4.8→16.5.2 version drift, and the endpoint-gate asymmetry). Every code claim
carries file+line grounded in the pinned OMP build and the compass-agent tree.
Freezes on merge; T1/T2 impl follow as their own gated PRs.
Spec-impact: none. Refs RIG-2508, RIG-2384, RIG-2518
Co-authored-by: Matt Wilkinson matt@rigel.build