Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

16.1 KB
Raw Blame
// Code generated by cli/internal/semconvgen. DO NOT EDIT.
// Source: sdk/go/semconv/coding_agent.go
//
// Run `go generate ./...` from the cli/ module to regenerate.

// Vendor identifiers (used as `gen_ai.agent.name` value).
export const CodingAgentVendorClaudeCode = "claude-code";

export const CodingAgentVendorCursor = "cursor";

export const CodingAgentVendorCodex = "codex";

export const CodingAgentVendorOpenCode = "opencode";

export const CodingAgentVendorWindsurf = "windsurf";

// CodingAgentSessionID identifies a single coding-agent session.
// Used as the join key across all spans/events emitted for that session.
export const CodingAgentSessionID = "coding_agent.session.id";

// CodingAgentClient is the vendor identifier; mirror of gen_ai.agent.name.
// Carried separately so dashboard widgets can filter without
// pulling in the full gen_ai.* attribute set.
export const CodingAgentClient = "coding_agent.client";

// CodingAgentClientVersion is the vendor's client version.
export const CodingAgentClientVersion = "coding_agent.client.version";

// CodingAgentSessionOutcome captures how the session ended.
// One of: merged | committed | abandoned_no_change | abandoned_with_change | cancelled.
export const CodingAgentSessionOutcome = "coding_agent.session.outcome";

// CodingAgentSessionDurationMs is wall-clock duration in milliseconds.
export const CodingAgentSessionDurationMs = "coding_agent.session.duration_ms";

// CodingAgentSessionToolCallCount totals tool invocations during the session.
export const CodingAgentSessionToolCallCount = "coding_agent.session.tool_call_count";

// CodingAgentSessionSubagentCount totals child/subagent spawns.
export const CodingAgentSessionSubagentCount = "coding_agent.session.subagent_count";

// CodingAgentSessionCostUSD is the realized USD cost.
export const CodingAgentSessionCostUSD = "coding_agent.session.cost_usd";

// Per-session code-change rollups stamped on the
// `coding_agent.session` root span at SessionEnd. They aggregate
// edit / accept / reject / line counts the adapter observed
// across the session so dashboards don't have to fan out into
// every `coding_agent.edit.decision` span.
//
// Mirrors Claude Code's native `claude_code.lines_of_code.count`
// metric shape — when the operator ships both paths (hook + native
// OTel exporter), the query layer coalesces.
export const CodingAgentSessionLinesAdded = "coding_agent.session.lines.added";

// Session structure attributes.
export const CodingAgentSessionLinesRemoved = "coding_agent.session.lines.removed";

export const CodingAgentSessionLinesAccepted = "coding_agent.session.lines.accepted";

export const CodingAgentSessionLinesRejected = "coding_agent.session.lines.rejected";

export const CodingAgentSessionEditAcceptCount = "coding_agent.session.edit.accept_count";

export const CodingAgentSessionEditRejectCount = "coding_agent.session.edit.reject_count";

export const CodingAgentSessionCommitCount = "coding_agent.session.commit_count";

export const CodingAgentSessionPRCount = "coding_agent.session.pr_count";

// CodingAgentSessionOutcomeCompleted — the agent reported a
// successful end of the session (Cursor's reason="completed",
// Claude Code's "stop", etc). The user may or may not have
// merged anything; we stay agnostic on downstream VCS state.
export const CodingAgentSessionOutcomeCompleted = "completed";

// Session outcome values.
export const CodingAgentSessionOutcomeMerged = "merged";

export const CodingAgentSessionOutcomeCommitted = "committed";

export const CodingAgentSessionOutcomeAbandonedNoChange = "abandoned_no_change";

export const CodingAgentSessionOutcomeAbandonedWithChange = "abandoned_with_change";

export const CodingAgentSessionOutcomeCancelled = "cancelled";

// CodingAgentAgentID is a stable id for this agent instance within the
// session (root or subagent). Use parent_id to walk the tree.
export const CodingAgentAgentID = "coding_agent.agent.id";

// CodingAgentAgentParentID points at the spawning agent's id.
export const CodingAgentAgentParentID = "coding_agent.agent.parent_id";

// CodingAgentAgentType is one of: main | subagent | task_tool.
export const CodingAgentAgentType = "coding_agent.agent.type";

