Skip to content

Commit f3011e4

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 7d48fb0 + 82d3232 commit f3011e4

211 files changed

Lines changed: 15491 additions & 1686 deletions

File tree

Some content is hidden

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

.github/actions/set-xcode-version/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
Xcode version to use, in semver(ish)-style matching the format on the Actions runner image.
77
See available versions at https://github.com/actions/runner-images/blame/main/images/macos/macos-14-Readme.md#xcode
88
required: false
9-
default: '15.3'
9+
default: '16.2'
1010
outputs:
1111
xcode-path:
1212
description: "Path to current Xcode version"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Core/Package.resolved
117117

118118
# Copilot language server
119119
Server/node_modules/
120+
Server/dist
120121

121122
# Releases
122123
/releases/

CHANGELOG.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## 0.35.0 - May 19, 2025
9+
### Added
10+
- Launched Agent Mode. Copilot will automatically use multiple requests to edit files, run terminal commands, and fix errors.
11+
- Introduced Model Context Protocol (MCP) support in Agent Mode, allowing you to configure MCP tools to extend capabilities.
12+
13+
### Changed
14+
- Added a button to enable/disable referencing current file in conversations
15+
- Added an animated progress icon in the response section
16+
- Refined onboarding experience with updated instruction screens and welcome views
17+
- Improved conversation reliability with extended timeout limits for agent requests
18+
19+
### Fixed
20+
- Addressed critical error handling issues in core functionality
21+
- Resolved UI inconsistencies with chat interface padding adjustments
22+
- Implemented custom certificate handling using system environment variables `NODE_EXTRA_CA_CERTS` and `NODE_TLS_REJECT_UNAUTHORIZED`, fixing network access issues
23+
24+
## 0.34.0 - April 29, 2025
25+
### Added
26+
- Added support for new models in Chat: OpenAI GPT-4.1, o3 and o4-mini, Gemini 2.5 Pro
27+
28+
### Changed
29+
- Switched default model to GPT-4.1 for new installations
30+
- Enhanced model selection interface
31+
32+
### Fixed
33+
- Resolved critical error handling issues
34+
35+
## 0.33.0 - April 17, 2025
36+
### Added
37+
- Added support for new models in Chat: Claude 3.7 Sonnet and GPT 4.5
38+
- Implemented @workspace context feature allowing questions about the entire codebase in Copilot Chat
39+
40+
### Changed
41+
- Simplified access to Copilot Chat from the Copilot for Xcode app with a single click
42+
- Enhanced instructions for granting background permissions
43+
44+
### Fixed
45+
- Resolved false alarms for sign-in and free plan limit notifications
46+
- Improved app launch performance
47+
- Fixed workspace and context update issues
48+
49+
## 0.32.0 - March 11, 2025 (General Availability)
50+
### Added
51+
- Implemented model picker for selecting LLM model in chat
52+
- Introduced new `/releaseNotes` slash command for accessing release information
53+
54+
### Changed
55+
- Improved focus handling with automatic switching between chat text field and file search bar
56+
- Enhanced keyboard navigation support for file picker in chat context
57+
- Refined instructions for granting accessibility and extension permissions
58+
- Enhanced accessibility compliance for the chat window
59+
- Redesigned notification and status bar menu styles for better usability
60+
61+
### Fixed
62+
- Resolved compatibility issues with macOS 12/13/14
63+
- Fixed handling of invalid workspace switch event '/'
64+
- Corrected chat attachment file picker to respect workspace scope
65+
- Improved icon display consistency across different themes
66+
- Added support for previously unsupported file types (.md, .txt) in attachments
67+
- Adjusted incorrect margins in chat window UI
68+
69+
## 0.31.0 - February 11, 2025 (Public Preview)
70+
### Added
71+
- Added Copilot Chat support
72+
- Added GitHub Freeplan support
73+
- Implemented conversation and chat history management across multiple Xcode instances
74+
- Introduced multi-file context support for comprehensive code understanding
75+
- Added slash commands for specialized operations

CommunicationBridge/ServiceDelegate.swift

