hotfix(cliproxy): fallback from deleted CLIProxyAPIPlus to original backend

The upstream router-for-me/CLIProxyAPIPlus repo was deleted, breaking any
install/update path that resolved backend: plus. Existing users with
`backend: plus` saved in config.yaml hit 404s on every bootstrap.

Changes:
- Flip DEFAULT_BACKEND from 'plus' to 'original' (platform-detector.ts)
- Flip default cliproxy.backend in createEmptyUnifiedConfig() to 'original'
- Runtime 404 fallback: getConfiguredBackend() degrades 'plus' -> 'original'
  with a one-time warning, so existing installations keep working without a
  manual reconfig step
- Update CLIProxyBackend docblock to document the fallback behavior
- Update tests to match new default

Retains the 'plus' type and BACKEND_CONFIG entry for forward compatibility
once CCS self-maintains its own Plus fork.

Closes #1062
This commit is contained in:
Tam Nhu Tran committed 2026-04-22 08:04:12 -04:00
1 parent 513896b1af
commit 60cbdce83d
6 files changed
+57 -17

No files matched your search

+11 -8
View File
@@ -28,8 +28,8 @@ describe('Backend Selection', () => {
});
describe('DEFAULT_BACKEND', () => {
it('defaults to plus backend for backward compatibility', () => {
assert.strictEqual(platformDetector.DEFAULT_BACKEND, 'plus');
it('defaults to original backend (Plus upstream deleted, issue #1062)', () => {
assert.strictEqual(platformDetector.DEFAULT_BACKEND, 'original');
});
});
@@ -45,9 +45,10 @@ describe('Backend Selection', () => {
assert(info.binaryName.startsWith('CLIProxyAPIPlus_6.6.51-0_'));
});
it('uses plus backend by default', () => {
it('uses original backend by default (Plus upstream deleted, issue #1062)', () => {
const info = platformDetector.detectPlatform();
assert(info.binaryName.includes('CLIProxyAPIPlus'));
assert(info.binaryName.startsWith('CLIProxyAPI_'));
assert(!info.binaryName.includes('CLIProxyAPIPlus'));
});
it('uses fallback version when version not specified', () => {
@@ -76,9 +77,10 @@ describe('Backend Selection', () => {
assert.strictEqual(name, expected);
});
it('defaults to plus backend', () => {
it('defaults to original backend (Plus upstream deleted, issue #1062)', () => {
const name = platformDetector.getExecutableName();
assert(name.includes('cli-proxy-api-plus'));
const expected = isWindows ? 'cli-proxy-api.exe' : 'cli-proxy-api';
assert.strictEqual(name, expected);
});
});
@@ -94,9 +96,10 @@ describe('Backend Selection', () => {
assert(url.includes('router-for-me/CLIProxyAPIPlus/releases'));
});
it('defaults to plus backend', () => {
it('defaults to original backend (Plus upstream deleted, issue #1062)', () => {
const url = platformDetector.getDownloadUrl();
assert(url.includes('CLIProxyAPIPlus'));
assert(url.includes('router-for-me/CLIProxyAPI/releases'));
assert(!url.includes('CLIProxyAPIPlus'));
});
});
@@ -78,7 +78,7 @@ describe('installCliproxyVersion', () => {
skipAutoUpdate: true,
})
).rejects.toThrow(
'CLIProxy Plus binary is not installed locally. Run "ccs cliproxy install" when you have network access.'
'CLIProxy binary is not installed locally. Run "ccs cliproxy install" when you have network access.'
);
});
});