Skip to content

feat(cloud-agent-next) add cloud agent clone telemetry / logs - #4875

Open
St0rmz1 wants to merge 2 commits into
mainfrom
feat/cloud-agent-clone-telemetry
Open

feat(cloud-agent-next) add cloud agent clone telemetry / logs#4875
St0rmz1 wants to merge 2 commits into
mainfrom
feat/cloud-agent-clone-telemetry

Conversation

@St0rmz1

@St0rmz1 St0rmz1 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds structured telemetry for cloud agent workspace bootstraps, emitted to Axiom via a single cloud_agent_workspace_bootstrap log event in WrapperClient.ensureSessionReady.

The wrapper now collects and returns a WrapperBootstrapTelemetry object on /session/ready responses, containing:

  • workspaceWasWarm and restoredFromBackup to distinguish genuinely reused sandboxes from backup-restored ones (both previously looked identical from the outside)
  • Clone details when a cold clone ran: mode, attempts, filterRejected, durationMs, repoKind, repoPlatform, shallow, and size proxies (totalObjects, receivedBytes) parsed directly from git's progress output at no extra cost

The mode field distinguishes three outcomes: full (no partial-clone filter used, or the filter was silently ignored by the remote), blobless (filter confirmed active via promisor remote config), and blobless_fallback (filter rejected by the remote, retried as a full clone). Previously, a server that silently ignored --filter=blob:none would have been misreported as a genuine blobless clone; this is now detected by checking remote.origin.promisor after the clone.

The metric is only emitted when actual bootstrap work happened (cold clone or backup restore). Ordinary warm follow-up turns on an already-running sandbox are skipped, so the count stays scoped to real bootstrap events. The telemetry field on the response is optional, so old wrapper images that don't send it degrade gracefully.

The clone data is kept nested in the log payload rather than spread flat, so a future wrapper-side field cannot silently overwrite the trusted sessionId/platform/metric fields. WrapperBootstrapResult and WrapperBootstrapTelemetry are kept structurally identical and main.ts forwards the result directly, so a field added to one type can't be silently dropped from the wire response.

Verification

  • Manual: no visual changes; this is a backend telemetry change only. Verified via Axiom once deployed.

Visual Changes

N/A

Reviewer Notes

  • The promisor remote check (git config --get remote.origin.promisor) is the git-native way to confirm a partial clone filter was accepted. A server that did a full clone silently will not have set this config, so mode correctly downgrades to full.
  • restoredFromBackup was needed because a backup archive includes the bootstrap marker file, so workspaceWasWarm alone could not distinguish "reused as-is" from "just restored from R2." Both flags are now logged.
  • telemetry is optional on WrapperSessionReadySuccessResponse for backward compat with pre-existing sandbox images that don't send it.

@kilo-code-bot

kilo-code-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the clone-telemetry and bootstrap-telemetry additions across the wrapper client, shared types, wrapper entrypoint, and session-bootstrap logic; the clone-mode classification, promisor confirmation, and telemetry gating are internally consistent and covered by the added unit tests.

Files Reviewed (5 files)
  • services/cloud-agent-next/src/kilo/wrapper-client.ts
  • services/cloud-agent-next/src/shared/wrapper-bootstrap.ts
  • services/cloud-agent-next/wrapper/src/main.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.test.ts

Reviewed by claude-sonnet-5 · Input: 22 · Output: 8.6K · Cached: 597.4K

Review guidance: REVIEW.md from base branch main

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