Skip to content

Copilot-assisted commits: awaited local runs [4/7] - #22986

Merged
sergiou87 merged 18 commits into
sergiou87-assisted-commit-planningfrom
sergiou87-assisted-commit-runs
Nov 3, 2026
Merged

sergiou87 merged 18 commits into
sergiou87-assisted-commit-planningfrom
sergiou87-assisted-commit-runs

Conversation

@sergiou87

@sergiou87 sergiou87 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Description

This PR wires up the Copilot-assisted commit flow in Changes. Copilot plans focused commits from the files and lines you selected, and Desktop checks the entire plan before creating any commits. Your saved manual commit message and unselected changes are left alone.

You can follow progress, cancel a run, and handle failing Git hooks using the existing Abort or Ignore and Continue controls. If a run fails or is cancelled before acceptance, Desktop rolls back only the commits it created while keeping your current working changes. If rollback or refresh cannot finish safely, the error stays visible with a retry action rather than silently treating the run as complete.

The integration also protects active runs from conflicting repository actions and preserves partial selections through refresh and recovery. With Allow empty enabled and no changes selected, it creates one Empty commit without calling Copilot.

The run lifecycle, selection tracking, and recovery live in dedicated feature modules; AppStore connects them to the existing repository state and UI. Ordinary commits and standalone commit-message generation keep their existing paths. This PR creates local commits only. Optional push is added in the next PR.

Stack

Merge in order, starting with 1. Each PR builds on the preceding PR.

  1. #22971 - Repository-scoped assisted commit UX
  2. #22976 - Selected snapshots and validated Git transactions
  3. #22977 - Constrained Copilot-assisted commit planning
  4. #22986 - Awaited local runs and recovery (this PR)
  5. #22991 - Optional push and push-only retry
  6. #23079 - Shared Copilot lifecycle helpers
  7. #23081 - Assisted commit architecture documentation

Verification

Validated head b4bcd7053563f3ed07040abce73776c455bc244c, tree d165d90c629611546d651c705ceab896d89b3ad7, on planner f1cc254e745f7755462666fcd1d63ea6f3ba65b9 and pinned development 2d365100350bf559f0123eea45a0062aedf4b6c7.

The rebase combines upstream repository-assigned accounts and working-directory-keyed caches with assisted run ownership. Prepared and active runs are revoked when their repository's assigned account changes, even in the background. Deferred refresh and History use the current repository snapshot rather than an old account association. Existing operation leases, clone account fallback/picker behavior, worktree rename exclusion, status indicators, selection authority, native hooks and recovery remain covered.

Six new account-assignment cases failed before the integration fix and passed afterward, including stale callers, first-click intent, pending analysis, rollback after an earlier commit, and deferred background refresh/History. All prior test titles, options, parameterization and assertion ASTs in the 29 layer-owned test/helper files are retained (292 declarations and 1,376 assertions). This includes the reorganized 124 cases/402 assertions; the retired generic test file remains removed. Upstream cache/state-key tests and all four commit-mode account/worktree regressions are unchanged.

Validation ran on macOS arm64 with Node 24.22.1, Electron 44.9.1, TypeScript 6.0.3, Copilot SDK 1.0.27-preview.1, native runtime 1.0.104-1 (protocol 3), and Dugite 3.3.2 / Git 2.56.0. Frozen restoration left the pinned dependency manifests and lockfiles unchanged.

Focused account/session/cache/trampoline, SDK, native run/cancellation/recovery, clone, preview, worktree and UI checks:

