Skip to content

Commit c19cbda

Browse files
authored
Merge pull request #814 from github/release/0.47.169
Pre-release 0.47.169
2 parents 0320f12 + 0b96622 commit c19cbda

File tree

61 files changed

+2340
-638
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2340
-638
lines changed

.github/workflows/auto-close-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
"At the moment we are not accepting contributions to the repository.
1616
1717
Feedback for GitHub Copilot for Xcode can be given in the [Copilot community discussions](https://github.com/github/CopilotForXcode/discussions)."
18+
if: ${{ !(startsWith(github.head_ref, 'release/') && github.event.pull_request.head.repo.full_name == github.repository) }}
1819
env:
1920
GH_REPO: ${{ github.repository }}
2021
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Auto-create Release PR
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
8+
jobs:
9+
create-pr:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Create pull request
18+
env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: |
21+
existing_pr_count="$(gh pr list \
22+
--state open \
23+
--base main \
24+
--head "${{ github.ref_name }}" \
25+
--json number \
26+
--jq 'length')"
27+
if [ "${existing_pr_count}" -gt 0 ]; then
28+
echo "Open pull request already exists for branch '${{ github.ref_name }}' into 'main'; skipping creation."
29+
else
30+
gh pr create \
31+
--title "$(git log -1 --pretty=%s)" \
32+
--body "Automated release PR." \
33+
--base main \
34+
--head "${{ github.ref_name }}"
35+
fi
36+
37+
- name: Approve pull request
38+
env:
39+
# PAT stored in github/CopilotForXcode, with write permissions to pull requests
40+
GH_TOKEN: ${{ secrets.XCODE_AUTO_APPROVE }}
41+
run: |
42+
gh pr review --approve "${{ github.ref_name }}"
43+
44+
- name: Auto-merge pull request
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
gh pr merge "${{ github.ref_name }}" \
49+
--auto \
50+
--delete-branch

.github/workflows/codeql.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
include:
30+
- language: actions
31+
build-mode: none
32+
- language: javascript-typescript
33+
build-mode: none
3034
- language: python
3135
build-mode: none
3236
- language: swift
@@ -37,7 +41,7 @@ jobs:
3741

3842
# Initializes the CodeQL tools for scanning.
3943
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v3
44+
uses: github/codeql-action/init@v4
4145
with:
4246
languages: ${{ matrix.language }}
4347
build-mode: ${{ matrix.build-mode }}
@@ -66,6 +70,6 @@ jobs:
6670
CODE_SIGNING_ALLOWED="NO"
6771
6872
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v3
73+
uses: github/codeql-action/analyze@v4
7074
with:
7175
category: "/language:${{matrix.language}}"

