From 33735dc99ac827893ba69afd49e201c5eb5114df Mon Sep 17 00:00:00 2001 From: CasLinden Date: Fri, 8 May 2026 21:54:23 +0900 Subject: [PATCH] fix(evolution): cancel is not an error --- apps/native/src/hooks/use-evolve.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/apps/native/src/hooks/use-evolve.ts b/apps/native/src/hooks/use-evolve.ts index e95fc0280..e096df29f 100644 --- a/apps/native/src/hooks/use-evolve.ts +++ b/apps/native/src/hooks/use-evolve.ts @@ -99,16 +99,22 @@ const handleEvolve = async () => { store.setEvolvePrompt(""); } catch (e: unknown) { const msg = (e as Error)?.message || String(e); + // User-initiated cancellation isn't an error — backup still ran, so refresh + // the change map but skip the red banner. + const isCancelled = msg.toLowerCase().includes("cancelled by user"); - console.error("[useEvolve] Evolution failed:", { - error: e, - message: msg, - stack: (e as Error)?.stack, - timestamp: new Date().toISOString(), - }); - - useWidgetStore.getState().setError(msg); - useWidgetStore.getState().appendLog(`✗ Error: ${msg}\n`); + if (isCancelled) { + useWidgetStore.getState().appendLog("✗ Evolution cancelled\n"); + } else { + console.error("[useEvolve] Evolution failed:", { + error: e, + message: msg, + stack: (e as Error)?.stack, + timestamp: new Date().toISOString(), + }); + useWidgetStore.getState().setError(msg); + useWidgetStore.getState().appendLog(`✗ Error: ${msg}\n`); + } await findChangeMap(); } finally { useWidgetStore.getState().setGenerating(false);