corepack yarn test app/test/unit/stores/assisted-commit-selection-test.ts app/test/unit/stores/assisted-commit-recovery-test.ts app/test/unit/stores/assisted-commit-cancellation-test.ts app/test/unit/stores/assisted-commit-completion-test.ts app/test/unit/stores/assisted-commit-run-test.ts app/test/unit/stores/assisted-commit-run-hooks-test.ts app/test/unit/stores/assisted-commit-reader-publication-test.ts app/test/unit/stores/assisted-commit-upstream-integration-test.ts app/test/unit/stores/assisted-commit-cleanup-test.tsx app/test/unit/stores/assisted-commit-preview-test.ts app/test/unit/assisted-commit-coordinator-test.ts app/test/unit/assisted-commit-selection-test.ts app/test/unit/stores/copilot-assisted-commit-test.ts app/test/unit/stores/copilot-store-credentials-test.ts app/test/unit/copilot-assisted-commit-sdk-test.ts app/test/unit/copilot-sdk-auth-test.ts app/test/unit/credential-sessions-test.ts app/test/unit/accounts-store-test.ts app/test/unit/account-token-lifecycle-test.ts app/test/unit/refresh-token-consumers-test.ts app/test/unit/repository-account-test.ts app/test/unit/repository-state-cache-test.ts app/test/unit/git-store-cache-test.ts app/test/unit/commit-mode-storage-test.ts app/test/unit/repositories-store-test.ts app/test/unit/repository-matching-test.ts app/test/unit/stores/app-store-accounts-test.ts app/test/unit/stores/app-store-add-accounts-test.ts app/test/unit/git/clone-test.ts app/test/unit/git/clone-fallback-account-test.ts app/test/unit/git/refreshable-credentials-test.ts app/test/unit/trampoline-credential-helper-test.ts app/test/unit/git/repository-operation-test.ts app/test/unit/git/worktree-test.ts app/test/unit/git/worktree-move-test.ts app/test/unit/cloning-repositories-accounts-test.ts app/test/unit/ui/clone-repository-test.tsx app/test/unit/ui/repository-settings-test.tsx app/test/unit/ui/repository-settings-account-test.tsx app/test/unit/ui/repository-account-test.tsx app/test/unit/ui/multi-account-pickers-test.tsx app/test/unit/ui/assisted-commit-sidebar-test.tsx app/test/unit/ui/assisted-commit-history-test.tsx app/test/unit/ui/assisted-worktree-mutations-test.ts app/test/unit/ui/assisted-repository-creation-test.tsx app/test/unit/ui/commit-message-test.tsx app/test/unit/ui/copilot-commit-panel-test.tsx app/test/unit/ui/add-worktree-dialog-test.tsx app/test/unit/stores/app-store-indicators-test.ts

Result: 870/870 passed, 49 files, 102 suites, zero failures or skips. Actual SDK/native-runtime instruction, tool-policy, cancellation and credential-session integration are included.

Command Result
YARN_FROZEN_LOCKFILE=true corepack yarn install --frozen-lockfile Passed; no manifest or lockfile changes.
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all corepack yarn test Passed: 3,243 passed, 2 existing skips, zero failures or cancellations across 3,245 tests in 203.78 seconds; process-only compatibility setting.
corepack yarn test without the process-only compatibility setting 3,239 passed, 2 existing skips and exactly 4 unchanged host/parent bare-fixture failures. The complete suite passed with the process-only setting above; no persistent Git configuration changed.
corepack yarn tsc --noEmit Passed plain strict root-project checking, including dependency declarations; no compiler masks.
corepack yarn lint:fix Passed; changes were limited to the intended integration.
corepack yarn lint Passed Prettier, ESLint configuration checks and full ESLint.
corepack yarn exec markdownlint -- docs/technical/assisted-commit-runs.md --config .markdownlint.js --rules .markdownlint-rules.js Passed configured repository rules.
corepack yarn test:script script/webpack-copilot-timers-test.ts Passed all 30 script cases, including real SDK cleanup under browser timer globals and native-module/bundling checks.
corepack yarn test:e2e:build:unpackaged Passed production webpack and self-contained Electron staging in 142.45 seconds.
git diff --check Passed before publication.

A session-local probe reran six scenarios in the newly built production Electron app: selected-only multi-commit with History, analysis cancellation with manual-draft preservation, invalid-plan rejection and dismissal, native hook Abort after a partial commit with whole-run rollback, Ignore and Continue without skipping the next hook, and exact Empty commit with no additional model call. Native HEAD/index/working-byte outcomes were checked. All six passed; isolated profiles and repositories were removed and the app closed.

