diff --git a/electron/main.ts b/electron/main.ts index 17bd0822..21e4ac36 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -51,7 +51,9 @@ function verifyPreloadAllowlist(): void { const preloadPath = path.join(__dirname, '..', 'electron', 'preload.cjs'); const preloadSrc = fs.readFileSync(preloadPath, 'utf8'); const enumValues = new Set(Object.values(IPC)); - const missing = [...enumValues].filter((v) => !preloadSrc.includes(`"${v}"`)); + const hasChannel = (channel: string) => + preloadSrc.includes(`'${channel}'`) || preloadSrc.includes(`"${channel}"`); + const missing = [...enumValues].filter((v) => !hasChannel(v)); if (missing.length > 0) { console.warn( `[preload-sync] IPC channels missing from preload.cjs ALLOWED_CHANNELS: ${missing.join(', ')}`, diff --git a/electron/vite.config.electron.ts b/electron/vite.config.electron.ts index 02b08a95..042f09bf 100644 --- a/electron/vite.config.electron.ts +++ b/electron/vite.config.electron.ts @@ -1,6 +1,10 @@ +import path from 'path'; import { defineConfig } from 'vite'; import solid from 'vite-plugin-solid'; +const rootDir = path.resolve(process.cwd()); +const parentDir = path.resolve(rootDir, '..'); + export default defineConfig({ base: './', plugins: [solid()], @@ -8,5 +12,11 @@ export default defineConfig({ server: { port: 1421, strictPort: true, + watch: { + ignored: (watchedPath) => { + const resolvedPath = path.resolve(watchedPath); + return resolvedPath.startsWith(parentDir) && !resolvedPath.startsWith(rootDir); + }, + }, }, }); diff --git a/src/components/TaskStepsSection.tsx b/src/components/TaskStepsSection.tsx index b1b693ef..18e4de0a 100644 --- a/src/components/TaskStepsSection.tsx +++ b/src/components/TaskStepsSection.tsx @@ -284,7 +284,7 @@ export function TaskStepsSection(props: TaskStepsSectionProps) { flex: '1', }} > - {truncate(step.summary, 140)} + {truncate(step.summary ?? '', 140)} @@ -303,7 +303,11 @@ export function TaskStepsSection(props: TaskStepsSectionProps) { {truncate(step.detail ?? '', 280)} - 0}> + 0 + } + >
- {truncate(step().summary, 140)} + {truncate(step().summary ?? '', 140)} { }; initTaskInStore(taskId, task, agent, projectId, agentDef); + saveState(); // fire-and-forget — errors handled internally return taskId; } @@ -609,12 +611,10 @@ export function setPlanContent( } export function setStepsContent(taskId: string, steps: unknown[] | null): void { - setStore( - 'tasks', - taskId, - 'stepsContent', - steps && steps.length > 0 ? (steps as StepEntry[]) : undefined, - ); + const valid = steps + ? (steps.filter((s) => s !== null && typeof s === 'object' && !Array.isArray(s)) as StepEntry[]) + : []; + setStore('tasks', taskId, 'stepsContent', valid.length > 0 ? valid : undefined); } export function setTaskLastInputAt(taskId: string): void {