fix(update): allow self-update for non-Anthropic builds#1405
Closed
oyi77 wants to merge 2 commits into
Closed
Conversation
The update command blocked ALL third-party provider users via getAPIProvider() !== 'firstParty'. This prevented OpenClaude users from running `openclaude update` even though PACKAGE_URL correctly points to @gitlawb/openclaude. Add PACKAGE_URL check so only upstream Anthropic builds are blocked. OpenClaude builds (with custom PACKAGE_URL) can now self-update. Fixes Gitlawb#1404
…t model in refusal message Two fixes for third-party provider compatibility: 1. metricsOptOut.ts: Add firstParty gate to _fetchMetricsEnabled() so 3P providers don't hit Anthropic's metrics endpoint and get auth errors. 2. errors.ts: Replace hardcoded 'claude-sonnet-4-20250514' in refusal message with getDefaultMainLoopModel() so the model suggestion is always current and provider-appropriate.
Author
|
Superseded by #1406 which includes all fixes from this PR plus additional 3P provider compatibility fixes. |
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.
Summary
Fixes #1404
openclaude updateis blocked for all OpenClaude users because the update gate checksgetAPIProvider() !== 'firstParty'. Since OpenClaude uses third-party providers, every user hits this gate and the command exits without checking for updates.The fix adds a
MACRO.PACKAGE_URLcheck so only upstream Anthropic builds are blocked. OpenClaude builds (wherePACKAGE_URLis@gitlawb/openclaude) can now self-update from npm.Changes
src/cli/update.ts:32-42— Changed the update gate from:to:
src/utils/autoUpdater.ts:88-98— Same change inassertMinVersion()to allow version checks for non-Anthropic builds.Why This Works
MACRO.PACKAGE_URLis set to@gitlawb/openclaudeat build time (scripts/build.ts:135)getLatestVersion()already usesMACRO.PACKAGE_URLto check npminstallGlobalPackage()already usesMACRO.PACKAGE_URLto installTesting
bun run buildnode bin/openclaude update@gitlawb/openclaude(not@anthropic-ai/claude-code)