Repository navigation
Remove dead production code and parameters nobody varies - #156
Merged
Merged
Conversation
First batch from the production cleanup audit. No behavior changes.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
First batch from a production cleanup audit (the code-side follow-up to the test-value audit): deletes declarations nothing calls and parameters every caller passes the same way. No behavior changes.
What was happening
CursorUsageError.usageAfterRefreshFailedandCodexAuthError.invalidAuthPayloadwere thrown by nothing,ProviderAuthRetry.fetchkept aretriedConnectionFailedparameter no caller passed, and bothCursorProviderandCodexProvidercopied the access token into acurrentTokenalias "in case it rotated", which a single request with no refresh cannot do.SQLiteCLIAccessor.run(readOnly:)(all three callers passtrue),resolveDeviceID(allowLegacyInteraction:)(never passed),fetchViewerEnterprises(after:)(alwaysnil),KimiAuthStore.credentialPathdefaults (the one caller passes both), andModelPricingStore.loadCatalog(parse:)(always the same codec).ModelPricingStore.defaultSourceURLswas a dictionary over a three-case enum behind aguard ... else { return false }that could not fail and logged nothing.OpenCodeUsageScanwrapped a singleLogUsageScanfield since Switch OpenCode Go Meters to the Official Usage API #106 removed its second one.CodexMemoryRowcarried four metadata fields that were selected and decoded but never read, and the list query fetchedlast_usagefor nothing.CodexUsagePricing.priorityMultiplier(for:rates:),MuseUsageClient.usageURL,HeaderView.toggle's toggle-back branch (the header only mounts on the dashboard), the unreachable"Refresh failed"fallback inWidgetDataStore, a redundant nil check inDevinProvider, an unusedimport Security.UsageHistoryAggregator.merged(peerDocuments:)andProviderMetrics.init(provider:metrics:)had no production caller.What this changes
SourceIDgains aurlproperty (a switch), replacing the dictionary and its guard.OpenCodeUsageScanner.scanreturnsLogUsageScan?directly.CodexMemoryDatabase.loadRowselects only the three columns it returns; the list query dropslast_usage.pageInfoselection it never read.merged(peerDocuments:)moves toTestOnlyConveniences.swift;ProviderAccountAssembly.assemblebecomes private.Heads-up
CodexTokens.refreshToken(never read, but dropping it changes synthesized equality on a credential type),PricingCatalog.retrievedAt(round-trips into the cache file), andProviderAccountRecord.removedTombstoneand the extraPiProviderMappingentries (both documented as planned work).Tests
swift test: 1,967 tests, 0 failures locally on macOS 27.