mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-13 20:09:55 +00:00
Use one native app-server for terminal, Web and phone clients while retaining the existing CLI and Runner lifecycle. Synchronize native queues, permissions, question history and steering state; preserve explicit permission precedence and per-turn usage models. Resume inactive clear commands through Runner and reject independent child cold resumes. Add shared-runtime regression tests, generated protocol fixtures and lifecycle documentation.
14 lines
724 B
TypeScript
14 lines
724 B
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
const run = vi.hoisted(() => vi.fn(async (_options: unknown) => {}));
|
|
vi.mock('./shared/frontend', () => ({ runSharedCodex: run }));
|
|
import { runCodex } from './runCodex';
|
|
|
|
describe('Codex entrypoint', () => {
|
|
it('uses the shared runtime for terminal, runner and resume (no exclusive-mode branch)', async () => {
|
|
const launches = [{ startedBy: 'terminal' as const }, { startedBy: 'runner' as const },
|
|
{ existingSessionId: 'hapi', resumeSessionId: 'native', collaborationMode: 'plan' as const }];
|
|
for (const options of launches) await runCodex(options);
|
|
expect(run.mock.calls).toEqual(launches.map(options => [options]));
|
|
});
|
|
});
|