Copilot for Xcode.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@
845845
"@executable_path/../Frameworks",
846846
"@executable_path/../../../../Frameworks",
847847
);
848-
MACOSX_DEPLOYMENT_TARGET = 12.0;
848+
MACOSX_DEPLOYMENT_TARGET = 13.0;
849849
MARKETING_VERSION = "$(APP_VERSION)";
850850
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).EditorExtension";
851851
PRODUCT_NAME = Copilot;
@@ -874,7 +874,7 @@
874874
"@executable_path/../Frameworks",
875875
"@executable_path/../../../../Frameworks",
876876
);
877-
MACOSX_DEPLOYMENT_TARGET = 12.0;
877+
MACOSX_DEPLOYMENT_TARGET = 13.0;
878878
MARKETING_VERSION = "$(APP_VERSION)";
879879
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).EditorExtension";
880880
PRODUCT_NAME = Copilot;
@@ -936,7 +936,7 @@
936936
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
937937
GCC_WARN_UNUSED_FUNCTION = YES;
938938
GCC_WARN_UNUSED_VARIABLE = YES;
939-
MACOSX_DEPLOYMENT_TARGET = 12.0;
939+
MACOSX_DEPLOYMENT_TARGET = 13.0;
940940
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
941941
MTL_FAST_MATH = YES;
942942
ONLY_ACTIVE_ARCH = YES;
@@ -991,7 +991,7 @@
991991
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
992992
GCC_WARN_UNUSED_FUNCTION = YES;
993993
GCC_WARN_UNUSED_VARIABLE = YES;
994-
MACOSX_DEPLOYMENT_TARGET = 12.0;
994+
MACOSX_DEPLOYMENT_TARGET = 13.0;
995995
MTL_ENABLE_DEBUG_INFO = NO;
996996
MTL_FAST_MATH = YES;
997997
SDKROOT = macosx;
@@ -1022,7 +1022,7 @@
10221022
"$(inherited)",
10231023
"@executable_path/../Frameworks",
10241024
);
1025-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1025+
MACOSX_DEPLOYMENT_TARGET = 13.0;
10261026
MARKETING_VERSION = "$(APP_VERSION)";
10271027
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE)";
10281028
PRODUCT_MODULE_NAME = Copilot_for_Xcode;
@@ -1056,7 +1056,7 @@
10561056
"$(inherited)",
10571057
"@executable_path/../Frameworks",
10581058
);
1059-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1059+
MACOSX_DEPLOYMENT_TARGET = 13.0;
10601060
MARKETING_VERSION = "$(APP_VERSION)";
10611061
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE)";
10621062
PRODUCT_NAME = "$(HOST_APP_NAME)";
@@ -1072,7 +1072,7 @@
10721072
CODE_SIGN_STYLE = Automatic;
10731073
DEVELOPMENT_TEAM = VEKTX9H2N7;
10741074
ENABLE_HARDENED_RUNTIME = YES;
1075-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1075+
MACOSX_DEPLOYMENT_TARGET = 13.0;
10761076
PRODUCT_NAME = "$(TARGET_NAME)";
10771077
SKIP_INSTALL = YES;
10781078
SWIFT_VERSION = 5.0;
@@ -1087,7 +1087,7 @@
10871087
DEVELOPMENT_TEAM = "";
10881088
"DEVELOPMENT_TEAM[sdk=macosx*]" = VEKTX9H2N7;
10891089
ENABLE_HARDENED_RUNTIME = YES;
1090-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1090+
MACOSX_DEPLOYMENT_TARGET = 13.0;
10911091
PRODUCT_NAME = "$(TARGET_NAME)";
10921092
PROVISIONING_PROFILE_SPECIFIER = "";
10931093
SKIP_INSTALL = YES;
@@ -1117,7 +1117,7 @@
11171117
"$(inherited)",
11181118
"@executable_path/../Frameworks",
11191119
);
1120-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1120+
MACOSX_DEPLOYMENT_TARGET = 13.0;
11211121
MARKETING_VERSION = "$(APP_VERSION)";
11221122
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).ExtensionService";
11231123
PRODUCT_NAME = "$(EXTENSION_SERVICE_NAME)";
@@ -1151,7 +1151,7 @@
11511151
"$(inherited)",
11521152
"@executable_path/../Frameworks",
11531153
);
1154-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1154+
MACOSX_DEPLOYMENT_TARGET = 13.0;
11551155
MARKETING_VERSION = "$(APP_VERSION)";
11561156
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).ExtensionService";
11571157
PRODUCT_NAME = "$(EXTENSION_SERVICE_NAME)";
@@ -1172,7 +1172,7 @@
11721172
ENABLE_USER_SCRIPT_SANDBOXING = YES;
11731173
GCC_C_LANGUAGE_STANDARD = gnu17;
11741174
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
1175-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1175+
MACOSX_DEPLOYMENT_TARGET = 13.0;
11761176
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).CommunicationBridge";
11771177
PRODUCT_NAME = "$(TARGET_NAME)";
11781178
SKIP_INSTALL = YES;
@@ -1193,7 +1193,7 @@
11931193
ENABLE_USER_SCRIPT_SANDBOXING = YES;
11941194
GCC_C_LANGUAGE_STANDARD = gnu17;
11951195
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
1196-
MACOSX_DEPLOYMENT_TARGET = 12.0;
1196+
MACOSX_DEPLOYMENT_TARGET = 13.0;
11971197
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).CommunicationBridge";
11981198
PRODUCT_NAME = "$(TARGET_NAME)";
11991199
PROVISIONING_PROFILE_SPECIFIER = "";

Copilot for Xcode/App.swift

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
2626
}
2727

2828
func applicationDidFinishLaunching(_ notification: Notification) {
29-
if #available(macOS 13.0, *) {
30-
checkBackgroundPermissions()
31-
}
32-
29+
checkBackgroundPermissions()
30+
3331
let launchMode = determineLaunchMode()
3432
handleLaunchMode(launchMode)
3533
}
3634

3735
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
38-
if #available(macOS 13.0, *) {
39-
checkBackgroundPermissions()
40-
}
41-
36+
checkBackgroundPermissions()
37+
4238
let launchMode = determineLaunchMode()
4339
handleLaunchMode(launchMode)
4440
return true
@@ -113,7 +109,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
113109
}
114110
}
115111