// CodingAgentSubagentType is the vendor-specific subagent kind
// (e.g. Claude Code's named subagents, Codex spawn types).
export const CodingAgentSubagentType = "coding_agent.subagent.type";

// CodingAgentLinkageConfidence reports how reliable the parent_id
// linkage is for this vendor: high | medium | low.
// Codex subagent linkage is often medium because parent is
// inferred via process metadata rather than carried by the protocol.
export const CodingAgentLinkageConfidence = "coding_agent.linkage_confidence";

export const CodingAgentAgentTypeMain = "main";

export const CodingAgentAgentTypeSubagent = "subagent";

export const CodingAgentAgentTypeTaskTool = "task_tool";

export const CodingAgentLinkageConfidenceHigh = "high";

export const CodingAgentLinkageConfidenceMedium = "medium";

export const CodingAgentLinkageConfidenceLow = "low";

// CodingAgentLLMTurnKind describes the primary payload carried by an
// individual coding-agent LLM turn.
export const CodingAgentLLMTurnKind = "coding_agent.llm.turn.kind";

// LLM turn kind values.
export const CodingAgentLLMTurnKindPrompt = "prompt";

export const CodingAgentLLMTurnKindResponse = "response";

export const CodingAgentLLMTurnKindThought = "thought";

// CodingAgentEditDecision is one of: accept | reject | modify | auto_accepted.
export const CodingAgentEditDecision = "coding_agent.edit.decision";

// CodingAgentEditDecisionSource is the trigger:
// user_interactive | user_permanent_rule | hook | config | policy.
export const CodingAgentEditDecisionSource = "coding_agent.edit.decision.source";

// CodingAgentEditLinesAdded is the count of added lines.
export const CodingAgentEditLinesAdded = "coding_agent.edit.lines.added";

// CodingAgentEditLinesRemoved is the count of removed lines.
export const CodingAgentEditLinesRemoved = "coding_agent.edit.lines.removed";

// CodingAgentEditLanguage is the detected programming language.
export const CodingAgentEditLanguage = "coding_agent.edit.language";

// CodingAgentEditToolName is the tool that produced the edit
// (e.g. "Edit", "Write", "Apply Patch").
export const CodingAgentEditToolName = "coding_agent.edit.tool.name";

export const CodingAgentEditDecisionAccept = "accept";

export const CodingAgentEditDecisionReject = "reject";

export const CodingAgentEditDecisionModify = "modify";

export const CodingAgentEditDecisionAutoAccepted = "auto_accepted";

export const CodingAgentEditDecisionSourceUserInteractive = "user_interactive";

export const CodingAgentEditDecisionSourceUserPermanentRule = "user_permanent_rule";

export const CodingAgentEditDecisionSourceHook = "hook";

export const CodingAgentEditDecisionSourceConfig = "config";

export const CodingAgentEditDecisionSourcePolicy = "policy";

// CodingAgentToolTriggeringLLMRequestID is the LLM response id
// whose tool_calls produced this invocation.
export const CodingAgentToolTriggeringLLMRequestID = "coding_agent.tool.triggering_llm_request_id";

// CodingAgentToolIteration is the loop index for retried/iterated tools.
export const CodingAgentToolIteration = "coding_agent.tool.iteration";

// CodingAgentToolGroupID groups tools fired in the same model turn.
export const CodingAgentToolGroupID = "coding_agent.tool.group.id";

// CodingAgentToolGroupType describes the group's intent
// (e.g. "file_edit", "search", "bash").
export const CodingAgentToolGroupType = "coding_agent.tool.group.type";

// CodingAgentMCPServerName is the MCP server identifier.
export const CodingAgentMCPServerName = "coding_agent.mcp.server.name";

// CodingAgentMCPScope is one of: user | project | local | enterprise.
export const CodingAgentMCPScope = "coding_agent.mcp.scope";

// CodingAgentMCPTransport is one of: stdio | sse | streamable_http.
export const CodingAgentMCPTransport = "coding_agent.mcp.transport";

// CodingAgentMCPSource is one of: builtin | plugin | marketplace.
export const CodingAgentMCPSource = "coding_agent.mcp.source";

