Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

fix(connectors): restore production routing for source builds

wyte67dfbf0bc3b
diff --git a/src/main/features/connectors/_server_bridge.ts b/src/main/features/connectors/_server_bridge.ts
index 3485a790..1f78b393 100644
--- a/src/main/features/connectors/_server_bridge.ts
+++ b/src/main/features/connectors/_server_bridge.ts
@@ -13,22 +13,19 @@
* separately stored Orkas API Key in their own connector modules.
*
* Where each piece comes from:
- * - `accountApiBase` uses the local dev Server for source runs and the global production
- * Server for packaged builds. Marketplace routing is independent.
+ * - `accountApiBase` uses the global production Server for source and packaged builds.
* - `getDeviceId()` persists a UUID at `<uid>/local/config/device.json` on first call. Stable
* across runs on the same machine; resets if the user wipes the local config dir.
*/
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as crypto from 'node:crypto';
-import { app } from 'electron';
import { userLocalConfigDir } from '../../paths';
import { getActiveUserId } from '../users';
import { apiBase } from '../marketplace';
export function accountApiBase(): string {
- if (app?.isPackaged === false) return 'http://localhost:8888/api';
return apiBase();
}
diff --git a/src/main/features/connectors/oauth-dcr.ts b/src/main/features/connectors/oauth-dcr.ts
index b6a6d44b..9b815c13 100644
--- a/src/main/features/connectors/oauth-dcr.ts
+++ b/src/main/features/connectors/oauth-dcr.ts
@@ -281,7 +281,7 @@ export async function startMcpDcrOAuth(
});
// Register with the same Server environment that will exchange the callback.
- // Source runs use the local dev bridge; packaged builds use the production bridge.
+ // Source and packaged builds both use the production bridge.
const redirectUri = `${accountApiBase().replace(/\/+$/, '')}/connectors/oauth/dcr-callback`;
const registered = await _registerClient(meta.registration_endpoint, redirectUri, tokenEndpointAuthMethod);
log.info('DCR registration done', { client_id_tail: registered.client_id.slice(-6) });
diff --git a/test/main/features/connectors/open-source-boundary.test.ts b/test/main/features/connectors/open-source-boundary.test.ts
index 0946b3d9..27cb2e51 100644
--- a/test/main/features/connectors/open-source-boundary.test.ts
+++ b/test/main/features/connectors/open-source-boundary.test.ts
@@ -37,9 +37,9 @@ describe('public connector boundary', () => {
});
it.each([
- [false, 'http://localhost:8888/api'],
+ [false, 'https://orkas.ai/api'],
[true, 'https://orkas.ai/api'],
- ])('routes connectors for isPackaged=%s without changing marketplace routing', async (isPackaged, expected) => {
+ ])('routes connectors to production for isPackaged=%s', async (isPackaged, expected) => {
vi.resetModules();
vi.doMock('electron', () => ({ app: { isPackaged } }));
const marketplaceBase = vi.fn(() => 'https://orkas.ai/api');
@@ -48,7 +48,7 @@ describe('public connector boundary', () => {
const { accountApiBase, tokenStore } = await import('../../../../src/main/features/connectors/_server_bridge');
expect(accountApiBase()).toBe(expected);
expect(tokenStore.authHeaders()).toEqual({});
- expect(marketplaceBase).toHaveBeenCalledTimes(isPackaged ? 1 : 0);
+ expect(marketplaceBase).toHaveBeenCalledOnce();
} finally {
vi.doUnmock('electron');
vi.doUnmock('../../../../src/main/features/marketplace');