116-
@available(macOS 13.0, *)
117112
private func checkBackgroundPermissions() {
118113
Task {
119114
// Direct check of permission status
@@ -122,15 +117,17 @@ class AppDelegate: NSObject, NSApplicationDelegate {
122117

123118
if !isPermissionGranted {
124119
// Only show alert if permission isn't granted
125-
DispatchQueue.main.async {
120+
await MainActor.run {
126121
if !self.permissionAlertShown {
127122
showBackgroundPermissionAlert()
128123
self.permissionAlertShown = true
129124
}
130125
}
131126
} else {
132127
// Permission is granted, reset flag
133-
self.permissionAlertShown = false
128+
await MainActor.run {
129+
self.permissionAlertShown = false
130+
}
134131
}
135132
}
136133
}
@@ -272,10 +269,8 @@ func activateAndOpenSettings() {
272269
if #available(macOS 14.0, *) {
273270
let environment = SettingsEnvironment()
274271
environment.open()
275-
} else if #available(macOS 13.0, *) {
276-
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
277272
} else {
278-
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
273+
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
279274
}
280275
}
281276

Core/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import PackageDescription
88

99
let package = Package(
1010
name: "Core",
11-
platforms: [.macOS(.v12)],
11+
platforms: [.macOS(.v13)],
1212
products: [
1313
.library(
1414
name: "Service",

Core/Sources/ChatService/ChatService.swift

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,14 @@ public final class ChatService: ChatServiceType, ObservableObject {
6464
public var memory: ContextAwareAutoManagedChatMemory
6565
@Published public internal(set) var chatHistory: [ChatMessage] = []
6666
@Published public internal(set) var isReceivingMessage = false
67+
@Published public internal(set) var isSummarizingConversation = false
6768
@Published public internal(set) var fileEditMap: OrderedDictionary<URL, FileEdit> = [:]
69+
@Published public internal(set) var contextSizeInfo: ContextSizeInfo? = nil
6870
public internal(set) var requestType: RequestType? = nil
6971
public private(set) var chatTabInfo: ChatTabInfo
7072
private let conversationProvider: ConversationServiceProvider?
7173
private let conversationProgressHandler: ConversationProgressHandler
74+
private let compressionHandler: CompressionHandler
7275
private let conversationContextHandler: ConversationContextHandler = ConversationContextHandlerImpl.shared
7376
// sync all the files in the workspace to watch for changes.
7477
private let watchedFilesHandler: WatchedFilesHandler = WatchedFilesHandlerImpl.shared
@@ -85,10 +88,12 @@ public final class ChatService: ChatServiceType, ObservableObject {
8588
init(provider: any ConversationServiceProvider,
8689
memory: ContextAwareAutoManagedChatMemory = ContextAwareAutoManagedChatMemory(),
8790
conversationProgressHandler: ConversationProgressHandler = ConversationProgressHandlerImpl.shared,
91+
compressionHandler: CompressionHandler = CompressionHandlerImpl.shared,
8892
chatTabInfo: ChatTabInfo) {
8993
self.memory = memory
9094
self.conversationProvider = provider
9195
self.conversationProgressHandler = conversationProgressHandler
96+
self.compressionHandler = compressionHandler
9297
self.chatTabInfo = chatTabInfo
9398
memory.chatService = self
9499

@@ -134,6 +139,19 @@ public final class ChatService: ChatServiceType, ObservableObject {
134139
conversationProgressHandler.onEnd.sink { [weak self] (token, progress) in
135140
self?.handleProgressEnd(token: token, progress: progress)
136141
}.store(in: &cancellables)
142+
143+
compressionHandler.onCompressionStarted.sink { [weak self] compressionConversationId in
144+
guard let self, self.conversationId == compressionConversationId else { return }
145+
self.isSummarizingConversation = true
146+
}.store(in: &cancellables)
147+
148+
compressionHandler.onCompressionCompleted.sink { [weak self] completedNotification in
149+
guard let self, self.conversationId == completedNotification.conversationId else { return }
150+
self.isSummarizingConversation = false
151+
if let contextInfo = completedNotification.contextInfo {
152+
self.contextSizeInfo = contextInfo
153+
}
154+
}.store(in: &cancellables)
137155
}
138156

139157
private func subscribeToConversationContextRequest() {
@@ -745,7 +763,11 @@ public final class ChatService: ChatServiceType, ObservableObject {
745763
guard let workDownToken = activeRequestId, workDownToken == token else {
746764
return
747765
}
748-
766+
767+
if let contextSize = progress.contextSize {
768+
self.contextSizeInfo = contextSize
769+
}
770+
749771
let id = progress.turnId
750772
var content = ""
751773
var references: [ConversationReference] = []
@@ -895,6 +917,7 @@ public final class ChatService: ChatServiceType, ObservableObject {
895917
private func resetOngoingRequest(with turnStatus: ChatMessage.TurnStatus = .success) {
896918
activeRequestId = nil
897919
isReceivingMessage = false
920+
isSummarizingConversation = false
898921
requestType = nil
899922

900923
// Clear turn tracking data

0 commit comments

Comments
 (0)