Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum OpenCodeProviderDescriptor {
isPrimaryProvider: false,
usesAccountFallback: false,
browserCookieOrder: ProviderBrowserCookieDefaults.opencodeCookieImportOrder,
dashboardURL: "https://opencode.ai",
dashboardURL: "https://opencode.ai/auth",
statusPageURL: nil),
branding: ProviderBranding(
iconStyle: .opencode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum OpenCodeGoProviderDescriptor {
isPrimaryProvider: false,
usesAccountFallback: false,
browserCookieOrder: ProviderBrowserCookieDefaults.defaultImportOrder,
dashboardURL: "https://opencode.ai",
dashboardURL: "https://opencode.ai/auth",
statusPageURL: nil),
branding: ProviderBranding(
iconStyle: .opencodego,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum OpenCodeGoUsageError: LocalizedError {
public struct OpenCodeGoUsageFetcher: Sendable {
private static let log = CodexBarLog.logger(LogCategories.opencodeGoUsage)
private static let baseURL = URL(string: "https://opencode.ai")!
private static let authURL = URL(string: "https://opencode.ai/auth")!
private static let serverURL = URL(string: "https://opencode.ai/_server")!
private static let workspacesServerID = "def39973159c7f0483d8793a822b8dbb10d067e12c65455fcb4608459ba0234f"
private static let billingServerID = "c83b78a614689c38ebee981f9b39a8b377716db85c1fd7dbab604adc02d3313d"
Expand Down Expand Up @@ -263,7 +264,7 @@ public struct OpenCodeGoUsageFetcher: Sendable {
guard let workspaceID = self.normalizeWorkspaceID(raw),
let url = URL(string: "\(self.baseURL.absoluteString)/workspace/\(workspaceID)/go")
else {
return self.baseURL
return self.authURL
}
return url
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/CodexBarTests/OpenCodeGoUsageFetcherErrorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct OpenCodeGoUsageFetcherErrorTests {
.absoluteString == "https://opencode.ai/workspace/wrk_def456/go")
#expect(
OpenCodeGoUsageFetcher.dashboardURL(workspaceID: nil)
.absoluteString == "https://opencode.ai")
.absoluteString == "https://opencode.ai/auth")
}

private struct UsageWindow {
Expand Down
10 changes: 10 additions & 0 deletions Tests/CodexBarTests/OpenCodeProviderDescriptorTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Testing
@testable import CodexBarCore

struct OpenCodeProviderDescriptorTests {
@Test
func `dashboard links use the official auth entry point`() {
#expect(OpenCodeProviderDescriptor.descriptor.metadata.dashboardURL == "https://opencode.ai/auth")
#expect(OpenCodeGoProviderDescriptor.descriptor.metadata.dashboardURL == "https://opencode.ai/auth")
}
}
Loading