Repository navigation
[fix] AutoPing stale refreshAndUpdateCredentials import - #28
Merged
Merged
Conversation
The function was relocated from the usage route module to src/lib/usage/providerQuota.js in #20, but claudeAutoPing.js still imported it from @/app/api/usage/[connectionId]/route.js, which now only exports GET. The named import resolved to undefined, so every AutoPing tick threw "(0 , k.refreshAndUpdateCredentials) is not a function" and skipped the connection. Point the import at the new canonical module, matching the sibling caller in codex-reset-credits/route.js. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
datj9-reader
self-requested a review
June 30, 2026 03:08
datj9-reader
approved these changes
Jun 30, 2026
datj9
added a commit
that referenced
this pull request
Jul 1, 2026
claudeAutoPing.js was a modify/delete conflict: deleted on this branch (superseded by quotaAutoPing.js from the upstream merge) and modified on master by PR #28 (stale refreshAndUpdateCredentials import fix). Accept the deletion, and carry PR #28's intent forward by pointing quotaAutoPing.js's import at @/lib/usage/providerQuota instead of the stale [connectionId]/route.js path (which no longer exports the symbol). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Symptom
Every AutoPing tick logged and skipped the connection:
Root cause
refreshAndUpdateCredentialswas relocated from the usage route intosrc/lib/usage/providerQuota.jsin #20, butsrc/shared/services/claudeAutoPing.jsstill imported it from@/app/api/usage/[connectionId]/route.js— which now only exportsGET. The named import resolved toundefined, so calling it threw on every tick. The bundler resolves a missing named export toundefinedat runtime rather than failing the build, so nothing caught it until AutoPing ran.The sibling caller
codex-reset-credits/route.jswas already updated in the same refactor; AutoPing was missed.Fix
Point the import at the new canonical module:
Signature
(connection, force, proxyOptions)and return shape{ connection, refreshed }both match the existing call site — no other change needed.Tests
No clean regression seam: the failure is module-resolution wiring, not logic, and AutoPing import wiring has no test harness — a unit test would give false confidence. Verified statically (export present in
providerQuota.js, absent inroute.js) and by parity with the working sibling caller. Lint clean.🤖 Generated with Claude Code