Skip to content

fix(update): allow auto-update for OpenClaude builds on third-party providers#1434

Open
0xfandom wants to merge 1 commit into
Gitlawb:mainfrom
0xfandom:fix/1404-update-allow-openclaude-builds
Open

fix(update): allow auto-update for OpenClaude builds on third-party providers#1434
0xfandom wants to merge 1 commit into
Gitlawb:mainfrom
0xfandom:fix/1404-update-allow-openclaude-builds

Conversation

@0xfandom
Copy link
Copy Markdown
Contributor

Summary

openclaude update exits immediately for every user running a third-party provider, never checking for or installing an update. Fixes #1404.

Root cause

src/cli/update.ts gated on the active runtime provider:

if (getAPIProvider() !== 'firstParty') {
  // "Auto-update is not available for third-party provider builds." → exit
}

The guard was inherited from upstream Claude Code, where auto-update reinstalls the Anthropic package — so a third-party user updating would overwrite their shim build with the upstream binary. But OpenClaude builds set PACKAGE_URL to @gitlawb/openclaude (scripts/build.ts), so update reinstalls the same OpenClaude package. Gating on the active provider therefore blocked all OpenClaude users for no reason.

Fix

Gate on package identity, not the active provider: block only when an Anthropic-packaged build is paired with a third-party provider. OpenClaude-packaged builds always update; the original safety case (Anthropic package + third-party provider) is preserved.

Decision extracted into a pure, exported isAutoUpdateBlockedForThirdParty(packageUrl, apiProvider):

package provider blocked
@gitlawb/openclaude any (incl. third-party) ❌ no
@anthropic-ai/claude-code third-party ✅ yes
@anthropic-ai/claude-code firstParty ❌ no
missing third-party ✅ yes (conservative)

Tests

src/cli/update.test.ts covers all four rows. All pass; full suite green.

…roviders

`openclaude update` gated on `getAPIProvider() !== 'firstParty'` and
exited immediately for every user running a third-party provider. The
guard exists to stop an Anthropic-packaged build from reinstalling the
upstream Claude Code binary over a shim build — but OpenClaude builds set
PACKAGE_URL to @gitlawb/openclaude (scripts/build.ts), so update
reinstalls the same OpenClaude package and is always safe.

Gate on the package identity instead: block only when an Anthropic
package is paired with a third-party provider. Extracted the decision
into isAutoUpdateBlockedForThirdParty() with unit tests.

Fixes Gitlawb#1404
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