Skip to content

Add optional push and push-only retry for assisted commits [5/7] - #22991

Merged
sergiou87 merged 16 commits into
sergiou87-assisted-commit-runsfrom
sergiou87-assisted-commit-push
Nov 3, 2026
Merged

sergiou87 merged 16 commits into
sergiou87-assisted-commit-runsfrom
sergiou87-assisted-commit-push

Conversation

@sergiou87

@sergiou87 sergiou87 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

No issue is closed by this PR.

Description

This PR adds Push after committing to the Copilot-assisted commit options. It is off by default, saved separately for each repository, and does not change how manual commits work.

When enabled, Desktop finishes and checks all the planned local commits before pushing them to the branch's original destination. It uses the usual authentication and pre-push hooks, without force-pushing or sending unrelated tags. The panel shows overall push progress as a percentage.

You can cancel before pushing starts. Once a push is attempted, Desktop keeps the local commits even if the push fails or its outcome is uncertain. Retry push sends those same commits again after checking that the branch and destination still match—it does not ask Copilot to plan again or create more commits.

Errors stay brief in the commit panel, with Details opening the full error in a dialog. If the push succeeds but refreshing Desktop fails, Retry refresh updates the local view without pushing again. Retry remains available when you switch repositories or have no changes selected.

Desktop checks the repository and destination throughout the operation so a changed branch, remote, or repository path cannot silently redirect the push. If automatic pushing is unavailable for the current setup, the completed commits stay local and Desktop points you to the normal Push or Publish action.

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
  5. #22991 - Optional push and push-only retry (this PR)
  6. #23079 - Shared Copilot lifecycle helpers
  7. #23081 - Assisted commit architecture documentation

Validation

Current integration head: 36d1517e663486a04d675440a4a4d53b92af90b2, based on runs head b4bcd7053563f3ed07040abce73776c455bc244c. Results below cover this exact committed tree, including bounded graceful-cleanup recovery after verified forced runtime shutdown and cleanup diagnostics in Details.

  • GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all corepack yarn test — 3,536 passed, two existing skips, zero failures (3,538 total). The bare-repository fixture compatibility setting applies only to this process; no persistent Git configuration was changed.
  • corepack yarn test app/test/unit/stores/copilot-assisted-commit-test.ts app/test/unit/copilot-assisted-commit-sdk-test.ts app/test/unit/copilot-sdk-auth-test.ts app/test/unit/copilot-commit-message-test.ts app/test/unit/copilot-conflict-resolution-test.ts app/test/unit/copilot-in-memory-session-fs-provider-test.ts app/test/unit/ui/assisted-commit-details-test.tsx app/test/unit/stores/assisted-commit-cleanup-test.tsx 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-recovery-test.ts app/test/unit/git/assisted-commit-planning-test.ts — 241/241 passed.
  • corepack yarn test app/test/unit/stores/copilot-assisted-commit-test.ts app/test/unit/copilot-assisted-commit-sdk-test.ts app/test/unit/ui/assisted-commit-details-test.tsx — 55/55 passed, including delayed disconnect/stop, returned stop errors, failed forced shutdown, primary request/cancellation/timeout causes and nested cleanup diagnostics.
  • corepack yarn lint:fix, corepack yarn lint, corepack yarn tsc --noEmit --pretty false — each passed, including library declarations.
  • corepack yarn test:e2e:build:unpackaged — production build passed. git diff --check and scoped planning-document Markdown checks passed.
  • Six actual bundled-SDK synthetic requests verified normal and delayed disconnect/stop cleanup: the owned process exited, the client disconnected and the original graceful continuation settled. No live model requests or customer data were used. This reproduces the cleanup failure family; the originally reported inner cleanup error was not supplied, so its exact cause is not confirmed.
  • Existing screenshots and recordings below illustrate the push workflow; they predate this cleanup-only change. No Windows validation is claimed for this revision.

Screenshots

0-02-pushing 1-03-push-failed-retry 2-03-push-error-details

Screen recording by Copilot:

0-assisted-push-scenarios.mp4

Manual screen recording:

cac-with-push.mov

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 16:45
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from 53a4d38 to 80e583e Compare October 9, 2026 16:45

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

File-fence scans double-count the object budget and leave ref/reflog traversal synchronously unbounded.

1 open finding
What changed in this PR

Adds optional per-repository pushing after Copilot-assisted commits, preserving local commits and enabling push-only retry when publication fails.

Changes:

  • Adds the push preference, progress/error UI, retry workflow, and persistence.
  • Integrates assisted pushes with existing Git authentication, hooks, fetching, and repository ownership fences.
  • Adds extensive Git, store, lifecycle, UI, and persistence coverage.
