Split Learning reset into exercise and unit - #3635
Draft
Dhairya Patel (HABER7789) wants to merge 2 commits into
Draft
Split Learning reset into exercise and unit#3635Dhairya Patel (HABER7789) wants to merge 2 commits into
Dhairya Patel (HABER7789) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Splits QDK Learning resets into activity-level and unit-level operations.
Changes:
- Restores individual notebook cells without affecting other work.
- Adds whole-unit reset support for Q# and notebook courses.
- Exposes the new tool through Copilot, commands, telemetry, and agent guidance.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
source/vscode/src/telemetry.ts |
Adds unit-reset telemetry. |
source/vscode/src/learning/service.ts |
Implements activity and unit reset behavior. |
source/vscode/src/learning/python/materialization.ts |
Restores individual notebook cells. |
source/vscode/src/learning/notebookExercises.ts |
Adds cell source lookup and replacement. |
source/vscode/src/learning/commands.ts |
Updates reset commands and notebook reopening. |
source/vscode/src/gh-copilot/tools.ts |
Registers the unit-reset tool. |
source/vscode/src/gh-copilot/learningTools.ts |
Adds tool orchestration and selected-cell synchronization. |
source/vscode/package.json |
Contributes the command and tool metadata. |
source/vscode/ai/qdk-learning.agent.md |
Documents activity versus unit resets. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- resetExercise now restores only current activity - copilot can now reset a whole unit and can target a unit by name - resetting something with no code, like a markdowncell, will now report instead of silently resetting another cell
Dhairya Patel (HABER7789)
force-pushed
the
HABER7789/reset-unit-copilot-tool
branch
from
September 2, 2026 00:57
160de31 to
652220d
Compare
Copilot started reviewing on behalf of
Dhairya Patel (HABER7789)
September 8, 2026 17:32
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Notebook close, edit, save, and rematerialization failures can currently be reported as successful resets.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
source/vscode/src/learning/python/materialization.ts:136
NotebookDocument.save()returnsfalsewhen the document was not saved, but that result is ignored and the reset is reported as successful. In that case progress is cleared even though the restored cell was never persisted. Treat a false save result as a restoration failure rather than returning true.
await notebook.save();
return true;
source/vscode/src/learning/service.ts:1032
rematerializeUnitWorkbookdelegates tomaterializeNotebook, which catches every filesystem/parsing failure and returnsvoid(materialization.ts:147-170). Consequently this call always proceeds tofinishUnitReset, clearing completion and telling the command/tool that the unit was reset even when the workbook was unchanged. Propagate a failure result here and only clear progress after the workbook was successfully restored.
await rematerializeUnitWorkbook(unit);
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Balanced
| if (isNotebookCourse(course)) { | ||
| const unit = this.findCourseUnit(course, unitId); | ||
| // Close any open notebook tabs for this unit before overwriting it. | ||
| await this.closeNotebookTab(workbookUri(unit)); |
Comment on lines
+72
to
+74
| if (open && (await replaceOpenCell(open, cellId, original))) { | ||
| return true; | ||
| } |
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.
resetExercisereset one.qsfile for Q# courses but wiped the entire notebook for notebook courses, while telling Copilot it "only resets an exercise." It now restores just the current activity one file, or one cell.Adds
resetUnitand aqdk-learning-reset-unittool so chat can reset a whole unit, including by name.This overlaps with #3627. Reset was picking the wrong notebook cell, because the stored position only moves when you run a cell, not when you click one. So I have fixed that here for reset, and #3627 fixes it more generally across the tools. I will drop my current fix once that merges.