The Electron probe used synthetic account/planner inputs; SDK tests used synthetic credentials and local request handlers. Native Git, hooks, selection/history/index and rollback were real. No live model quality or billing was tested. Existing videos remain earlier demonstrations, not recordings of this rebase. No new native Windows execution or exact-head CI success is claimed here.

I also did manual validation of as many scenarios as possible.

Team-authored review

Evidence: Verification and the existing scenario recordings.

Review path: needs-deep-review. Native commits and rollback modify Git history and index state, and run authorization follows the issuing sign-in. In-depth human review should cover transaction ownership, rollback/interference fences and credential retirement. A maintainer should apply the required label before approval.

Screenshots

Video recorded manually:

Screen.Recording.2026-10-28.at.09.31.18.mov

Video of other scenarios, recorded by Copilot:

0-copilot-assisted-commit-scenarios.mp4

Release notes

Notes: no-notes

@sergiou87
sergiou87 added this pull request to stack #22992 October 9, 2026 08:14
Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:22
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from 036ef33 to 2995341 Compare October 9, 2026 15:22

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.

🟡 Changes recommended

Shared-worktree admission and local-clone source coordination contain concurrency gaps, alongside several UI correctness and accessibility issues.

6 open findings
What changed in this PR

Connects Copilot-assisted commits to an awaited, repository-owned local commit workflow with guarded execution, recovery, and UI progress.

Changes:

  • Adds assisted-run orchestration, validation, rollback, and resource coordination.
  • Adds progress, cancellation, recovery UI, and mutation guards.
  • Adds broad integration, Git, and accessibility coverage.
