Skip to content

Separate cloud sandbox provisioning, resume, and recovery telemetry - #340141

Open
Osvaldo Ortega (osortega) wants to merge 2 commits into
mainfrom
copilot/cloud-sandbox-lifecycle-telemetry
Open

Osvaldo Ortega (osortega) wants to merge 2 commits into
mainfrom
copilot/cloud-sandbox-lifecycle-telemetry

Conversation

@osortega

Copy link
Copy Markdown
Contributor

Description

Distinguish provisioning a new cloud sandbox, reopening an existing environment, automatic connection recovery, and user-local host attachment without changing connection behavior or retry policy.

  • Add environmentOperation and end-to-end readinessMs to cloudSandboxConnectionOutcome. Successful provisioning and resume samples both end at authenticated AHP readiness, so protocol waits after credential issuance remain included in the appropriate workflow.
  • Record provisioningMs from task creation through connection start, and partition the existing connection duration into exclusive preparationMs and connectionMs. When the start time is known, readinessMs = provisioningMs + preparationMs + connectionMs.
  • Emit a separate cloudSandboxProvisioningOutcome for API-phase creation success, failure, or cancellation, including failures before connection tracking starts.
  • Keep provisioning timestamps local and out of persisted data; do not reuse them for recoveries or later independent dials. Missing creation timestamps produce absent readiness measurements, not zero provisioning time.
  • Add regression coverage and document scorecard boundaries and comparison guidance.

resume describes opening an existing environment, including already-warm environments; it does not establish a cold VM resume. Pure server startup timing still requires a server-reported signal. Compare successful readinessMs samples by environmentOperation, rather than comparing API-only provisioning duration with full resume latency.

Only the ten source, test, and telemetry documentation diffs are included. No log files or session artifacts are included.

How to test

Validation completed for these changes before moving the branch onto the latest main (five non-overlapping upstream commits):

  • Passed: npm run build-fast -- --client-only
  • Passed: NODE_OPTIONS=--max-old-space-size=8192 npm run typecheck-client
  • Passed, 240 tests:
    node test/unit/browser/index.js --browser chromium \
      --run src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxTelemetry.test.ts \
      --run src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxApiService.test.ts \
      --run src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxAgentHostService.test.ts \
      --reporter dot
  • Passed, 14 tests:
    node test/unit/browser/index.js --browser chromium \
      --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/cloudSandboxAgentHostContribution.test.ts \
      --grep 'CloudSandboxAgentHostContribution provisioning' \
      --reporter dot
  • Passed after updating the branch: git diff --check

Coverage includes long protocol waits, successful/failed/cancelled outcomes, credential retry backoff, missing provisioning metadata, user-local attachments, subsequent recovery/redial, and the task-creation timestamp handoff.

Runner limitation: the combined Chromium invocation stalled during loading, and Electron could not load the larger service/contribution test modules. The separate Chromium invocations above passed.

Track lifecycle readiness independently from credential preparation and connection setup, and distinguish new provisioning, existing-environment resumes, automatic recovery, and user-local attachments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 20:38
@osortega
Osvaldo Ortega (osortega) marked this pull request as draft October 6, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The telemetry changes preserve connection behavior, align with documented measurement boundaries, and include focused lifecycle regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Separates VS Code cloud sandbox telemetry by provisioning, resume, recovery, and user-local attachment without changing connection behavior or retry policy.

Changes:

  • Adds end-to-end readiness timing and exclusive preparation/connection durations.
  • Reports API-phase provisioning outcomes separately and keeps creation timestamps local.
  • Adds lifecycle regression coverage and documents measurement boundaries.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​cloudSandboxTelemetry.test.ts Tests timing partitions and workflow classification.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​cloudSandboxApiService.test.ts Tests provisioning success, failure, and cancellation telemetry.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​cloudSandboxAgentHostService.test.ts Tests timing handoff, recovery, and independent dials.
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​cloudSandboxTelemetry.ts Implements workflow classification and timing measurements.
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​cloudSandboxApiService.ts Reports API-phase provisioning outcomes.
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​cloudSandboxAgentHostService.ts Passes telemetry context and resets provenance for later dials.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​cloudSandboxAgentHostContribution.test.ts Tests creation timestamp forwarding only on initial connection.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​cloudSandboxAgentHostContribution.ts Captures and forwards the task-creation start time.
src/​vs/​platform/​agentHost/​OTEL.md Documents timing boundaries and scorecard comparisons.
src/​vs/​platform/​agentHost/​common/​cloudSandboxAgentHost.ts Adds an optional local provisioning timestamp.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

auto-merge was automatically disabled October 7, 2026 01:19

Pull request was closed

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Base: f4dfb91d Current: 1ca31697

No screenshot changes.

roblourens
roblourens previously approved these changes Oct 7, 2026
Resolve #340141 conflicts while preserving lifecycle timing and cloud versus user-local telemetry attribution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

4 participants