Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ')}`,
Expand Down
10 changes: 10 additions & 0 deletions electron/vite.config.electron.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
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()],
clearScreen: false,
server: {
port: 1421,
strictPort: true,
watch: {
ignored: (watchedPath) => {
const resolvedPath = path.resolve(watchedPath);
return resolvedPath.startsWith(parentDir) && !resolvedPath.startsWith(rootDir);
},
},
},
});
10 changes: 7 additions & 3 deletions src/components/TaskStepsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function TaskStepsSection(props: TaskStepsSectionProps) {
flex: '1',
}}
>
{truncate(step.summary, 140)}
{truncate(step.summary ?? '', 140)}
</span>
</div>

Expand All @@ -303,7 +303,11 @@ export function TaskStepsSection(props: TaskStepsSectionProps) {
{truncate(step.detail ?? '', 280)}
</div>
</Show>
<Show when={step.files_touched && step.files_touched.length > 0}>
<Show
when={
Array.isArray(step.files_touched) && step.files_touched.length > 0
}
>
<div
style={{
display: 'flex',
Expand Down Expand Up @@ -355,7 +359,7 @@ export function TaskStepsSection(props: TaskStepsSectionProps) {
flex: '1',
}}
>
{truncate(step().summary, 140)}
{truncate(step().summary ?? '', 140)}
</span>
<Show when={step().timestamp}>
<span
Expand Down
12 changes: 6 additions & 6 deletions src/store/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { produce } from 'solid-js/store';
import { invoke, Channel } from '../lib/ipc';
import { IPC } from '../../electron/ipc/channels';
import { store, setStore, cleanupPanelEntries } from './core';
import { saveState } from './persistence';
import { setTaskFocusedPanel } from './focus';
import { getProject, getProjectPath, getProjectBranchPrefix, isProjectMissing } from './projects';
import { setPendingShellCommand } from '../lib/bookmarks';
Expand Down Expand Up @@ -181,6 +182,7 @@ export async function createTask(opts: CreateTaskOptions): Promise<string> {
};

initTaskInStore(taskId, task, agent, projectId, agentDef);
saveState(); // fire-and-forget — errors handled internally
return taskId;
}

Expand Down Expand Up @@ -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 {
Expand Down
Loading