fix(update): allow auto-update for OpenClaude builds on third-party providers#1434
Open
0xfandom wants to merge 1 commit into
Open
fix(update): allow auto-update for OpenClaude builds on third-party providers#14340xfandom wants to merge 1 commit into
0xfandom wants to merge 1 commit into
Conversation
…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
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
openclaude updateexits immediately for every user running a third-party provider, never checking for or installing an update. Fixes #1404.Root cause
src/cli/update.tsgated on the active runtime provider: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_URLto@gitlawb/openclaude(scripts/build.ts), soupdatereinstalls 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):@gitlawb/openclaude@anthropic-ai/claude-code@anthropic-ai/claude-codeTests
src/cli/update.test.tscovers all four rows. All pass; full suite green.