Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions apps/native/src/hooks/use-evolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest this should be a const. (Looking at the related Rust code, it definitely should be there, too.)


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);
Expand Down
Loading