From 88fb6e8a7e494b9c70d13af67331f8df5a5453e2 Mon Sep 17 00:00:00 2001 From: Chris Busillo Date: Thu, 28 May 2026 23:03:05 -0400 Subject: [PATCH] fix: prefer Every Code auth defaults --- README.md | 4 ++-- Sources/CodexRateLimitProbe/main.swift | 9 +++++++-- Sources/ContextPanelCore/AccountConfigurationStore.swift | 4 ++-- Sources/ContextPanelPreview/ContextPanelPreviewApp.swift | 2 +- Sources/SnapshotStoreProbe/main.swift | 2 +- .../AccountConfigurationStoreTests.swift | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0c601da..3912d7f 100644 --- a/README.md +++ b/README.md @@ -97,11 +97,11 @@ The package includes development probes for validating provider limit signals without printing secrets or raw provider responses: ```sh -swift run CodexRateLimitProbe --auth ~/.codex/auth.json +swift run CodexRateLimitProbe --auth ~/.code/auth_accounts.json GEMINI_OAUTH_CLIENT_ID=... GEMINI_OAUTH_CLIENT_SECRET=... \ swift run GeminiQuotaProbe --auth ~/.gemini/oauth_creds.json swift run ClaudeLimitProbe -swift run SnapshotStoreProbe --codex-auth ~/.codex/auth.json --include-claude +swift run SnapshotStoreProbe --codex-auth ~/.code/auth_accounts.json --include-claude ``` The Codex and Gemini probes can return live percent-window quota buckets for diff --git a/Sources/CodexRateLimitProbe/main.swift b/Sources/CodexRateLimitProbe/main.swift index f82d9df..5995c70 100644 --- a/Sources/CodexRateLimitProbe/main.swift +++ b/Sources/CodexRateLimitProbe/main.swift @@ -45,8 +45,13 @@ struct ProbeConfiguration { private static func defaultAuthPath() -> String { let environment = ProcessInfo.processInfo.environment let home = environment["HOME"] ?? FileManager.default.homeDirectoryForCurrentUser.path - let codexHome = environment["CODEX_HOME"] ?? "\(home)/.codex" - return "\(codexHome)/auth.json" + if let codeHome = environment["CODE_HOME"], !codeHome.isEmpty { + return "\(codeHome)/auth_accounts.json" + } + if let codexHome = environment["CODEX_HOME"], !codexHome.isEmpty { + return "\(codexHome)/auth.json" + } + return "\(home)/.code/auth_accounts.json" } private static func printHelp() { diff --git a/Sources/ContextPanelCore/AccountConfigurationStore.swift b/Sources/ContextPanelCore/AccountConfigurationStore.swift index 32142d5..730c35a 100644 --- a/Sources/ContextPanelCore/AccountConfigurationStore.swift +++ b/Sources/ContextPanelCore/AccountConfigurationStore.swift @@ -140,7 +140,7 @@ public struct AccountConfigurationStore: Sendable { id: "openai-code-default", provider: .openAI, connectorKind: .codexRateLimits, - displayName: "Code", + displayName: "Every Code", authPath: "\(home)/.code/auth_accounts.json" ), LocalProviderAccountConfiguration( @@ -379,7 +379,7 @@ public enum AccountConnectorFactory { let expanded = NSString(string: authPath).expandingTildeInPath let url = URL(fileURLWithPath: expanded) if url.deletingLastPathComponent().lastPathComponent == ".code" { - return "Code" + return "Every Code" } if url.deletingLastPathComponent().lastPathComponent == ".codex" { return "Codex" diff --git a/Sources/ContextPanelPreview/ContextPanelPreviewApp.swift b/Sources/ContextPanelPreview/ContextPanelPreviewApp.swift index 42d34e0..5bd09f8 100644 --- a/Sources/ContextPanelPreview/ContextPanelPreviewApp.swift +++ b/Sources/ContextPanelPreview/ContextPanelPreviewApp.swift @@ -814,7 +814,7 @@ final class SettingsPaneModel: ObservableObject { switch account.connectorKind { case .codexRateLimits: if account.displayName.localizedCaseInsensitiveContains("code") { - return "Select auth_accounts.json. All Code accounts are read from this file" + return "Select auth_accounts.json. Every Code accounts are read from this file" } if account.displayName.localizedCaseInsensitiveContains("codex") { return "Select auth.json for Codex users" diff --git a/Sources/SnapshotStoreProbe/main.swift b/Sources/SnapshotStoreProbe/main.swift index 53d9ce8..f525448 100644 --- a/Sources/SnapshotStoreProbe/main.swift +++ b/Sources/SnapshotStoreProbe/main.swift @@ -72,7 +72,7 @@ struct ProbeConfiguration { private static func printHelp() { print(""" - Usage: swift run SnapshotStoreProbe [--output /tmp/context-panel-store] [--configured-accounts] [--codex-account Label=~/.codex/auth.json] [--include-claude] + Usage: swift run SnapshotStoreProbe [--output /tmp/context-panel-store] [--configured-accounts] [--codex-account Label=~/.code/auth_accounts.json] [--include-claude] Refreshes selected local connectors, writes the normalized snapshot to the JSON snapshot store, then reloads it. The store contains normalized diff --git a/Tests/ContextPanelCoreTests/AccountConfigurationStoreTests.swift b/Tests/ContextPanelCoreTests/AccountConfigurationStoreTests.swift index f924e5b..2dfd8a8 100644 --- a/Tests/ContextPanelCoreTests/AccountConfigurationStoreTests.swift +++ b/Tests/ContextPanelCoreTests/AccountConfigurationStoreTests.swift @@ -10,7 +10,7 @@ import Testing #expect(result.status == .unknown) #expect(result.document.accounts.count == 4) - #expect(result.document.accounts.contains { $0.id == "openai-code-default" && $0.displayName == "Code" && $0.isEnabled }) + #expect(result.document.accounts.contains { $0.id == "openai-code-default" && $0.displayName == "Every Code" && $0.isEnabled }) #expect(result.document.accounts.contains { $0.id == "openai-codex-default" && $0.displayName == "Codex" && !$0.isEnabled }) #expect(result.document.accounts.contains { $0.connectorKind == .geminiCodeAssist && $0.isEnabled }) #expect(result.document.accounts.contains { $0.connectorKind == .claudeOAuthUsage && $0.effectiveAuthPath == nil })