CoR: Add debug session watcher for project debug telemetry - #1666
Open
Nathan (nturinski) wants to merge 2 commits into
Open
CoR: Add debug session watcher for project debug telemetry#1666Nathan (nturinski) wants to merge 2 commits into
Nathan (nturinski) wants to merge 2 commits into
Conversation
Nathan (nturinski)
requested
a balanced review from Copilot
and removed request for
a team
August 10, 2026 23:01
Contributor
There was a problem hiding this comment.
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.
onDidStartDebugSessionmay later recognize and track the CoR session, but its DAPexitedevent is then never observed, so successful and failed runs are reported ascancelledOrUnknown. 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), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.