File Description
docs/​technical/​assisted-commit-transactions.md Updates transaction lifecycle documentation.
docs/​technical/​assisted-commit-runs.md Documents assisted-run architecture.
app/​test/​unit/​ui/​copilot-commit-panel-test.tsx Tests run progress and recovery UI.
app/​test/​unit/​ui/​commit-message-test.tsx Tests assisted completion announcements.
app/​test/​unit/​ui/​clone-repository-test.tsx Tests protected clone destinations.
app/​test/​unit/​ui/​assisted-worktree-mutations-test.ts Tests worktree mutation guards.
app/​test/​unit/​ui/​assisted-repository-creation-test.tsx Tests repository-creation coordination.
app/​test/​unit/​ui/​assisted-commit-sidebar-test.tsx Tests end-to-end sidebar wiring.
app/​test/​unit/​stores/​assisted-commit-run-hooks-test.ts Tests hook handling and rollback.
app/​test/​unit/​stores/​assisted-commit-reader-publication-test.ts Tests selection publication.
app/​test/​unit/​git/​repository-operation-test.ts Tests Git operation coordination.
app/​test/​unit/​git/​clone-test.ts Tests independent clone admission.
app/​test/​unit/​git/​assisted-commit-selected-fence-test.ts Tests selected-file acceptance fences.
app/​test/​unit/​git/​assisted-commit-completion-test.ts Tests final transaction locking.
app/​test/​helpers/​changes-state-helper.ts Adds default assisted state.
app/​test/​helpers/​assisted-commit-run.ts Adds an assisted-run harness.
app/​styles/​ui/​changes/​_copilot-commit-panel.scss Styles progress and error actions.
app/​src/​ui/​worktrees/​worktree-list-item-context-menu.ts Disables protected worktree mutations.
app/​src/​ui/​worktrees/​add-worktree-dialog.tsx Routes worktree creation through Dispatcher.
app/​src/​ui/​toolbar/​worktree-dropdown.tsx Supports disabling worktree controls.
app/​src/​ui/​toolbar/​push-pull-button.tsx Disables synchronization during runs.
app/​src/​ui/​toolbar/​branch-dropdown.tsx Guards branch interactions.
app/​src/​ui/​repository.tsx Propagates assisted mutation locks.
app/​src/​ui/​repository-settings/​repository-settings.tsx Coordinates identity updates.
app/​src/​ui/​dispatcher/​dispatcher.ts Exposes assisted and guarded operations.
app/​src/​ui/​clone-repository/​clone-repository.tsx Validates protected clone paths.
app/​src/​ui/​changes/​sidebar.tsx Connects assisted actions to Dispatcher.
app/​src/​ui/​changes/​filter-changes-list.tsx Wires cancellation and recovery actions.
app/​src/​ui/​changes/​copilot-commit-panel.tsx Presents assisted-run status.
app/​src/​ui/​changes/​commit-message.tsx Freezes and dispatches assisted requests.
app/​src/​ui/​changes/​commit-message-avatar.tsx Suspends inactive configuration reads.
app/​src/​ui/​app.tsx Adds consent and toolbar locking.
app/​src/​ui/​app-error.tsx Preserves nested Copilot errors.
app/​src/​ui/​add-repository/​create-repository.tsx Guards complete repository creation.
app/​src/​models/​popup.ts Adds assisted consent popup state.
app/​src/​models/​diff/​diff-selection.ts Adds exact selection comparison.
app/​src/​models/​copilot-assisted-commit.ts Adds preflight intent capability.
app/​src/​models/​assisted-commit-run.ts Defines run states and outcomes.
app/​src/​lib/​stores/​repository-state-cache.ts Persists repository-owned assisted state.
app/​src/​lib/​stores/​git-store.ts Tracks coordinated Git operations.
app/​src/​lib/​stores/​git-store-cache.ts Maintains authoritative native stores.
app/​src/​lib/​stores/​copilot-store.ts Checks assisted runtime availability.
app/​src/​lib/​menu-update.ts Disables conflicting menu actions.
app/​src/​lib/​git/​worktree.ts Exposes typed worktree options.
app/​src/​lib/​git/​var.ts Reads frozen author and committer identities.
app/​src/​lib/​git/​update-index.ts Supports certified partial diffs.
app/​src/​lib/​git/​repository-operation.ts Implements operation leases and protections.
app/​src/​lib/​git/​repository-operation-context.ts Propagates operation ownership.
app/​src/​lib/​git/​diff.ts Supports disabling text conversion.
app/​src/​lib/​git/​core.ts Coordinates native Git commands.
app/​src/​lib/​git/​commit.ts Stages certified partial selections.
app/​src/​lib/​git/​clone.ts Reserves clone destinations.
app/​src/​lib/​git/​assisted-commit/​index.ts Exports assisted HEAD reading.
app/​src/​lib/​git/​assisted-commit/​git.ts Adds final selected-file fencing.
app/​src/​lib/​git/​assisted-commit/​execute.ts Adds validation and acceptance boundaries.
app/​src/​lib/​git/​apply.ts Applies certified diff bases.
app/​src/​lib/​error-with-metadata.ts Traverses nested error causes.
app/​src/​lib/​assisted-commit-run.ts Adds recovery and selection reconciliation.
app/​src/​lib/​assisted-commit-request.ts Freezes and validates request inputs.
app/​src/​lib/​app-state.ts Adds assisted state to changes state.

🧠 Review effort: Balanced


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

