Skip to content

fix(update): allow self-update for non-Anthropic builds#1405

Closed
oyi77 wants to merge 2 commits into
Gitlawb:mainfrom
oyi77:fix/update-third-party-providers
Closed

fix(update): allow self-update for non-Anthropic builds#1405
oyi77 wants to merge 2 commits into
Gitlawb:mainfrom
oyi77:fix/update-third-party-providers

Conversation

@oyi77
Copy link
Copy Markdown

@oyi77 oyi77 commented May 27, 2026

Summary

Fixes #1404

openclaude update is blocked for all OpenClaude users because the update gate checks getAPIProvider() !== '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_URL check so only upstream Anthropic builds are blocked. OpenClaude builds (where PACKAGE_URL is @gitlawb/openclaude) can now self-update from npm.

Changes

src/cli/update.ts:32-42 — Changed the update gate from:

if (getAPIProvider() !== 'firstParty') {

to:

if (
  getAPIProvider() !== 'firstParty' &&
  MACRO.PACKAGE_URL === '@anthropic-ai/claude-code'
) {

src/utils/autoUpdater.ts:88-98 — Same change in assertMinVersion() to allow version checks for non-Anthropic builds.

Why This Works

  • MACRO.PACKAGE_URL is set to @gitlawb/openclaude at build time (scripts/build.ts:135)
  • getLatestVersion() already uses MACRO.PACKAGE_URL to check npm
  • installGlobalPackage() already uses MACRO.PACKAGE_URL to install
  • The only problem was the gate preventing these functions from ever being called

Testing

  1. Build: bun run build
  2. Run: node bin/openclaude update
  3. Verify it checks npm for @gitlawb/openclaude (not @anthropic-ai/claude-code)
  4. Verify upstream builds still block correctly when provider is not firstParty

oyi77 added 2 commits May 27, 2026 20:57
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.
@oyi77
Copy link
Copy Markdown
Author

oyi77 commented May 27, 2026

Superseded by #1406 which includes all fixes from this PR plus additional 3P provider compatibility fixes.

@oyi77 oyi77 closed this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(update): openclaude update blocked for all third-party provider builds

1 participant