Lines changed: 93 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -136,28 +136,100 @@ actor ExtensionServiceLauncher {
136136
isLaunching = true
137137

138138
Logger.communicationBridge.info("Launching extension service app.")
139-
140-
NSWorkspace.shared.openApplication(
141-
at: appURL,
142-
configuration: {
143-
let configuration = NSWorkspace.OpenConfiguration()
144-
configuration.createsNewApplicationInstance = false
145-
configuration.addsToRecentItems = false
146-
configuration.activates = false
147-
return configuration
148-
}()
149-
) { app, error in
150-
if let error = error {
151-
Logger.communicationBridge.error(
152-
"Failed to launch extension service app: \(error)"
153-
)
154-
} else {
155-
Logger.communicationBridge.info(
156-
"Finished launching extension service app."
157-
)
139+
140+
// First check if the app is already running
141+
if let runningApp = NSWorkspace.shared.runningApplications.first(where: {
142+
$0.bundleIdentifier == appIdentifier
143+
}) {
144+
Logger.communicationBridge.info("Extension service app already running with PID: \(runningApp.processIdentifier)")
145+
self.application = runningApp
146+
self.isLaunching = false
147+
return
148+
}
149+
150+
// Implement a retry mechanism with exponential backoff
151+
Task {
152+
var retryCount = 0
153+
let maxRetries = 3
154+
var success = false
155+
156+
while !success && retryCount < maxRetries {
157+
do {
158+
// Add a delay between retries with exponential backoff
159+
if retryCount > 0 {
160+
let delaySeconds = pow(2.0, Double(retryCount - 1))
161+
Logger.communicationBridge.info("Retrying launch after \(delaySeconds) seconds (attempt \(retryCount + 1) of \(maxRetries))")
162+
try await Task.sleep(nanoseconds: UInt64(delaySeconds * 1_000_000_000))
163+
}
164+
165+
// Use a task-based approach for launching with timeout
166+
let launchTask = Task<NSRunningApplication?, Error> { () -> NSRunningApplication? in
167+
return await withCheckedContinuation { continuation in
168+
NSWorkspace.shared.openApplication(
169+
at: appURL,
170+
configuration: {
171+
let configuration = NSWorkspace.OpenConfiguration()
172+
configuration.createsNewApplicationInstance = false
173+
configuration.addsToRecentItems = false
174+
configuration.activates = false
175+
return configuration
176+
}()
177+
) { app, error in
178+
if let error = error {
179+
continuation.resume(returning: nil)
180+
} else {
181+
continuation.resume(returning: app)
182+
}
183+
}
184+
}
185+
}
186+
187+
// Set a timeout for the launch operation
188+
let timeoutTask = Task {
189+
try await Task.sleep(nanoseconds: 10_000_000_000) // 10 seconds
190+
return
191+
}
192+
193+
// Wait for either the launch or the timeout
194+
let app = try await withTaskCancellationHandler {
195+
try await launchTask.value ?? nil
196+
} onCancel: {
197+
launchTask.cancel()
198+
}
199+
200+
// Cancel the timeout task
201+
timeoutTask.cancel()
202+
203+
if let app = app {
204+
// Success!
205+
self.application = app
206+
success = true
207+
break
208+
} else {
209+
// App is nil, retry
210+
retryCount += 1
211+
Logger.communicationBridge.info("Launch attempt \(retryCount) failed, app is nil")
212+
}
213+
} catch {
214+
retryCount += 1
215+
Logger.communicationBridge.error("Error during launch attempt \(retryCount): \(error.localizedDescription)")
216+
}
158217
}
159-
160-
self.application = app
218+
219+
// Double-check we have a valid application
220+
if !success && self.application == nil {
221+
// After all retries, check once more if the app is running (it might have launched but we missed the callback)
222+
if let runningApp = NSWorkspace.shared.runningApplications.first(where: {
223+
$0.bundleIdentifier == appIdentifier
224+
}) {
225+
Logger.communicationBridge.info("Found running extension service after retries: \(runningApp.processIdentifier)")
226+
self.application = runningApp
227+
success = true
228+
} else {
229+
Logger.communicationBridge.info("Failed to launch extension service after \(maxRetries) attempts")
230+
}
231+
}
232+
161233
self.isLaunching = false
162234
}
163235
}

Copilot for Xcode.xcodeproj/project.pbxproj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 56;
6+
objectVersion = 70;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -255,6 +255,10 @@
255255
C8F103292A7A365000D28F4F /* launchAgent.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = launchAgent.plist; sourceTree = "<group>"; };
256256
/* End PBXFileReference section */
257257

258+
/* Begin PBXFileSystemSynchronizedRootGroup section */
259+
9E6A029A2DBDF64200AB6BD5 /* Server */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Server; sourceTree = SOURCE_ROOT; };
260+
/* End PBXFileSystemSynchronizedRootGroup section */
261+
258262
/* Begin PBXFrameworksBuildPhase section */
259263
C81458892939EFDC00135263 /* Frameworks */ = {
260264
isa = PBXFrameworksBuildPhase;
@@ -357,6 +361,7 @@
357361
C81458AE293A009800135263 /* Config.debug.xcconfig */,
358362
C8CD828229B88006008D044D /* TestPlan.xctestplan */,
359363
C828B27D2B1F241500E7612A /* ExtensionPoint.appextensionpoint */,
364+
9E6A029A2DBDF64200AB6BD5 /* Server */,
360365
C81D181E2A1B509B006C1B70 /* Tool */,
361366
C8189B282938979000C9DCDA /* Core */,
362367
C8189B182938972F00C9DCDA /* Copilot for Xcode */,
@@ -700,24 +705,21 @@
700705
/* Begin PBXShellScriptBuildPhase section */
701706
3A60421A2C8955710006B34C /* ShellScript */ = {
702707
isa = PBXShellScriptBuildPhase;
708+
alwaysOutOfDate = 1;
703709
buildActionMask = 2147483647;
704710
files = (
705711
);
706712
inputFileListPaths = (
707713
);
708714
inputPaths = (
709-
"$(SRCROOT)/Server/package.json",
710-
"$(SRCROOT)/Server/package-lock.json",
711715
);
712716
outputFileListPaths = (
713717
);
714718
outputPaths = (
715-
"$(SRCROOT)/Server/node_modules/@github/copilot-language-server/native/darwin-x64/copilot-language-server",
716-
"$(SRCROOT)/Server/node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server-arm64",
717719
);
718720
runOnlyForDeploymentPostprocessing = 0;
719721
shellPath = /bin/sh;
720-
shellScript = "npm -C Server install\ncp Server/node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server Server/node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server-arm64\n";
722+
shellScript = "export PATH=/usr/local/bin:/opt/homebrew/bin:$PATH\n\nnpm -C Server install\ncp Server/node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server Server/node_modules/@github/copilot-language-server/native/darwin-arm64/copilot-language-server-arm64\n\necho \"Build and copy webview js/html files as the bundle resources\"\nnpm -C Server run build\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources/webViewDist\"\ncp -R Server/dist/* \"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources/webViewDist/\"\n";
721723
};
722724
/* End PBXShellScriptBuildPhase section */
723725

Copilot for Xcode.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)