Skip to content

CoR: Add debug session watcher for project debug telemetry - #1666

Open
Nathan (nturinski) wants to merge 2 commits into
nat/appOnboardDeploymentfrom
nat/debugSessionWatcher
Open

CoR: Add debug session watcher for project debug telemetry#1666
Nathan (nturinski) wants to merge 2 commits into
nat/appOnboardDeploymentfrom
nat/debugSessionWatcher

Conversation

@nturinski

Copy link
Copy Markdown
Member

No description provided.

@nturinski
Nathan (nturinski) requested a review from a team as a code owner August 10, 2026 23:00
@nturinski
Nathan (nturinski) requested a balanced review from Copilot and removed request for a team August 10, 2026 23:01

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.

Pull request overview

Adds telemetry tracking for Copilot on Rails debugging sessions.

Changes:

  • Registers a debug-session watcher during extension activation.
  • Records session start, end, duration, outcome, type, and child-session status.
  • Restricts telemetry to detected Copilot on Rails project folders.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/extension.ts Registers the debug-session watcher.
src/commands/copilotOnRails/registerDebugSessionWatcher.ts Implements project detection, session tracking, and telemetry reporting.
Suppressed comments (2)

src/commands/copilotOnRails/registerDebugSessionWatcher.ts:156

  • When the initial folder refresh is still pending (or the cache is stale), this factory returns no tracker. onDidStartDebugSession may later recognize and track the CoR session, but its DAP exited event is then never observed, so successful and failed runs are reported as cancelledOrUnknown. The factory supports an asynchronous provider result, so perform the same one-off folder check here before deciding not to attach.
    const tracked = ensureTracked(session);
    if (!tracked) {
        return undefined;

src/commands/copilotOnRails/registerDebugSessionWatcher.ts:71

  • Multiple file-change events can run this refresh concurrently, and every invocation clears and replaces the shared set when it finishes. An older scan can therefore finish last and restore stale membership (notably after a project artifact is deleted), causing unrelated later debug sessions to emit CoR telemetry. Commit only the latest refresh result.
async function refreshCorProjectFolders(): Promise<void> {
    const folders = vscode.workspace.workspaceFolders ?? [];
    const memberships = await Promise.all(
        folders.map(async (folder) => ({ key: folder.uri.toString(), isCor: await isCopilotOnRailsProjectFolder(folder) })),

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

vscode.debug.onDidStartDebugSession((session) => void onDidStartDebugSession(session)),
vscode.debug.onDidTerminateDebugSession((session) => onDidTerminateDebugSession(session)),
vscode.debug.registerDebugAdapterTrackerFactory('*', {
createDebugAdapterTracker: (session) => createTracker(session),
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.

2 participants