export const CodingAgentMCPScopeUser = "user";

export const CodingAgentMCPScopeProject = "project";

export const CodingAgentMCPScopeLocal = "local";

export const CodingAgentMCPScopeEnterprise = "enterprise";

export const CodingAgentMCPTransportStdio = "stdio";

export const CodingAgentMCPTransportSSE = "sse";

export const CodingAgentMCPTransportStreamableHTTP = "streamable_http";

export const CodingAgentMCPSourceBuiltin = "builtin";

export const CodingAgentMCPSourcePlugin = "plugin";

export const CodingAgentMCPSourceMarketplace = "marketplace";

// CodingAgentVCSDirty indicates the working tree has uncommitted changes
// when the agent started. Boolean serialized as "true"/"false".
export const CodingAgentVCSDirty = "coding_agent.vcs.dirty";

// CodingAgentUserClassification is one of: personal | work | disputed | unknown.
// Stamped at hook-time using API-key allowlist + repo-origin allowlist.
export const CodingAgentUserClassification = "coding_agent.user.classification";

// CodingAgentUserClassificationReason explains the classification
// (e.g. "api_key_allowlist", "repo_origin_match", "no_signal").
export const CodingAgentUserClassificationReason = "coding_agent.user.classification.reason";

// CodingAgentPolicyPermissionMode captures how permissive the run is
// (e.g. "interactive", "auto_accept", "dangerously_skip_permissions").
export const CodingAgentPolicyPermissionMode = "coding_agent.policy.permission_mode";

// CodingAgentContentCaptureMode is the active capture posture:
// minimal | metadata_only | full. See `cli/internal/otlp/attrs.go`
// for the per-mode attribute matrix.
export const CodingAgentContentCaptureMode = "coding_agent.content_capture_mode";

export const CodingAgentUserClassificationPersonal = "personal";

export const CodingAgentUserClassificationWork = "work";

export const CodingAgentUserClassificationDisputed = "disputed";

export const CodingAgentUserClassificationUnknown = "unknown";

// CodingAgentContentCaptureMinimal — only session bookends and
// rolled-up counters. No per-event spans. Cheapest tier; for
// enterprises that want budget visibility without per-prompt
// content. See Phase C of the coding-agents plan.
export const CodingAgentContentCaptureMinimal = "minimal";

// CodingAgentContentCaptureMetadataOnly — per-event spans with
// counts/timings/cost/repo but redacted bodies (no prompts, no
// tool args, no shell flags). Recommended default.
export const CodingAgentContentCaptureMetadataOnly = "metadata_only";

// CodingAgentContentCaptureFull — everything metadata mode has
// plus prompts, responses, thoughts, tool args, tool results.
// Tier-2 PII redaction still runs. For trust+safety reviews.
export const CodingAgentContentCaptureFull = "full";

// CodingAgentLoopDetected is true when an in-session loop is detected.
export const CodingAgentLoopDetected = "coding_agent.loop.detected";

// CodingAgentLoopPattern names the pattern (e.g. "edit_revert_edit",
// "tool_retry").
export const CodingAgentLoopPattern = "coding_agent.loop.pattern";

// CodingAgentHookEvent names the originating hook event (e.g. "PreToolUse").
export const CodingAgentHookEvent = "coding_agent.hook.event";

// CodingAgentHookCLIVersion identifies the openlit CLI version.
export const CodingAgentHookCLIVersion = "coding_agent.hook.cli.version";

// CodingAgentHookSchemaVersion is the wire-format schema version.
// Bump when a breaking change is necessary; receivers read this to
// stay forward-compatible with the latest CLIs.
export const CodingAgentHookSchemaVersion = "coding_agent.hook.schema.version";

// Span names emitted by the CLI normalizer. Keep these as constants so
// dashboard SQL can match against a small, stable set.
export const CodingAgentSpanSession = "coding_agent.session";

export const CodingAgentSpanToolCall = "coding_agent.tool.call";

export const CodingAgentSpanEditDecision = "coding_agent.edit.decision";

export const CodingAgentSpanSubagent = "coding_agent.subagent";

export const CodingAgentSpanLLMTurn = "coding_agent.llm.turn";

