Skip to content

Commit dfaff48

Browse files
committed
Pre-release 0.49.175
1 parent d52b1ad commit dfaff48

4 files changed

Lines changed: 41 additions & 23 deletions

File tree

.github/workflows/auto-create-release-pr.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,23 @@ jobs:
4545
env:
4646
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747
run: |
48-
gh pr checks "${{ github.ref_name }}" --watch
48+
for i in $(seq 1 60); do
49+
other_checks=$(gh pr checks "${{ github.ref_name }}" | grep -v "create-pr" || true)
50+
if echo "$other_checks" | grep -wq "fail"; then
51+
echo "Required checks failed."
52+
exit 1
53+
fi
54+
if [ -z "$other_checks" ]; then
55+
echo "No other checks found yet, waiting..."
56+
elif ! echo "$other_checks" | grep -wq "pending"; then
57+
echo "All required checks passed."
58+
exit 0
59+
fi
60+
echo "Waiting for checks..."
61+
sleep 10
62+
done
63+
echo "Timed out waiting for required checks."
64+
exit 1
4965
5066
- name: Merge pull request
5167
env:

ExtensionService/AppDelegate.swift

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ enum CLSMessageType {
516516
case chatLimitReached
517517
case completionLimitReached
518518
case byokLimitedReached
519+
case monthlyAICreditsLimitReached
519520
case other
520521

521522
var summary: String {
@@ -526,6 +527,8 @@ enum CLSMessageType {
526527
return "Monthly Completion Limit Reached"
527528
case .byokLimitedReached:
528529
return "BYOK Limit Reached"
530+
case .monthlyAICreditsLimitReached:
531+
return "Monthly AI Credits Limit Reached"
529532
case .other:
530533
return "CLS Error"
531534
}
@@ -537,14 +540,6 @@ struct CLSMessage {
537540
let detail: String
538541
}
539542

540-
func extractDateFromCLSMessage(_ message: String) -> String? {
541-
let pattern = #"until (\d{1,2}/\d{1,2}/\d{4}, \d{1,2}:\d{2}:\d{2} [AP]M)"#
542-
if let range = message.range(of: pattern, options: .regularExpression) {
543-
return String(message[range].dropFirst(6))
544-
}
545-
return nil
546-
}
547-
548543
func getCLSMessageSummary(_ message: String) -> CLSMessage {
549544
let messageType: CLSMessageType
550545

@@ -555,16 +550,11 @@ func getCLSMessageSummary(_ message: String) -> CLSMessage {
555550
messageType = .completionLimitReached
556551
} else if message.contains("BYOK") {
557552
messageType = .byokLimitedReached
553+
} else if message.contains("You've used your monthly AI Credits") {
554+
messageType = .monthlyAICreditsLimitReached
558555
} else {
559556
messageType = .other
560557
}
561558

562-
let detail: String
563-
if let date = extractDateFromCLSMessage(message) {
564-
detail = "Visit GitHub to check your usage and upgrade to Copilot Pro or wait until \(date) for your limit to reset."
565-
} else {
566-
detail = message
567-
}
568-
569-
return CLSMessage(summary: messageType.summary, detail: detail)
559+
return CLSMessage(summary: messageType.summary, detail: message)
570560
}

Tool/Sources/GitHubCopilotService/Services/QuotaNotifier.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,14 @@ public class QuotaNotifierImpl: NSObject, QuotaNotifier {
179179
Task { @MainActor in
180180
let quotaInfo = await Status.shared.getQuotaInfo()
181181
let actions = buildWarningActions(params: params, quotaInfo: quotaInfo)
182-
WarningStateManager.shared.setWarning(WarningContent(
183-
message: params.message,
184-
severity: params.severity,
185-
actions: actions
186-
))
182+
let isCompletionsWarning = params.message.localizedCaseInsensitiveContains("completions")
183+
if !isCompletionsWarning {
184+
WarningStateManager.shared.setWarning(WarningContent(
185+
message: params.message,
186+
severity: params.severity,
187+
actions: actions
188+
))
189+
}
187190
await NotificationCenterCoordinator.shared.setupIfNeeded()
188191
self.registerCategoriesIfNeeded()
189192
await sendAppleNotification(params, categoryID: notificationCategoryID(for: actions))

Tool/Sources/GitHubCopilotService/Services/WarningState.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Foundation
2+
import Status
23

34
public struct WarningAction: Equatable {
45
public var title: String
@@ -27,7 +28,15 @@ public class WarningStateManager: ObservableObject {
2728

2829
@Published public var currentWarning: WarningContent?
2930

30-
private init() {}
31+
private init() {
32+
DistributedNotificationCenter.default().addObserver(
33+
forName: .authStatusDidChange,
34+
object: nil,
35+
queue: .main
36+
) { [weak self] _ in
37+
self?.dismissWarning()
38+
}
39+
}
3140

3241
public func setWarning(_ warning: WarningContent) {
3342
DispatchQueue.main.async { [weak self] in

0 commit comments

Comments
 (0)