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.

Stabilize release gate after orphan recovery

wyt864a33fefe7f
diff --git a/test/main/features/group_chat/plan-control.test.ts b/test/main/features/group_chat/plan-control.test.ts
index 3166074b..06cb8d47 100644
--- a/test/main/features/group_chat/plan-control.test.ts
+++ b/test/main/features/group_chat/plan-control.test.ts
@@ -19,6 +19,8 @@ beforeEach(async () => {
});
afterEach(() => {
+ vi.doUnmock('../../../../src/main/features/group_chat/bus');
+ vi.restoreAllMocks();
process.env.ORKAS_WORKSPACE_ROOT = prevWs;
fs.rmSync(tmpDir, { recursive: true, force: true });
});
@@ -49,18 +51,43 @@ async function readPlanPayload(cid: string) {
}
describe('group_chat plan control state', () => {
- it('shows stop while the runtime is running, including in_flight-only snapshots', async () => {
+ it('shows continue for stale persisted running/in_flight snapshots when no worker is active', async () => {
const state = await import('../../../../src/main/features/group_chat/state');
const runningCid = newCid();
await seedPlan(runningCid);
await state.setStatus(TEST_UID, runningCid, 'running');
- expect(await controlAction(runningCid)).toBe('stop');
+ expect(await controlAction(runningCid)).toBe('continue');
+ expect((await state.readState(TEST_UID, runningCid)).status).toBe('idle');
const inFlightCid = newCid();
await seedPlan(inFlightCid);
await state.markInFlight(TEST_UID, inFlightCid, 'commander', true);
- expect(await controlAction(inFlightCid)).toBe('stop');
+ expect(await controlAction(inFlightCid)).toBe('continue');
+ expect((await state.readState(TEST_UID, inFlightCid)).in_flight).toEqual([]);
+ });
+
+ it('shows stop while the in-memory runtime is active', async () => {
+ const activeCid = newCid();
+ await seedPlan(activeCid);
+
+ vi.doMock('../../../../src/main/features/group_chat/bus', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('../../../../src/main/features/group_chat/bus')>();
+ return {
+ ...actual,
+ runtimeSnapshot: (uid: string, cid: string) => (
+ uid === TEST_UID && cid === activeCid
+ ? {
+ processing: true,
+ inFlight: ['commander'],
+ activeTurns: [{ actor: 'commander', turn_id: 'turn-active' }],
+ }
+ : actual.runtimeSnapshot(uid, cid)
+ ),
+ };
+ });
+
+ expect(await controlAction(activeCid)).toBe('stop');
});
it('shows continue for recoverable plan states when no worker is active', async () => {
diff --git a/vitest.config.ts b/vitest.config.ts
index 4a3518c4..a88d11c1 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -1,4 +1,7 @@
import { defineConfig } from 'vitest/config';
+import { cpus } from 'node:os';
+
+const testWorkers = Math.max(1, Math.min(4, cpus().length || 1));
export default defineConfig({
test: {
@@ -16,5 +19,12 @@ export default defineConfig({
setupFiles: ['./test/setup-env.ts'],
// Default reporter is a per-file dot list — keep CI output compact.
reporters: ['default'],
+ // The desktop suite exercises native modules, file IO, child processes,
+ // and sqlite-backed features. Leaving Vitest at the host default can
+ // oversubscribe local dev machines and make otherwise healthy tests trip
+ // the 5s default timeout in full-suite runs.
+ maxWorkers: testWorkers,
+ testTimeout: 30_000,
+ hookTimeout: 30_000,
},
});