Repository navigation
Reuse shared Copilot lifecycle helpers [6/7] - #23079
Merged
Merged
Conversation
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
from
October 26, 2026 16:07
a6c51c8 to
50f1473
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in the lifecycle refactor, and focused regression coverage supports the preserved cancellation, error, and cleanup behavior.
No open issues 🎉
What changed in this PR
This follow-up consolidates Copilot lifecycle handling in shared helpers, reducing duplication while preserving distinct behavior for commit messages, assisted-commit planning, and conflict resolution.
Changes:
- Reuse shared cancellation handling for model discovery and client/session setup, including late-resource cleanup.
- Extract ordinary response waiting while preserving SDK timeouts, billing errors, and caller-owned teardown.
- Add regression coverage for cancellation, listener cleanup, planner ordering, and conflict-resolution responses.
| File | Description |
|---|---|
app/test/unit/stores/copilot-store-test.ts |
Adds conflict reasoning, response, timeout, and teardown coverage. |
app/test/unit/copilot-operation-test.ts |
Tests shared cancellation, billing behavior, and planner event ordering. |
app/src/lib/stores/copilot-store.ts |
Replaces duplicate lifecycle logic with shared helpers. |
app/src/lib/copilot-operation.ts |
Adds shared response handling and supports synchronous late disposal. |
Review effort: Balanced
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
from
October 27, 2026 00:48
50f1473 to
dcfb126
Compare
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
from
October 27, 2026 16:54
dcfb126 to
9f68da9
Compare
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
from
October 27, 2026 21:33
9f68da9 to
1e84e39
Compare
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
from
October 28, 2026 08:05
1e84e39 to
4900c8d
Compare
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
from
October 28, 2026 13:53
4900c8d to
4db6af7
Compare
This was referenced Oct 28, 2026
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
3 times, most recently
from
October 29, 2026 12:23
5cd6e2a to
78764af
Compare
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
2 times, most recently
from
October 29, 2026 15:57
f19a2f6 to
6594855
Compare
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
2 times, most recently
from
November 3, 2026 16:11
86e77f6 to
f79a05d
Compare
Base automatically changed from
sergiou87-assisted-commit-push
to
development
November 3, 2026 17:14
Use the shared cancellable waiter for commit-message and conflict-resolution setup, preserving feature-specific cancellation errors and late resource cleanup. Keep ordinary SDK response handling separate from planner completion and conflict streaming policies. Add regression coverage for cancellation, cleanup, billing, event ordering, and streaming teardown. Copilot-Session: 6c22d26f-43f2-4fed-b187-bb89e0453cf8
sergiou87
force-pushed
the
sergiou87-shared-copilot-operations
branch
from
November 3, 2026 17:14
f79a05d to
e77acb9
Compare
sergiou87
marked this pull request as ready for review
November 3, 2026 20:30
sergiou87
enabled stacked auto-merge
November 3, 2026 20:38
tidy-dev
approved these changes
Nov 4, 2026
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 issue closed. Depends on #22991 and targets
sergiou87-assisted-commit-pushso the diff contains only this follow-up.Stack
Merge in order, starting with 1. Each PR builds on the preceding PR.
Description
awaitCancellableCopilotOperationfor ordinary commit-message model discovery, client/session setup, and response waiting, and for conflict-resolution client/session setup. Remove the duplicate store-level cancellation implementation; preserve caller-specific cancellation errors and dispose late-created resources exactly once, reporting cleanup failures.sendCopilotMessageRequest, using the existing typed session adapter. Preserve SDKsendAndWaittimeouts and error policy: nonbilling session errors are logged, and 402 billing metadata replaces SDK rejections without overriding successful responses.Validation
Completed after rebasing the single shared-helper commit onto test-organization parent
103dbef8734b223060c13cc88a4e9d663e19ffbc. Validated head:2f46f2655ef0c0325b92b97d2ad8b9a8df6d7231.yarn test app/test/unit/copilot-operation-test.ts app/test/unit/stores/copilot-store-test.ts app/test/unit/stores/copilot-store-credentials-test.ts app/test/unit/stores/copilot-assisted-commit-test.ts app/test/unit/copilot-assisted-commit-sdk-test.ts app/test/unit/copilot-conflict-resolution-test.ts app/test/unit/refresh-token-consumers-test.ts app/test/unit/copilot-sdk-auth-test.ts 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-upstream-integration-test.ts app/test/unit/stores/assisted-commit-reader-publication-test.ts app/test/unit/git/clone-test.ts app/test/unit/git/repository-operation-test.ts app/test/unit/repository-state-cache-test.ts app/test/unit/ui/repository-settings-test.tsx— passed, 527 tests. Includes shared lifecycle coverage and all reorganized behavior suites.yarn lint:fix— passed; no additional working-tree changes.yarn tsc --noEmit— passed with strict declaration checking, withoutskipLibCheck.yarn lint— passed.GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all yarn test— full suite passed: 3,222 passed, 2 skipped, 0 failed. The process-only override accommodates the known CLI-injectedsafe.bareRepository=explicitrestriction; no repository or global Git configuration was changed. Historicalyarn test app/test/unit/git/push-test.ts app/test/unit/git/rev-parse-test.tsexecution independently reproduced the four unrelated bare-fixture failures (24 passed, 4 failed).Team-authored review
Evidence: Check validation above. No visual artifact is applicable to this backend-only change.
Review path: Lightweight review. The author has assessed the change and evidence.
Screenshots
N/A — lifecycle refactor with no UI changes.
Release notes
Notes: no-notes