Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(agent): cover unavailable native Apps on SSH routes

Chris957a5974b75e
diff --git a/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts b/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts
index e8468dc8c5..695610c878 100644
--- a/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts
+++ b/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts
@@ -3146,7 +3146,11 @@ describe('Bot canonical Session lifecycle', () => {
for (const agentKind of ['codex', 'claude-code', 'pi'] as const) {
const service = createBotCapabilityService({ ...capabilityDeps, resolveBotAgentKind: async () => agentKind });
await expect(service.list(input)).resolves.toMatchObject({
- capabilities: [expect.objectContaining({ id: 'shared-docs', joined: true, available: agentKind !== 'codex' })],
+ capabilities: [
+ expect.objectContaining({ id: 'shared-docs', joined: true, available: agentKind !== 'codex' }),
+ // Native Apps is discoverable but cannot be selected on SSH Codex.
+ ...(agentKind === 'codex' ? [expect.objectContaining({ id: 'codex_apps', joined: false, available: false })] : []),
+ ],
});
const opts: MakerSessionCreateOpts = {
id: created.session.id, agentKind, workingDir: '/srv/bot', remoteHostId: 'ssh-host',
@@ -3161,6 +3165,8 @@ describe('Bot canonical Session lifecycle', () => {
}
const service = createBotCapabilityService({ ...capabilityDeps, resolveBotAgentKind: async () => 'codex' });
h.validateCapabilityAdditions.mockImplementation(service.validateAdditions);
+ await expect(service.select({ ...input, id: 'codex_apps', joined: true }))
+ .resolves.toMatchObject({ ok: false, errorCode: 'CAPABILITY_UNAVAILABLE' });
await expect(service.select({ ...input, joined: false })).resolves.toMatchObject({ ok: true, joined: false });
await expect(service.select({ ...input, joined: true })).resolves.toMatchObject({ ok: false, errorCode: 'CAPABILITY_UNAVAILABLE' });
await expect(invoke('local-db:bots:update', { id: 'bot-1', capabilities: { mcpServers: ['shared-docs'] } }))