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.

Trim agent connector ids

IgnoreMeBut5468d7232a6e
diff --git a/src/main/features/agents.ts b/src/main/features/agents.ts
index f7d1a150..68822fbd 100644
--- a/src/main/features/agents.ts
+++ b/src/main/features/agents.ts
@@ -883,7 +883,10 @@ export function normalizeAgent(raw: AgentRaw | null | undefined, source: AgentSo
// share the commander's connector visibility; filtering keeps malformed JSON
// from injecting weird ids into the detail UI.
if (Array.isArray(raw.enabled_connectors)) {
- const filtered = raw.enabled_connectors.filter((v): v is string => typeof v === 'string' && v.length > 0);
+ const filtered = raw.enabled_connectors
+ .filter((v): v is string => typeof v === 'string')
+ .map((v) => v.trim())
+ .filter((v) => v.length > 0 && safeId(v));
if (filtered.length) agent.enabled_connectors = filtered;
}
// interactive — tolerant boolean coerce (LLMs sometimes emit "true"/"false"
diff --git a/test/main/features/agents.test.ts b/test/main/features/agents.test.ts
index 6f779ace..69657cd7 100644
--- a/test/main/features/agents.test.ts
+++ b/test/main/features/agents.test.ts
@@ -189,6 +189,15 @@ describe('agents › normalizeAgent', () => {
expect(norm?.skill_list).toEqual(['ok-one', 'also_ok']);
});
+ it('trims and validates enabled connector ids', async () => {
+ const a = await loadAgents();
+ const norm = a.normalizeAgent({
+ agent_id: 'x', name: 'N',
+ enabled_connectors: [' github ', '', '../evil', 42, 'notion'],
+ } as any, 'custom');
+ expect(norm?.enabled_connectors).toEqual(['github', 'notion']);
+ });
+
it('normalizes rich profile fields and design aliases', async () => {
const a = await loadAgents();
const norm = a.normalizeAgent({