fix(cliproxy): use root URL for Claude provider (#1554)

Built-in Claude provider now uses the CLIProxy root URL instead of /api/provider/claude (which 404'd since base CLIProxy registers /v1/messages at root). Repairs stale local Claude settings, keeps non-Claude providers on their scoped routes, and applies the same root-URL rule to the ccs api create --cliproxy-provider claude bridge path via a shared buildCliproxyProviderPath helper. Closes #1545.
This commit is contained in:
Kai (Tam Nhu) Tran authored and GitHub committed 2026-06-16 10:23:48 -04:00
1 parent 81e9bdea5d
commit 49a7b9dc85
6 files changed
+293 -31

No files matched your search

@@ -654,6 +654,31 @@ describe('persist command Claude extension parity', () => {
expect(renderedLogs).not.toContain('Native Codex target:');
});
it('persists claude CLIProxy profile with root CLIProxy base URL', async () => {
await writeUnifiedConfig();
const settingsPath = path.join(tempRoot, '.claude', 'settings.json');
await fs.promises.mkdir(path.dirname(settingsPath), { recursive: true });
const originalConsoleLog = console.log;
console.log = () => {};
try {
await withScopedHome(() => handlePersistCommand(['claude', '--yes']));
} finally {
console.log = originalConsoleLog;
}
const persisted = JSON.parse(await fs.promises.readFile(settingsPath, 'utf8')) as {
env: Record<string, string | undefined>;
};
expect(persisted.env.ANTHROPIC_BASE_URL).toBe('http://127.0.0.1:8317');
expect(persisted.env.ANTHROPIC_BASE_URL).not.toContain('/api/provider/claude');
expect(persisted.env.ANTHROPIC_AUTH_TOKEN).toBeDefined();
expect(persisted.env.ANTHROPIC_MODEL).toBeUndefined();
});
it('blocks Codex CLIProxy profiles from Claude settings persistence', async () => {
await writeUnifiedConfig();