// CodingAgentSpanGitCommit is emitted when the agent's Bash /
// shell tool ran a `git commit` invocation. One span per detected
// commit, child of the session-root trace.
export const CodingAgentSpanGitCommit = "coding_agent.git.commit";

// CodingAgentSpanGitPullRequest is emitted when the agent's
// Bash / shell tool created a pull / merge request (`gh pr
// create`, `git push -u origin <branch>` that produced a PR URL,
// etc.).
export const CodingAgentSpanGitPullRequest = "coding_agent.git.pull_request";

// Git commit / pull-request attributes — attached to the matching
// `coding_agent.git.commit` / `coding_agent.git.pull_request` span.
// The body-bearing values (commit message, PR title) are stamped only
// under `full` content capture; the SHA / URL / number are always
// safe to stamp.
export const CodingAgentGitCommitSHA = "coding_agent.git.commit.sha";

export const CodingAgentGitCommitMessage = "coding_agent.git.commit.message";

export const CodingAgentGitPRURL = "coding_agent.git.pull_request.url";

export const CodingAgentGitPRNumber = "coding_agent.git.pull_request.number";

export const CodingAgentGitPRTitle = "coding_agent.git.pull_request.title";

// Event names — emitted as span events for high-cardinality moments
// where a separate span would be overkill.
export const CodingAgentEventSessionStart = "coding_agent.session.start";

export const CodingAgentEventSessionEnd = "coding_agent.session.end";

// OpenCode has no terminal SessionEnd hook. Minimal capture uses
// non-terminal snapshots so counters stay visible without inventing
// a completed session root or emitting high-cardinality child spans.
export const CodingAgentEventSessionSnapshotStart = "coding_agent.session.snapshot.start";

export const CodingAgentEventSessionSnapshot = "coding_agent.session.snapshot";

export const CodingAgentEventEditDecision = "coding_agent.edit.decision";

export const CodingAgentEventLoopDetected = "coding_agent.loop.detected";

export const CodingAgentEventSubagentSpawned = "coding_agent.subagent.spawned";

export const CodingAgentEventSubagentDone = "coding_agent.subagent.completed";

export const CodingAgentEventMCPInvoked = "coding_agent.mcp.tool.invoked";

// Metric names — additions on top of gen_ai.* metrics.
//
// The `coding_agent.lines_of_code.count`, `coding_agent.code_edit_tool.decision`,
// `coding_agent.commit.count`, and `coding_agent.pull_request.count`
// counters mirror Claude Code's native exporter shape
// (`claude_code.lines_of_code.count` …) under our canonical namespace.
// They are emitted alongside the matching span so backends that consume
// metrics (Prometheus / Mimir) see the same numbers traces backends do.
export const CodingAgentMetricSessionDuration = "coding_agent.session.duration";

export const CodingAgentMetricSessionCostUSD = "coding_agent.session.cost_usd";

export const CodingAgentMetricSessionToolCalls = "coding_agent.session.tool_call_count";

export const CodingAgentMetricSessionSubagents = "coding_agent.session.subagent_count";

export const CodingAgentMetricToolDuration = "coding_agent.tool.duration";

export const CodingAgentMetricEditDecisions = "coding_agent.edit.decision.count";

// CodingAgentMetricLinesOfCode is a counter of added / removed
// lines tagged with `type=added|removed`, `decision`, `vendor`, `user`.
export const CodingAgentMetricLinesOfCode = "coding_agent.lines_of_code.count";

// CodingAgentMetricEditDecisionCnt is a counter of edit
// decisions tagged with `decision`, `vendor`, `tool_name`,
// `language`, `user`. Renamed under our namespace from
// `claude_code.code_edit_tool.decision`.
export const CodingAgentMetricEditDecisionCnt = "coding_agent.code_edit_tool.decision";

// CodingAgentMetricCommit is a counter of agent-attributed
// git commits tagged with `vendor`, `user`.
export const CodingAgentMetricCommit = "coding_agent.commit.count";

// CodingAgentMetricPullRequest is a counter of agent-attributed
// pull / merge requests tagged with `vendor`, `user`.
export const CodingAgentMetricPullRequest = "coding_agent.pull_request.count";

// Schema version of the coding_agent.* wire format. Bump on breaking changes.
export const CodingAgentSchemaVersion = "1";