Skip to content
Merged
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
1 change: 1 addition & 0 deletions Sources/PokeTokenBar/Core/CodexRateLimitsProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct CodexRateLimitsProvider: CodexLimitsProviding {
// ChatGPT.app bundles the codex CLI; users on the desktop app often have
// no standalone install, so this is the only resolvable path for them.
// Listed last so dedicated installs win over the bundled copy.
"/Applications/ChatGPT.app/Contents/Resources/codex-cli/CodexCLI.app/Contents/MacOS/codex",
"/Applications/ChatGPT.app/Contents/Resources/codex",
]
}
Expand Down
31 changes: 31 additions & 0 deletions Tests/PokeTokenBarTests/CodexRateLimitsProviderTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import XCTest
@testable import PokeTokenBar

final class CodexRateLimitsProviderTests: XCTestCase {
private let nestedChatGPTBinary =
"/Applications/ChatGPT.app/Contents/Resources/codex-cli/CodexCLI.app/Contents/MacOS/codex"
private let legacyChatGPTBinary = "/Applications/ChatGPT.app/Contents/Resources/codex"

func testDefaultCandidatesSupportCurrentAndLegacyChatGPTBundles() {
// Use the production defaults: injected fake CLI paths missed this packaging change.
let candidates = CodexRateLimitsProvider().binaryCandidates
XCTAssertTrue(candidates.contains(nestedChatGPTBinary))
XCTAssertTrue(candidates.contains(legacyChatGPTBinary))
}

func testDedicatedInstallsPrecedeBothChatGPTBundleLayouts() throws {
let candidates = CodexRateLimitsProvider().binaryCandidates
for bundledBinary in [nestedChatGPTBinary, legacyChatGPTBinary] {
let bundledIndex = try XCTUnwrap(candidates.firstIndex(of: bundledBinary))
for dedicatedBinary in [
"/Applications/Codex.app/Contents/Resources/codex",
"\(FileManager.default.homeDirectoryForCurrentUser.path)/.codex/bin/codex",
"/opt/homebrew/bin/codex",
"/usr/local/bin/codex",
] {
let dedicatedIndex = try XCTUnwrap(candidates.firstIndex(of: dedicatedBinary))
XCTAssertLessThan(dedicatedIndex, bundledIndex)
}
}
}
}
8 changes: 8 additions & 0 deletions docs/reference/defect-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ read_when:
sprite's independent SwiftUI `.task(id:)` had not finished rendering. Keep transition-index
diagnostics and prove a permanently stale sprite still fails after the readiness deadline.

- **Bundled CLI discovery must cover the shipped app layout.** ChatGPT moved Codex from
`Contents/Resources/codex` into `Contents/Resources/codex-cli/CodexCLI.app/Contents/MacOS/codex`.
After an update removed the cached executable, GUI discovery returned nil and hid the limits.
Fake-response tests bypassed the production candidate list. `CodexRateLimitsProviderTests`
now checks both bundle layouts in the default candidates and preserves dedicated-install
precedence; removing the new candidate must fail the regression. The source sweep found
this provider is the only owner of ChatGPT CLI bundle paths.

- **Localized metadata names must not replace persistent API identifiers.** The dex rendered
ability, move, and type slugs directly, while existing tests covered species names and profile
metadata rather than these visible labels. All five detail-view name sites now use a shared
Expand Down
Loading