File Description
docs/​technical/​assisted-commit-transactions.md Documents push acceptance and rollback boundaries.
docs/​technical/​assisted-commit-runs.md Documents optional push, retry, and ownership behavior.
app/​src/​lib/​stores/​app-store.ts Coordinates assisted push execution and retry lifecycle.
app/​src/​lib/​git/​assisted-commit-push.ts Implements destination and ownership certification.
app/​src/​lib/​git/​file-version-fence.ts Adds filesystem routing fences.
app/​src/​lib/​git/​repository-operation.ts Extends Git leases and spawn certification.
app/​src/​lib/​git/​push.ts Adds restricted assisted-push invocation.
app/​src/​lib/​git/​fetch.ts Supports disabling submodule recursion.
app/​src/​lib/​git/​core.ts Runs final checks immediately before Git spawn.
app/​src/​lib/​git/​remote.ts Supports scoped lookup environments.
app/​src/​lib/​git/​assisted-commit/​execute.ts Adds reversible push preparation.
app/​src/​lib/​git/​assisted-commit/​git.ts Preserves index timestamps and exports verification helpers.
app/​src/​lib/​git/​assisted-commit/​state.ts Records index timestamps.
app/​src/​lib/​stores/​git-store.ts Propagates fetch recursion policy.
app/​src/​lib/​stores/​repository-state-cache.ts Caches repository push preferences.
app/​src/​lib/​stores/​helpers/​assisted-commit-push-storage.ts Persists push opt-in.
app/​src/​models/​assisted-commit-run.ts Adds push states and outcomes.
app/​src/​lib/​app-state.ts Adds the preference to changes state.
app/​src/​ui/​dispatcher/​dispatcher.ts Exposes preference and retry actions.
app/​src/​ui/​changes/​sidebar.tsx Passes the preference into the commit UI.
app/​src/​ui/​changes/​filter-changes-list.tsx Wires preference, retry, and error actions.
app/​src/​ui/​changes/​copilot-commit-panel.tsx Displays push progress and recovery controls.
app/​src/​ui/​changes/​commit-message.tsx Adds the assisted-only push option.
app/​src/​ui/​app.tsx Updates consent messaging.
app/​test/​helpers/​changes-state-helper.ts Supplies default preference state.
app/​test/​helpers/​assisted-commit-push.ts Adds local bare-remote fixtures.
app/​test/​unit/​assisted-commit-push-storage-test.ts Tests preference persistence.
app/​test/​unit/​stores/​assisted-commit-push-test.ts Tests primary push behavior.
app/​test/​unit/​stores/​assisted-commit-push-lifecycle-test.ts Tests ownership and retry lifecycle.
app/​test/​unit/​stores/​assisted-commit-push-hooks-test.ts Tests native hook handling.
app/​test/​unit/​stores/​assisted-commit-push-boundary-test.ts Tests filesystem and ownership boundaries.
app/​test/​unit/​git/​assisted-commit-push-destination-test.ts Tests frozen destinations.
app/​test/​unit/​git/​assisted-commit-completion-test.ts Tests reversible completion and timestamps.
app/​test/​unit/​git/​repository-operation-test.ts Tests admission and spawn fences.
app/​test/​unit/​git/​file-version-fence-test.ts Tests routing-fence behavior.
app/​test/​unit/​git/​fetch-test.ts Tests submodule recursion control.
app/​test/​unit/​ui/​copilot-commit-panel-test.tsx Tests progress and retry UI.
app/​test/​unit/​ui/​commit-message-test.tsx Tests preference and recovery controls.

🧠 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/git/file-version-fence.ts Resolved
@sergiou87 sergiou87 changed the title Add optional push and push-only retry for assisted commits Add optional push and push-only retry for assisted commits [5/5] Oct 15, 2026
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from 80e583e to 5055935 Compare October 15, 2026 15:43
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from 5055935 to fdf262b Compare October 15, 2026 17:18
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from fdf262b to 8f15fbe Compare October 16, 2026 12:43
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from 8f15fbe to 4e95b09 Compare October 19, 2026 18:00
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from 4e95b09 to 09308a1 Compare October 20, 2026 13:41
faithfulandtrue144-gif

This comment was marked as abuse.

@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from 09308a1 to a44ec9b Compare October 21, 2026 08:41
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch 2 times, most recently from 61985b8 to 45c5f4b Compare October 27, 2026 16:42
@sergiou87
sergiou87 force-pushed the sergiou87-assisted-commit-push branch from c93c53c to 92d8180 Compare October 29, 2026 14:16
@sergiou87

Copy link
Copy Markdown
Member Author

While I was testing it, I noticed:

  • In some cases I got an error saying it couldn't clean up the Copilot commit resources
  • The height of the Copilot panel changes its height constantly which is quite jarring

