* fix(opencode): recover empty bridge output sends * fix(opencode): handle empty readiness bridge output * fix(opencode): retry read-only bridge no-output * fix(opencode): recover empty bridge output sends --------- Co-authored-by: iliya <iliyazelenkog@gmail.com> * fix(runtime-provider): clarify opencode model routes ux * fix(team): show create dialog loading fallback * feat(team): support revising sent messages * test(team): cover sent message revision flow * fix(opencode): harden local runtime bridge support * fix(member-work-sync): recover stale nudge payload conflicts * fix(runtime): gate codex install prompt on runtime status * fix(team): persist incomplete launch state before cleanup * fix(team): keep launch pending for dead runtime entries * feat(logs): compact team log source controls * fix(build): verify radix presence patch before build * fix(renderer): recover failed dynamic imports * fix(team): preserve task labels and change presence * fix(logs): restore member process log source * fix(team): require revision notice before editing --------- Co-authored-by: iliya <iliyazelenkog@gmail.com> Co-authored-by: 777genius <quantjumppro@gmail.com>
81 lines
2.2 KiB
TypeScript
81 lines
2.2 KiB
TypeScript
import {
|
|
isCodexProviderRuntimeMissing,
|
|
shouldOfferCodexRuntimeInstall,
|
|
} from '@renderer/components/runtime/codexRuntimeInstallAction';
|
|
import { createDefaultCliExtensionCapabilities } from '@shared/utils/providerExtensionCapabilities';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
import type { CliProviderStatus } from '@shared/types';
|
|
|
|
function createCodexProvider(overrides?: Partial<CliProviderStatus>): CliProviderStatus {
|
|
return {
|
|
providerId: 'codex',
|
|
displayName: 'Codex',
|
|
supported: true,
|
|
authenticated: false,
|
|
authMethod: null,
|
|
verificationState: 'error',
|
|
statusMessage: 'Codex CLI not found',
|
|
models: [],
|
|
modelAvailability: [],
|
|
canLoginFromUi: false,
|
|
capabilities: {
|
|
teamLaunch: false,
|
|
oneShot: false,
|
|
extensions: createDefaultCliExtensionCapabilities(),
|
|
},
|
|
selectedBackendId: 'codex-native',
|
|
resolvedBackendId: 'codex-native',
|
|
availableBackends: [
|
|
{
|
|
id: 'codex-native',
|
|
label: 'Codex native',
|
|
description: 'Use codex exec JSON mode.',
|
|
selectable: false,
|
|
recommended: true,
|
|
available: false,
|
|
state: 'runtime-missing',
|
|
audience: 'general',
|
|
statusMessage: 'Codex CLI not found',
|
|
},
|
|
],
|
|
externalRuntimeDiagnostics: [],
|
|
backend: null,
|
|
connection: null,
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
describe('codexRuntimeInstallAction', () => {
|
|
it('recognizes provider runtime-missing snapshots', () => {
|
|
expect(isCodexProviderRuntimeMissing(createCodexProvider())).toBe(true);
|
|
});
|
|
|
|
it('does not offer install before installer status is loaded', () => {
|
|
expect(shouldOfferCodexRuntimeInstall(null)).toBe(false);
|
|
});
|
|
|
|
it('offers install for confirmed missing or failed runtime status only', () => {
|
|
expect(
|
|
shouldOfferCodexRuntimeInstall({
|
|
installed: false,
|
|
source: 'missing',
|
|
state: 'idle',
|
|
})
|
|
).toBe(true);
|
|
expect(
|
|
shouldOfferCodexRuntimeInstall({
|
|
installed: false,
|
|
source: 'app-managed',
|
|
state: 'failed',
|
|
})
|
|
).toBe(true);
|
|
expect(
|
|
shouldOfferCodexRuntimeInstall({
|
|
installed: true,
|
|
source: 'path',
|
|
state: 'ready',
|
|
})
|
|
).toBe(false);
|
|
});
|
|
});
|