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.
JavaScript agent-collaborationagent-harnessagent-orchestrationagent-teamagent-workflowai-assistantai-automationai-employeeai-productivityai-teamai-workflowautonomous-agentsclaude-code-guiclaude-coworkdesktop-agentlocal-firstmulti-agentmulti-agent-systemself-evolving-agentstask-automation
Fix configuration ordering and settings controls
wyt9a737f7ecfac
diff --git a/src/main/features/auth.ts b/src/main/features/auth.tsindex d716c147..114572f1 100644--- a/src/main/features/auth.ts+++ b/src/main/features/auth.ts@@ -902,7 +902,7 @@ export async function addEntry({const entryId = nextEntryId();const now = Date.now();- store.entries.push({+ store.entries.unshift({entryId,provider: p,model: m,diff --git a/src/main/features/image_auth.ts b/src/main/features/image_auth.tsindex f2fbd432..0e4c0b3f 100644--- a/src/main/features/image_auth.ts+++ b/src/main/features/image_auth.ts@@ -62,7 +62,7 @@ export function addImageProfile(input: AddImageProfileInput): { ok: true; id: stlabel: sanitizeLabel(input.label || 'default'),createdAt: Date.now(),};- list.push(profile);+ list.unshift(profile);saveImageProfiles(list);log.info('image profile added', { id: profile.id, provider });return { ok: true, id: profile.id };diff --git a/src/main/features/search_auth.ts b/src/main/features/search_auth.tsindex b751cf1c..2f25a426 100644--- a/src/main/features/search_auth.ts+++ b/src/main/features/search_auth.ts@@ -81,7 +81,7 @@ export function addSearchProfile(input: AddSearchProfileInput): { ok: true; id:createdAt: Date.now(),extras: input.extras && Object.keys(input.extras).length ? { ...input.extras } : undefined,};- list.push(profile);+ list.unshift(profile);saveSearchProfiles(list);log.info('search profile added', { id: profile.id, provider });return { ok: true, id: profile.id };diff --git a/src/main/features/video_auth.ts b/src/main/features/video_auth.tsindex 855ce8d0..c095a160 100644--- a/src/main/features/video_auth.ts+++ b/src/main/features/video_auth.ts@@ -64,7 +64,7 @@ export function addVideoProfile(input: AddVideoProfileInput): { ok: true; id: stlabel: sanitizeLabel(input.label || 'default'),createdAt: Date.now(),};- list.push(profile);+ list.unshift(profile);saveVideoProfiles(list);log.info('video profile added', { id: profile.id, provider, model });return { ok: true, id: profile.id };@@ -95,7 +95,7 @@ export function listVideoProviderOptions(): Array<{ id: string; label: string; dreturn [{id: 'doubao',- label: 'DouBao',+ label: 'DouBao · Seedance',docs: 'https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey',},];diff --git a/src/main/locales/en.json b/src/main/locales/en.jsonindex b16a207e..e967e5e0 100644--- a/src/main/locales/en.json+++ b/src/main/locales/en.json@@ -78,7 +78,7 @@"errors.contexts.formats_only": "Only the following formats are supported: {allowed}","errors.unknown_actor": "unknown actor: \"{name}\" — the name must match an entry in the \"Agents list\" by its `name` field; also check whether the agent is disabled.","errors.no_model_configured": "No model configured. Add an API key on the Settings page or sign in.",- "errors.model_temporarily_unavailable": "The configured model is temporarily unavailable. Try again later, or check credentials / switch models in Settings.",+ "errors.model_temporarily_unavailable": "The configured model is temporarily unavailable for about {seconds}s. Try again later, or check credentials / switch models in Settings.","errors.model_config_unavailable": "A model is configured, but its credential is not currently usable. Check the API key, sign-in state, or fallback model in Settings.","errors.model_credits_insufficient": "Not enough credits. Add credits, or switch to an available model in Settings.","errors.model_auth_unavailable": "The model credential is not usable. Check the API key, sign-in state, or switch models in Settings.",diff --git a/src/main/locales/ja.json b/src/main/locales/ja.jsonindex 93f4db70..ceddc4ad 100644--- a/src/main/locales/ja.json+++ b/src/main/locales/ja.json@@ -78,7 +78,7 @@"errors.contexts.formats_only": "対応形式は次のみです: {allowed}","errors.unknown_actor": "不明な actor: 「{name}」。名前は「エージェント一覧」の `name` フィールドと一致する必要があります。エージェントが無効になっていないかも確認してください。","errors.no_model_configured": "モデルが設定されていません。設定ページで API キーを追加するかサインインしてください。",- "errors.model_temporarily_unavailable": "設定済みモデルは一時的に利用できません。後でもう一度試すか、設定で認証情報や利用可能なモデルを確認してください。",+ "errors.model_temporarily_unavailable": "設定済みモデルは約 {seconds} 秒間利用できません。後でもう一度試すか、設定で認証情報や利用可能なモデルを確認してください。","errors.model_config_unavailable": "モデルは設定されていますが、現在その認証情報を使用できません。設定で API キー、サインイン状態、または代替モデルを確認してください。","errors.model_credits_insufficient": "クレジットが不足しています。クレジットを追加するか、設定で利用可能なモデルへ切り替えてください。","errors.model_auth_unavailable": "モデルの認証情報を使用できません。設定で API キー、サインイン状態、または利用可能なモデルを確認してください。",diff --git a/src/main/locales/zh.json b/src/main/locales/zh.jsonindex 3c822c91..21401f30 100644--- a/src/main/locales/zh.json+++ b/src/main/locales/zh.json@@ -78,7 +78,7 @@"errors.contexts.formats_only": "仅支持以下格式({allowed})","errors.unknown_actor": "unknown actor: \"{name}\" — 名字要跟「智能体列表」里的 name 一致;或检查 agent 是否禁用","errors.no_model_configured": "未配置模型,请到「设置」页添加 API 密钥或登录账号",- "errors.model_temporarily_unavailable": "已配置模型暂时不可用,请稍后再试,或在「设置」中检查凭证/切换可用模型。",+ "errors.model_temporarily_unavailable": "已配置模型暂时不可用,约 {seconds} 秒后重试,或在「设置」中检查凭证/切换可用模型。","errors.model_config_unavailable": "已配置模型,但当前凭证不可用。请到「设置」页检查 API 密钥、登录状态或切换备用模型。","errors.model_credits_insufficient": "积分不足,请补充积分,或在「设置」中切换可用模型。","errors.model_auth_unavailable": "模型凭证不可用,请到「设置」页检查 API 密钥、登录状态或切换可用模型。",diff --git a/src/renderer/modules/settings.js b/src/renderer/modules/settings.jsindex 91284e61..172f0b49 100644--- a/src/renderer/modules/settings.js+++ b/src/renderer/modules/settings.js@@ -1327,7 +1327,7 @@ function _settingsRenderImageEntries() {// user-owned provider keys only; managed Orkas video providers stay stripped.const _VIDEO_AUTH_PROVIDER_OPTIONS = [- { id: 'doubao', label: 'DouBao', docs: 'https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey' },+ { id: 'doubao', label: 'DouBao · Seedance', docs: 'https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey' },];const _VIDEO_AUTH_MODELS_BY_PROVIDER = {diff --git a/src/renderer/style.css b/src/renderer/style.cssindex 153c2891..22444882 100644--- a/src/renderer/style.css+++ b/src/renderer/style.css@@ -9493,6 +9493,9 @@ body.model-not-configured .main-content { flex-direction: column; }align-items: stretch;gap: 10px;}+.settings-row.settings-mode-list > .settings-mode-opt {+ flex: 0 0 auto;+}.settings-mode-opt {display: flex;align-items: flex-start;@@ -9501,7 +9504,7 @@ body.model-not-configured .main-content { flex-direction: column; }}.settings-mode-opt input[type="radio"] { margin: 3px 0 0 0; flex: 0 0 auto; }.settings-mode-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }-.settings-mode-label { font-size: 13px; color: var(--text-1); }+.settings-mode-label { font-size: 13px; color: var(--text); }.settings-mode-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; }/* Inline toggle label — for checkbox + long descriptive text inside adiff --git a/test/main/features/auth.test.ts b/test/main/features/auth.test.tsindex fe290762..9ea39664 100644--- a/test/main/features/auth.test.ts+++ b/test/main/features/auth.test.ts@@ -349,7 +349,7 @@ describe('auth › entries (priority list)', () => {expect(entries).toEqual([]);});- it('addEntry appends and preserves order', async () => {+ it('addEntry prepends so newly added model configs become the default', async () => {const a = await import('../../../src/main/features/auth');const p1 = await a.addApiKey('anthropic', 'key-xxxxxxxxxxxx', 'one');const p2 = await a.addApiKey('openai', 'sk-xxxxxxxxxxxx', 'one');@@ -360,8 +360,8 @@ describe('auth › entries (priority list)', () => {const { entries } = await a.listEntries();expect(entries.map((e) => `${e.provider}:${e.model}`)).toEqual([- 'anthropic:claude-opus-4-7','openai:gpt-5',+ 'anthropic:claude-opus-4-7',]);});diff --git a/test/main/features/byo_auth_order.test.ts b/test/main/features/byo_auth_order.test.tsnew file mode 100644index 00000000..770dd48e--- /dev/null+++ b/test/main/features/byo_auth_order.test.ts@@ -0,0 +1,42 @@+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import * as fs from 'node:fs';+import * as os from 'node:os';+import * as path from 'node:path';++let tmpDir: string;+let prevWs: string | undefined;+const TEST_UID = '99999999';++beforeEach(async () => {+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'byo-auth-order-'));+ prevWs = process.env.ORKAS_WORKSPACE_ROOT;+ process.env.ORKAS_WORKSPACE_ROOT = tmpDir;+ vi.resetModules();+ const users = await import('../../../src/main/features/users');+ users.activateUser(TEST_UID);+});++afterEach(() => {+ process.env.ORKAS_WORKSPACE_ROOT = prevWs;+ fs.rmSync(tmpDir, { recursive: true, force: true });+});++describe('BYO API key auth ordering', () => {+ it('places the newest search profile first', async () => {+ const searchAuth = await import('../../../src/main/features/search_auth');++ expect(searchAuth.addSearchProfile({ provider: 'tavily', apiKey: 'tvly-one', label: 'one' }).ok).toBe(true);+ expect(searchAuth.addSearchProfile({ provider: 'serper', apiKey: 'serper-two', label: 'two' }).ok).toBe(true);++ expect(searchAuth.listSearchProfiles().map((p) => p.label)).toEqual(['two', 'one']);+ });++ it('places the newest image profile first', async () => {+ const imageAuth = await import('../../../src/main/features/image_auth');++ expect(imageAuth.addImageProfile({ provider: 'openai', apiKey: 'sk-image-one', label: 'one' }).ok).toBe(true);+ expect(imageAuth.addImageProfile({ provider: 'google', apiKey: 'google-image-two', label: 'two' }).ok).toBe(true);++ expect(imageAuth.listImageProfiles().map((p) => p.label)).toEqual(['two', 'one']);+ });+});diff --git a/test/main/features/video_auth.test.ts b/test/main/features/video_auth.test.tsindex 1168d615..69999acf 100644--- a/test/main/features/video_auth.test.ts+++ b/test/main/features/video_auth.test.ts@@ -50,7 +50,7 @@ describe('video_auth', () => {expect(second.ok).toBe(true);const firstId = first.ok ? first.id : '';const secondId = second.ok ? second.id : '';- expect(videoAuth.listVideoProfiles().map((p) => p.label)).toEqual(['one', 'two']);+ expect(videoAuth.listVideoProfiles().map((p) => p.label)).toEqual(['two', 'one']);expect(videoAuth.reorderVideoProfiles([secondId, firstId])).toEqual({ ok: true });expect(videoAuth.listVideoProfiles().map((p) => p.id)).toEqual([secondId, firstId]);@@ -73,4 +73,12 @@ describe('video_auth', () => {apiKey: 'video-secret',}).ok).toBe(false);});++ it('labels the BYO DouBao video provider with the Seedance product name', async () => {+ const videoAuth = await import('../../../src/main/features/video_auth');++ expect(videoAuth.listVideoProviderOptions()).toEqual([+ expect.objectContaining({ id: 'doubao', label: 'DouBao · Seedance' }),+ ]);+ });});diff --git a/test/renderer/settings-open.test.ts b/test/renderer/settings-open.test.tsindex 904e4e45..8ed0518b 100644--- a/test/renderer/settings-open.test.ts+++ b/test/renderer/settings-open.test.ts@@ -10,6 +10,7 @@ function read(rel: string) {const indexHtml = read('src/renderer/index.html');const settingsJs = read('src/renderer/modules/settings.js');+const styleCss = read('src/renderer/style.css');const bootJs = read('src/renderer/modules/boot.js');function previousSettingsGroupTag(controlId: string) {@@ -81,6 +82,13 @@ describe('open-source Settings sync guards', () => {expect(settingsJs).toContain('_settingsState.pickerModelEl !== modelEl');});+ it('keeps the local execution permission mode UI spacing fix', () => {+ expect(indexHtml).toContain('id="settings-localexec-modes"');+ expect(styleCss).toContain('.settings-row.settings-mode-list > .settings-mode-opt');+ expect(styleCss).toContain('flex: 0 0 auto;');+ expect(styleCss).toContain('.settings-mode-label { font-size: 13px; color: var(--text); }');+ });+it('isolates settings refresh/render failures while loading BYO provider sections', () => {expect(settingsJs).toContain('async function _settingsSafeCall');