I will deal with both issues in separate PRs

@sergiou87
sergiou87 marked this pull request as ready for review October 29, 2026 17:58
@sergiou87
sergiou87 requested a review from a team as a code owner October 29, 2026 17:58
@sergiou87
sergiou87 requested a review from niik October 29, 2026 17:58
niik
niik previously approved these changes Nov 3, 2026
Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Carry the negative owner certificate through repository admission and publish stale-owner errors before returning. Keep accepted readers and retries from waiting on another checkout's recovery lease.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Keep the inherited checked commit options assertions alongside the assisted-only push choice, and verify preparing, pushing and push-retry actions retain the panel gear and busy state.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Verify token rotation continues the original commit-and-push intent while replacement sign-in with a reused token rolls back owned commits before any push.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Preserve cleanup-only retry before snapshot publication alongside full transaction recovery priority. Exercise opted-in selected and empty runs through repeated owned cleanup failure without starting a model, commit or push.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Retain native slash-normalized configuration overrides without losing their original route. Reject missing configuration leaves below regular-file ancestors. Preserve actual submodule working bytes across autocrlf settings and use platform-valid literal tracking/configuration names in fixtures.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Keep Windows backslashes literal in system and included configuration values. Verify the parsed rewrite equals the intended destination before checking the existing stale-file fence, and cover a Windows-shaped path with bundled Git on every platform.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Apply the inherited alert-only error announcement behavior to push failures, preserving inline retry controls while avoiding duplicate live-region speech.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Layer-five resource admission rejects a reserved clone destination before the older removal guard. Assert the stable typed busy classification, and verify admission succeeds after native clone completion without changing shared-source protection.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Integrate frozen push intent, publication, irreversible native entry and push-only retry with the assisted coordinator, state, readers and recovery owners. Keep AppStore as a thin command adapter and shared native network port without restoring feature lifecycle methods.

Retain physical owner identity after canonical resource discovery, clear obsolete cleanup and rollback authority together, and migrate regressions to actual feature owners. Cover separate push-state History locks without treating assisted execution as a multicommit operation.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Exercise native menu and stale preview entrypoints during push preparation, native push, post-push refresh and unsettled push errors. Retain the inherited physical-resource admission guard before Git work and separate assisted repository locks from multicommit operation state.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Rewrite optional push documentation around the product flow and approved Mermaid diagram. Separate outcomes, retry behavior, ownership/configuration guards, atomic publication and retained cleanup into navigable subsections without changing their contracts.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Charge each deduplicated root once and each child when discovered, not again when inspected. Keep the 4096-entry shared limit and bounded streaming directory traversal unchanged.

Cover exact acceptance and overflow boundaries for flat, nested and multiple-root filesystems, root deduplication, and repeated verification after growth and removal. Clarify the counting rule in the assisted push documentation.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
Render the existing weighted native push percentage without raw stage or stderr text, retaining finite bounded nondecreasing progress for each attempt. Keep post-acknowledgement refresh as a separate phase.

Keep compact assisted errors focused on truthful summary and recovery actions. Route Details for both push and commit errors through the existing popup queue and standard dialog, preserving the original error and optional retained causes without changing ordinary error dialogs.

Cover weighted/context/LFS progress, real panel-to-dialog wiring, long diagnostics, keyboard access and existing retry semantics. Document the UI behavior.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
…snapshots

Integrate path-separated repository state with capability-owned retry and recovery publication. Keep persisted push preferences shared by database identity without projecting active state across worktrees or sharing placeholder preferences.

Revalidate assigned account identity and issuing credential sessions before push-only retry and native entry, accepting token rotation but refusing replacement sign-in or account reassignment without rolling back accepted commits. Cover real native retry/account changes and worktree preference isolation.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
…ettles

A graceful timeout or returned shutdown error need not discard a valid plan after the owned SDK stdio runtime was force-stopped. Join the original graceful continuation under a separate bound, prevent a delayed disconnect from starting another stop, and log a content-free warning only after both shutdown and settlement complete.

Keep force-stop failure and unjoined work explicit, preserving original request, cancellation, deadline and billing causes. Include assisted cleanupErrors in Details cause traversal. Cover delayed teardown, fallback failure and six repeated real SDK requests with verified child exit.

Copilot-Session: 04587772-f6b7-4578-be1d-5d657ad7b3c5
tidy-dev
tidy-dev previously approved these changes Nov 3, 2026
@sergiou87
sergiou87 dismissed tidy-dev’s stale review November 3, 2026 17:14

The merge-base changed after approval.

@sergiou87
sergiou87 merged commit 4f843bc into development Nov 3, 2026
16 checks passed
@sergiou87
sergiou87 deleted the sergiou87-assisted-commit-push 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.

5 participants