Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

split codex cli + desktop

Justin D'Souzaeda8bd05814a
diff --git a/README.md b/README.md
index 0817a190..7623f84b 100644
--- a/README.md
+++ b/README.md
@@ -160,6 +160,7 @@ for the full breakdown by surface.
| [Claude Cowork](https://docs.asymptotelabs.ai/cli/supported-runtimes-claude-cowork) | OTLP | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Cline](https://docs.asymptotelabs.ai/cli/supported-runtimes-cline) | Plugin | ✅ | ✅ | ✅ | ✅ | ✅ | – | ✅ | ✅ |
| [Codex CLI](https://docs.asymptotelabs.ai/cli/supported-runtimes-codex-cli) | OTLP + hook | ✅ | ✅ | ✅ | ✅ | – | ✅ | – | ✅ |
+| [Codex Desktop](https://docs.asymptotelabs.ai/cli/supported-runtimes-codex-cli) | OTLP | ✅ | ✅ | ✅ | ✅ | – | ✅ | – | ✅ |
| [Cursor](https://docs.asymptotelabs.ai/cli/supported-runtimes-cursor) | Hooks | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | – |
| [Devin CLI](https://docs.asymptotelabs.ai/cli/supported-runtimes-devin) | Hooks | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | – |
| [Devin Desktop](https://docs.asymptotelabs.ai/cli/supported-runtimes-devin-desktop) | Hooks | – | ✅ | ✅ | ✅ | ✅ | – | ✅ | – |
diff --git a/cli/beacon/internal/endpoint/dashboard/static/app.js b/cli/beacon/internal/endpoint/dashboard/static/app.js
index 0f8a4d00..841465ba 100644
--- a/cli/beacon/internal/endpoint/dashboard/static/app.js
+++ b/cli/beacon/internal/endpoint/dashboard/static/app.js
@@ -450,6 +450,7 @@ const inventoryRuntimeLogos = {
cline_cli: "/runtime-logos/cline.png",
codex: "/runtime-logos/codex.png",
codex_cli: "/runtime-logos/codex.png",
+ codex_desktop: "/runtime-logos/codex.png",
copilot: "/runtime-logos/github-copilot.png",
copilot_cli: "/runtime-logos/github-copilot.png",
github_copilot: "/runtime-logos/github-copilot.png",
@@ -1147,6 +1148,7 @@ function runtimeLabel(value) {
const labels = {
claude_code: "Claude Code",
codex_cli: "Codex CLI",
+ codex_desktop: "Codex Desktop",
cursor: "Cursor",
gemini_cli: "Gemini CLI",
antigravity: "Antigravity CLI",
@@ -1541,6 +1543,7 @@ function harnessLabel(value) {
cursor: "Cursor",
claude_code: "Claude Code",
codex_cli: "Codex CLI",
+ codex_desktop: "Codex Desktop",
copilot_cli: "GitHub Copilot CLI",
grok: "Grok Build",
kiro: "Kiro",
diff --git a/cli/beacon/internal/tokens/coverage.go b/cli/beacon/internal/tokens/coverage.go
index df084c3a..5ba07e37 100644
--- a/cli/beacon/internal/tokens/coverage.go
+++ b/cli/beacon/internal/tokens/coverage.go
@@ -69,6 +69,7 @@ var usageExpectation = map[string]struct {
}{
"claude_code": {ExpectReported, "OTLP token and cost telemetry"},
"codex_cli": {ExpectReported, "per-turn usage trace; Codex emits no cost"},
+ "codex_desktop": {ExpectReported, "per-turn usage trace; Codex emits no cost"},
"claude_cowork": {ExpectReported, "OTLP token and cost telemetry"},
"cline": {ExpectReported, "plugin reports usage once per task"},
"opencode": {ExpectReported, "plugin reports usage per assistant message"},
diff --git a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
index 3ad3da58..464fb7c7 100644
--- a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
+++ b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter.go
@@ -158,9 +158,11 @@ func (c Converter) EventsFromMetrics(metrics pmetric.Metrics) []Event {
func ShouldDropLog(resourceAttrs map[string]interface{}, record plog.LogRecord) bool {
attrs := MergeMaps(resourceAttrs, AttrsToMap(record.Attributes()))
- switch HarnessName(attrs, record.Body().AsString()) {
- case "codex_cli":
+ harness := HarnessName(attrs, record.Body().AsString())
+ if isCodexHarness(harness) {
return isNoisyCodexLog(attrs, record.Body().AsString())
+ }
+ switch harness {
case "vscode_copilot":
return isNoisyVSCodeCopilotLog(attrs, record.Body().AsString())
default:
@@ -230,7 +232,7 @@ func shouldDropRuntimeMetric(name string) bool {
}
func shouldDropCodexMetric(resourceAttrs map[string]interface{}, name string) bool {
- if HarnessName(resourceAttrs, name) != "codex_cli" {
+ if !isCodexHarness(HarnessName(resourceAttrs, name)) {
return false
}
normalized := strings.ToLower(strings.TrimSpace(name))
@@ -380,9 +382,11 @@ func (c Converter) EventFromSpan(resourceAttrs map[string]interface{}, span ptra
func (c Converter) ShouldDropSpan(resourceAttrs map[string]interface{}, span ptrace.Span) bool {
attrs := MergeMaps(resourceAttrs, AttrsToMap(span.Attributes()))
- switch HarnessName(attrs, span.Name()) {
- case "codex_cli":
+ harness := HarnessName(attrs, span.Name())
+ if isCodexHarness(harness) {
return !c.opts.IncludeCodexSpans && !IsCodexTurnUsageSpan(attrs, span.Name())
+ }
+ switch harness {
case "vscode_copilot":
return shouldDropVSCodeCopilotSpan(attrs, span.Name(), c.opts.IncludeRuntimeMetrics)
default:
@@ -394,7 +398,7 @@ func (c Converter) ShouldDropSpan(resourceAttrs map[string]interface{}, span ptr
// Codex's session-attributable token totals. The span name alone is not enough:
// unfinished turns and some older builds can emit the same span with no usage.
func IsCodexTurnUsageSpan(attrs map[string]interface{}, spanName string) bool {
- if HarnessName(attrs, spanName) != "codex_cli" {
+ if !isCodexHarness(HarnessName(attrs, spanName)) {
return false
}
for _, key := range []string{
@@ -492,7 +496,7 @@ func NormalizeCodexTurnUsageSpan(event *Event, attrs map[string]interface{}) {
}
func (c Converter) NormalizeCodexLogEvent(event *Event, attrs map[string]interface{}) {
- if event == nil || event.Harness.Name != "codex_cli" {
+ if event == nil || !isCodexHarness(event.Harness.Name) {
return
}
name := CodexLogEventName(attrs)
@@ -1950,6 +1954,11 @@ func NormalizeHarnessName(name string) string {
return asymptoteobserve.NormalizeHarnessName(name)
}
+func isCodexHarness(name string) bool {
+ normalized := NormalizeHarnessName(name)
+ return normalized == "codex_cli" || normalized == "codex_desktop"
+}
+
// InferAction derives an event action from OTLP attributes. It is retained for callers that only
// need the action; InferActionWithFidelity is the same logic and additionally reports how sure
// Beacon is of the answer.
diff --git a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go
index cbc98e93..5beffe6f 100644
--- a/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go
+++ b/collector-builder/exporter/beaconjsonexporter/internal/beaconevent/converter_test.go
@@ -1410,10 +1410,11 @@ func TestNormalizeHarnessNameBrowserSources(t *testing.T) {
"chatgpt_web": "chatgpt_web",
"chatgpt.com": "chatgpt_web",
// Regression: existing harnesses must be unchanged.
- "claude_code": "claude_code",
- "claude": "claude_code",
- "codex": "codex_cli",
- "gemini": "gemini_cli",
+ "claude_code": "claude_code",
+ "claude": "claude_code",
+ "codex": "codex_cli",
+ "codex-app-server": "codex_desktop",
+ "gemini": "gemini_cli",
}
for in, want := range cases {
if got := NormalizeHarnessName(in); got != want {
@@ -1422,6 +1423,50 @@ func TestNormalizeHarnessNameBrowserSources(t *testing.T) {
}
}
+func TestHarnessNameSeparatesCodexDesktopFromCLI(t *testing.T) {
+ cases := map[string]string{
+ "codex-app-server": "codex_desktop",
+ "codex-desktop": "codex_desktop",
+ "codex": "codex_cli",
+ "codex-cli": "codex_cli",
+ "codex_exec": "codex_cli",
+ "codex_cli_rs": "codex_cli",
+ }
+ for serviceName, want := range cases {
+ t.Run(serviceName, func(t *testing.T) {
+ attrs := map[string]interface{}{"service.name": serviceName}
+ if got := HarnessName(attrs); got != want {
+ t.Errorf("HarnessName(%q) = %q, want %q", serviceName, got, want)
+ }
+ })
+ }
+}
+
+func TestCodexDesktopUsesCodexFilteringRules(t *testing.T) {
+ attrs := map[string]interface{}{"service.name": "codex-app-server"}
+ if !ShouldDropMetric(attrs, "codex.tool.call.duration_ms", false) {
+ t.Fatal("expected Codex Desktop runtime metric to be dropped")
+ }
+ if ShouldDropMetric(attrs, "codex.turn.token_usage", false) {
+ t.Fatal("expected Codex Desktop token usage metric to be kept")
+ }
+
+ usageSpan := ptrace.NewSpan()
+ usageSpan.SetName("session_task.turn")
+ usageSpan.Attributes().PutInt("codex.turn.token_usage.input_tokens", 10)
+ if !IsCodexTurnUsageSpan(MergeMaps(attrs, AttrsToMap(usageSpan.Attributes())), usageSpan.Name()) {
+ t.Fatal("expected Codex Desktop turn span with usage to be recognized")
+ }
+ if (Converter{}).ShouldDropSpan(attrs, usageSpan) {
+ t.Fatal("expected Codex Desktop turn span with usage to be kept")
+ }
+ transportSpan := ptrace.NewSpan()
+ transportSpan.SetName("FramedRead::poll_next")
+ if !(Converter{}).ShouldDropSpan(attrs, transportSpan) {
+ t.Fatal("expected Codex Desktop transport span to be dropped")
+ }
+}
+
func TestHarnessNameHonorsBrowserExtensionAttr(t *testing.T) {
attrs := map[string]interface{}{
"beacon.harness.name": "claude_web",
diff --git a/docs/cli/dashboard.mdx b/docs/cli/dashboard.mdx
index 65dbcefd..fdff0ade 100644
--- a/docs/cli/dashboard.mdx
+++ b/docs/cli/dashboard.mdx
@@ -25,7 +25,7 @@ beacon endpoint dashboard
## What it shows
-The dashboard reads the configured runtime JSONL log and provides a read-only view of local Beacon events. It follows Beacon's local rotation pattern, so Log Search can include the active file and numbered archives such as `runtime.jsonl.1`. In the default CLI setup, it reads the same per-user log used by Antigravity CLI, Claude Code, Cline, Cursor, Devin CLI, Devin Desktop, Factory, Grok Build, Hermes Agent, and OpenCode hooks, Claude Code OTLP, Codex OTLP, optional Gemini CLI OTLP, Factory Droid OTLP, and OpenClaw Gateway OTLP telemetry.
+The dashboard reads the configured runtime JSONL log and provides a read-only view of local Beacon events. It follows Beacon's local rotation pattern, so Log Search can include the active file and numbered archives such as `runtime.jsonl.1`. In the default CLI setup, it reads the same per-user log used by Antigravity CLI, Claude Code, Cline, Cursor, Devin CLI, Devin Desktop, Factory, Grok Build, Hermes Agent, and OpenCode hooks, Claude Code OTLP, Codex CLI and Codex Desktop OTLP, optional Gemini CLI OTLP, Factory Droid OTLP, and OpenClaw Gateway OTLP telemetry.
- **Log Search:** investigate event rows with free-text search, harness, model, severity, and category filters.
- **Detections:** browse the active [threat-rule](/detections) set that Beacon would use for local scans, including rules installed in the local store or the built-in baseline when no store is installed.
diff --git a/docs/cli/token-usage.mdx b/docs/cli/token-usage.mdx
index 0aa68601..12cf655b 100644
--- a/docs/cli/token-usage.mdx
+++ b/docs/cli/token-usage.mdx
@@ -38,6 +38,7 @@ Token coverage is not uniform, and the reason is almost always the runtime rathe
|---------|--------|------|-------------|----------|
| Claude Code | input, output, cache read, cache creation, reasoning | Reported (`cost_usd`) | Yes | When local user context is present |
| Codex CLI | input, output, cache read, cache creation, reasoning | Not emitted by Codex | Yes, from the turn trace | Yes, from matching SessionStart context |
+| Codex Desktop | input, output, cache read, cache creation, reasoning | Not emitted by Codex | Yes, from the turn trace | When local user context is present |
| Claude Cowork | input, output, cache read, cache creation | Reported when Cowork emits it | Yes | When the OTLP stream carries it |
| Cline | input, output, cache read, cache creation | Reported (`cost_usd`) | Yes, per task | Yes |
| OpenCode | input, output, cache read, cache creation, reasoning | Reported (`cost_usd`) | Yes | Yes |
diff --git a/docs/runtimes/codex-cli.mdx b/docs/runtimes/codex-cli.mdx
index 13757d72..cd148d78 100644
--- a/docs/runtimes/codex-cli.mdx
+++ b/docs/runtimes/codex-cli.mdx
@@ -1,17 +1,18 @@
---
-title: "Codex CLI"
-description: "Asymptote support details for Codex CLI endpoint telemetry"
+title: "Codex CLI and Desktop"
+description: "Asymptote support details for Codex CLI and Codex Desktop endpoint telemetry"
---
## Runtime overview
-Asymptote supports Codex CLI runtime telemetry through local OTLP logs and one selective usage-bearing turn trace. A lightweight SessionStart hook records the local OS user for token attribution.
+Asymptote supports Codex CLI runtime telemetry through local OTLP logs and one selective usage-bearing turn trace. Codex Desktop uses the same Codex OTLP configuration path through its app-server process, and Beacon records it as `codex_desktop` instead of merging it with `codex_cli`. A lightweight SessionStart hook records the local OS user for CLI token attribution.
## Prerequisites
-Before enabling Codex CLI telemetry, make sure:
+Before enabling Codex telemetry, make sure:
- Codex CLI is installed and available as the `codex` executable for the user or managed endpoint.
+- Codex Desktop is installed if you want Desktop app-server telemetry.
- Codex CLI 0.149.1 or newer is used for verified turn-trace token attribution.
- `beacon endpoint install` has run so the local collector, endpoint config, and runtime log path exist.
- The install includes the `codex` harness, either through the default harness list or an explicit `--harness codex` value.
@@ -19,7 +20,7 @@ Before enabling Codex CLI telemetry, make sure:
## Collection path
-Codex CLI exports local OpenTelemetry logs and traces to Asymptote's localhost collector. Asymptote uses Codex semantic logs for session, prompt, approval, and tool-result events. For tokens it keeps only the completed `session_task.turn` span carrying `thread.id`, `turn.id`, model, and usage; hundreds of transport and internal spans remain suppressed. The SessionStart hook writes a metadata-only `session.context` event; it never reads transcript content. Inventory is written by the scheduled inventory job, not by this hook.
+Codex CLI exports local OpenTelemetry logs and traces to Asymptote's localhost collector. Codex Desktop exports the same Codex semantic telemetry from `codex-app-server` when user-level `~/.codex/config.toml` enables OTLP. Asymptote uses Codex semantic logs for session, prompt, approval, and tool-result events. For tokens it keeps only the completed `session_task.turn` span carrying `thread.id`, `turn.id`, model, and usage; hundreds of transport and internal spans remain suppressed. The CLI SessionStart hook writes a metadata-only `session.context` event; it never reads transcript content. Inventory is written by the scheduled inventory job, not by this hook.
Use `--include-codex-spans` during install or repair only when you need every raw Codex span for troubleshooting. It is not required for token attribution.
@@ -68,7 +69,7 @@ Asymptote can also capture Codex telemetry in CI with `beacon ci start` and `bea
## Discovery and status
-Asymptote detects Codex CLI through the `codex` executable and `~/.codex/config.toml`. Use `beacon endpoint discover` or `beacon endpoint status` to confirm that Codex CLI is present and configured.
+Asymptote detects Codex CLI through the `codex` executable and `~/.codex/config.toml`. Codex Desktop shares the same user-level configuration file, so Desktop app-server events appear once the app emits OTLP to Beacon's local collector. Use `beacon endpoint discover` or `beacon endpoint status` to confirm that Codex configuration is present.
## Install or configuration support
diff --git a/docs/security/data-inventory.mdx b/docs/security/data-inventory.mdx
index dfb21117..428674ce 100644
--- a/docs/security/data-inventory.mdx
+++ b/docs/security/data-inventory.mdx
@@ -13,6 +13,7 @@ Beacon writes normalized endpoint events only when supported runtimes provide te
|---------------|-----------------|------------------------------|
| Claude Code | Local OTLP export | Prompt, command, tool, and file telemetry when emitted through OTLP |
| Codex CLI | Local OTLP logs and a selective usage trace plus endpoint hooks | Session, prompt, approval, and tool-result activity; per-user/session/model token usage; metadata-only user context and inventory triggers from hooks |
+| Codex Desktop | Local OTLP logs and a selective usage trace through Codex app-server | Session, prompt, approval, and tool-result activity; per-session/model token usage |
| Gemini CLI | Opt-in local OTLP | Prompts, tool calls, MCP activity, file operations, and approval-related events emitted through OTLP |
| Grok Build | Native hooks | Session, prompt, pre-tool, post-tool, failed tool, stop, session-end, command, and file telemetry |
| OpenCode | Managed plugin hooks | Prompts, assistant text/reasoning, model and usage metadata, tool inputs/results/failures, commands and output, file activity/diffs, web/MCP calls, approvals, and session lifecycle/errors |
diff --git a/pkg/asymptoteobserve/harness.go b/pkg/asymptoteobserve/harness.go
index 1bacc6b5..da8ccfdc 100644
--- a/pkg/asymptoteobserve/harness.go
+++ b/pkg/asymptoteobserve/harness.go
@@ -42,6 +42,13 @@ func NormalizeHarnessName(name string) string {
return "openclaw_gateway"
case strings.Contains(lower, "antigravity") || strings.Contains(lower, "anti-gravity"):
return "antigravity_cli"
+ // Codex Desktop runs the Codex app-server, which exports OTLP with
+ // service.name=codex-app-server. Keep it separate from the terminal Codex CLI so dashboards
+ // and SIEM queries do not merge two local surfaces under one harness.name.
+ case lower == "codex_desktop" || lower == "codex-desktop" || lower == "codex desktop" ||
+ lower == "codex_app_server" || lower == "codex-app-server" || lower == "codex app server" ||
+ lower == "codex_appserver" || lower == "codex-appserver" || lower == "codex appserver":
+ return "codex_desktop"
case strings.Contains(lower, "codex"):
return "codex_cli"
case strings.Contains(lower, "gemini"):
diff --git a/pkg/asymptoteobserve/harness_test.go b/pkg/asymptoteobserve/harness_test.go
index 7081477f..a9506c8c 100644
--- a/pkg/asymptoteobserve/harness_test.go
+++ b/pkg/asymptoteobserve/harness_test.go
@@ -39,7 +39,7 @@ func TestHookPlatformsConvergeOnCanonicalNames(t *testing.T) {
// re-reads and re-writes an event would have silently reassigned VS Code activity to the CLI.
func TestCanonicalNamesAreStableUnderRenormalization(t *testing.T) {
for _, canonical := range []string{
- "claude_code", "codex_cli", "gemini_cli", "antigravity_cli", "vscode_copilot",
+ "claude_code", "codex_cli", "codex_desktop", "gemini_cli", "antigravity_cli", "vscode_copilot",
"copilot_cli", "claude_web", "chatgpt_web", "claude_cowork", "claude_agent_sdk",
"openclaw_gateway", "pi_cli", "omp", "cline", "qwen_code", "prime_agent", "vercel_fx",
"muse_code", "grok_bot", "goose",
@@ -53,6 +53,25 @@ func TestCanonicalNamesAreStableUnderRenormalization(t *testing.T) {
}
}
+func TestCodexDesktopDoesNotCollapseIntoCodexCLI(t *testing.T) {
+ for _, in := range []string{
+ "codex-app-server", "codex_app_server", "Codex App Server", "codex-desktop", "Codex Desktop",
+ } {
+ t.Run(in, func(t *testing.T) {
+ if got := NormalizeHarnessName(in); got != "codex_desktop" {
+ t.Errorf("NormalizeHarnessName(%q) = %q, want codex_desktop", in, got)
+ }
+ })
+ }
+ for _, in := range []string{"codex", "codex-cli", "codex_exec", "codex_cli_rs"} {
+ t.Run(in, func(t *testing.T) {
+ if got := NormalizeHarnessName(in); got != "codex_cli" {
+ t.Errorf("NormalizeHarnessName(%q) = %q, want codex_cli", in, got)
+ }
+ })
+ }
+}
+
// Ordering is load-bearing: the browser and VS Code cases sit before broader rules that would
// otherwise swallow them. These are the pairs where one name is a substring of another's rule.
func TestNarrowerRuntimesWinOverBroaderRules(t *testing.T) {