Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(connectors): default the destructive disconnect dialog to Cancel (R1-M9)

Diego Zacarias1929eaceaf90
diff --git a/desktop-app/src/__tests__/appService.mcpConnectorDisconnect.test.ts b/desktop-app/src/__tests__/appService.mcpConnectorDisconnect.test.ts
index caf7301e0..b368e8f9b 100644
--- a/desktop-app/src/__tests__/appService.mcpConnectorDisconnect.test.ts
+++ b/desktop-app/src/__tests__/appService.mcpConnectorDisconnect.test.ts
@@ -143,6 +143,15 @@ describe('AppService.disconnectMcpServer (spec 11 U4 — destructive revoke)', (
)
})
+ it('defaults the destructive dialog to Cancel so a stray Enter never revokes (R1-M9)', async () => {
+ const svc = makeService()
+ await svc.disconnectMcpServer(SERVER, HOST_REF, CTX, { shared: true })
+
+ expect(mocks.showMessageBox).toHaveBeenCalledWith(
+ expect.objectContaining({ type: 'warning', defaultId: 0, cancelId: 0 })
+ )
+ })
+
it('non-shared copy scopes to the user only', async () => {
const svc = makeService()
await svc.disconnectMcpServer(SERVER, HOST_REF, undefined, { shared: false })
diff --git a/desktop-app/src/appService.ts b/desktop-app/src/appService.ts
index 6f7675637..502c81a31 100644
--- a/desktop-app/src/appService.ts
+++ b/desktop-app/src/appService.ts
@@ -4689,7 +4689,9 @@ export class AppService {
const opts = {
type: (action === 'disconnect' ? 'warning' : 'question') as 'warning' | 'question',
buttons: ['Cancel', verb],
- defaultId: 1,
+ // Disconnect is destructive: default to Cancel (0) so a stray Enter does
+ // NOT revoke. Connect is additive, so its default stays on the action (1).
+ defaultId: action === 'disconnect' ? 0 : 1,
cancelId: 0,
message,
detail,