Comment thread app/src/lib/stores/app-store.ts Resolved
Comment thread app/src/lib/git/clone.ts Resolved
Comment thread app/src/ui/changes/commit-message.tsx Resolved
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from 2995341 to 841b99b Compare October 9, 2026 16:12
@sergiou87 sergiou87 changed the title Copilot-assisted commits 4/5: awaited local runs Copilot-assisted commits: awaited local runs [4/5] Oct 15, 2026
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from 841b99b to 7b51819 Compare October 15, 2026 15:21
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from 7b51819 to 8d94375 Compare October 15, 2026 16:51
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from 8d94375 to e5bc2fc Compare October 16, 2026 12:18
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from e5bc2fc to 5b969a2 Compare October 19, 2026 17:28
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from 5b969a2 to f9b3260 Compare October 20, 2026 13:05
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch 3 times, most recently from 162fe05 to a29c35f Compare October 26, 2026 15:31
@sergiou87 sergiou87 changed the title Copilot-assisted commits: awaited local runs [4/5] Copilot-assisted commits: awaited local runs [4/7] Oct 28, 2026
@sergiou87
sergiou87 marked this pull request as ready for review October 28, 2026 15:49
@sergiou87
sergiou87 requested a review from a team as a code owner October 28, 2026 15:49
@sergiou87
sergiou87 requested a review from tidy-dev October 28, 2026 15:49
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from fa886b8 to 1466b87 Compare October 29, 2026 14:01
Connect the Changes action to repository-owned planning, validation and local commit transactions through Dispatcher and AppStore. Preserve frozen inputs, manual drafts, consent, native hooks, cancellation and guarded recovery.\n\nCoordinate Desktop readers and mutations throughout the run and retain verified selection authority across refreshes. Keep completion local; opt-in push follows in the next stack layer.
Normalize synthetic prefix textconv output before testing partial-to-whole selection lineage, and exercise both local autocrlf settings without weakening selection assertions.

Seed under deterministic test identities before removing committer environment overrides, isolate Git configuration, and verify frozen native sign-off against a changed live committer.
Keep owned temporary cleanup retryable even when capture fails before publishing a snapshot. Preserve nested failure causes and prioritize complete transaction recovery before acknowledging temporary-only obligations. Reconcile current selection without restoring external HEAD, index or working-file changes, and cover real owned-directory faults through AppStore, Dispatcher and the existing retry UI.
Suppress manual completion messages only while the previous assisted state still locks the repository. Cover switching from a settled error to Manual and preserve suppression for active, recovery and settling states.
Clear the polite live region for error states so the visible alert is the sole failure announcement. Preserve live progress and cancellation messages and cover settled, settling, recovery and refresh errors in the accessible DOM.
Refresh the displayed author whenever a name/email update is attempted, including when a later config write fails. Exercise native name-success/email-lock failures for local edits and global fallback, retaining visible errors and unchanged-identity no-op behavior.
Clear the creating state before successful dismissal can unmount the dialog. Cover real unmount ordering, pending disablement and dispatcher-reported failures that leave the dialog open.
Recognize native local-path and file URL source forms without changing remote transport selection. Retain source, physical metadata and peer worktree reads alongside destination fencing until clone completes, and keep progress observers outside operation ownership. Cover real transient commits rolled back before source release, aliases, URL decoding, shared worktrees, lifetime draining and destination protection. Narrow the earlier dialog regression's live ref at dismissal so the combined tests pass strict null checking.
Preserve file URL authorities as UNC paths on Windows and decode paths before parsing them, matching Git's native file transport. Keep POSIX authority handling and literal path characters unchanged while coordinating the source Git actually reads.

Cover platform-specific drive, UNC and encoded paths, retain native source-recovery checks with a supported Windows URL, and document the transport distinction.
Move review-history cases beside their selection, recovery, cancellation, completion, reader, authorization, hook, operation, clone, identity and repository-state contracts. Reuse existing suites where appropriate and share only the partial-selection fixture used by multiple suites.

Preserve all test bodies, parameterized cases, assertions and native fault injection while removing the review-named file and suite. No application behavior changes.
Resolve the current working-directory snapshot for assisted intent and deferred readers while retaining each run's frozen issuing session. Revoke prepared and active runs after repository account reassignment, including background analysis and partial native transactions.

Preserve upstream worktree move fences and repository indicator publication through asynchronous operation admission. Update integration fixtures for assigned accounts and native reader lifetimes, and cover stale snapshots, reassignment, rollback and deferred delivery without weakening existing cases.
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-runs branch from 1466b87 to b4bcd70 Compare November 3, 2026 11:34
@sergiou87
sergiou87 merged commit 4f843bc into development Nov 3, 2026
16 checks passed
@sergiou87
sergiou87 deleted the sergiou87-assisted-commit-runs branch November 3, 2026 17:14
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.

3 participants