Skip to content

Add Codex cloud telemetry setup#150

Open
shukieshah wants to merge 4 commits into
mainfrom
codex-cloud-support
Open

Add Codex cloud telemetry setup#150
shukieshah wants to merge 4 commits into
mainfrom
codex-cloud-support

Conversation

@shukieshah

Copy link
Copy Markdown
Contributor

Summary

  • Add beacon cloud codex setup and hook generation for Codex Cloud Agents.
  • Configure Codex OTel prompt telemetry through a local Beacon collector and upload runtime JSONL snapshots through the cloud GCS shuttle.
  • Document Codex cloud setup and add coverage for command rendering, shuttle uploads, Codex hook commands, and collector run context normalization.

Test plan

  • cd cli/beacon && go test ./...
  • cd cli/beacon-hooks && go test ./...
  • cd collector-builder/exporter/beaconjsonexporter && go test ./...

Made with Cursor

Configure Codex cloud agents to emit prompt-aware OTel into Beacon JSONL and upload runtime logs through the existing cloud GCS shuttle.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shukieshah shukieshah self-assigned this Jun 11, 2026
Comment thread cli/beacon/cmd/cloud.go
Comment thread cli/beacon-hooks/internal/cloudshuttle/shuttle.go
Source Codex cloud metadata before starting the watcher and keep periodic uploads alive after transient GCS failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread cli/beacon/cmd/cloud.go
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [beaconjson]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rotation drops uploaded telemetry

High Severity

The Codex cloud setup enables beaconjson log rotation on /tmp/beacon/runtime.jsonl, while cloud-watch uploads only the active log file and replaces the entire GCS object on each upload. After a rotate, archived events are never included, and a later upload can overwrite the remote object with just the post-rotation tail, dropping telemetry that was already uploaded.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 392a1ef. Configure here.

shukieshah and others added 2 commits June 11, 2026 14:12
Make Codex cloud telemetry rely on project hooks discovered before setup while keeping setup responsible for installing Beacon binaries and uploader support.

Co-authored-by: Cursor <cursoragent@cursor.com>
Install Codex hook and OTel config files into all plausible cloud config locations, including /opt/codex, so setup output matches the runtime CODEX_HOME path.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1325e0c. Configure here.

}
if os.Getenv("BEACON_CODEX_SESSION_ID") == "" {
_ = os.Setenv("BEACON_CODEX_SESSION_ID", sessionID)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale run ID after reset

High Severity

cloud-reset calls seedCloudRunID, which only sets BEACON_RUN_ID and BEACON_CODEX_SESSION_ID when those variables are empty. After startup|resume|clear|compact, a new Codex session_id in hook input can differ while the sandbox still carries the previous run id. resolveRunIDFromLog prefers env over the runtime log, so GCS uploads and object paths can keep using the old run id for the new session.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1325e0c. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant