Skip to content

Commit 19456a8

Browse files
committed
fix errors
1 parent 9426e55 commit 19456a8

File tree

4 files changed

+6
-33
lines changed

4 files changed

+6
-33
lines changed

app/api/tasks/[taskId]/files/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
144144
comparison.data.files?.map((file) => ({
145145
filename: file.filename,
146146
status: file.status as 'added' | 'modified' | 'deleted' | 'renamed',
147-
additions: file.additions || undefined,
148-
deletions: file.deletions || undefined,
147+
additions: file.additions || 0,
148+
deletions: file.deletions || 0,
149149
changes: file.changes || 0,
150150
})) || []
151151

components/task-details.tsx

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use client'
22

3-
import { Task, LogEntry, Connector } from '@/lib/db/schema'
3+
import { Task, Connector } from '@/lib/db/schema'
44
import { Button } from '@/components/ui/button'
55
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
66
import { GitBranch, CheckCircle, AlertCircle, Loader2, Copy, Check, Server, Cable, Square } from 'lucide-react'
77
import { cn } from '@/lib/utils'
8-
import { useState, useEffect, useRef } from 'react'
8+
import { useState, useEffect } from 'react'
99
import { toast } from 'sonner'
1010
import { Claude, Codex, Cursor, Gemini, OpenCode } from '@/components/logos'
1111
import { useTasks } from '@/components/app-layout'
@@ -42,7 +42,6 @@ export function TaskDetails({ task }: TaskDetailsProps) {
4242
const [selectedFile, setSelectedFile] = useState<string | undefined>(undefined)
4343
const [diffsCache, setDiffsCache] = useState<Record<string, DiffData>>({})
4444
const [loadingDiffs, setLoadingDiffs] = useState(false)
45-
const [hasRemoteChanges, setHasRemoteChanges] = useState(false)
4645
const { refreshTasks } = useTasks()
4746

4847
// Helper function to format dates - show only time if same day as today
@@ -67,11 +66,6 @@ export function TaskDetails({ task }: TaskDetailsProps) {
6766
}
6867
}, [task.status, optimisticStatus])
6968

70-
// Reset hasRemoteChanges when task changes
71-
useEffect(() => {
72-
setHasRemoteChanges(false)
73-
}, [task.id, task.branchName])
74-
7569
const getAgentLogo = (agent: string | null) => {
7670
if (!agent) return null
7771

@@ -212,9 +206,6 @@ export function TaskDetails({ task }: TaskDetailsProps) {
212206
const fetchAllDiffs = async (filesList: string[]) => {
213207
if (!filesList.length || loadingDiffs) return
214208

215-
// Mark that we have remote changes
216-
setHasRemoteChanges(true)
217-
218209
setLoadingDiffs(true)
219210
const newDiffsCache: Record<string, DiffData> = {}
220211

@@ -306,23 +297,6 @@ export function TaskDetails({ task }: TaskDetailsProps) {
306297
}
307298
}
308299

309-
const getStatusText = (status: Task['status']) => {
310-
switch (status) {
311-
case 'pending':
312-
return 'Waiting to start'
313-
case 'processing':
314-
return 'In progress'
315-
case 'completed':
316-
return 'Completed'
317-
case 'error':
318-
return 'Failed'
319-
case 'stopped':
320-
return 'Stopped'
321-
default:
322-
return 'Unknown'
323-
}
324-
}
325-
326300
const getStatusColor = (status: Task['status']) => {
327301
switch (status) {
328302
case 'pending':

lib/sandbox/agents/cursor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ EOF`
231231

232232
// Use the correct flags: -p for print mode (non-interactive), --force for file modifications
233233
// Try multiple approaches to find and execute cursor-agent
234-
let result
235234

236235
// Log what we're about to execute
237236
const modelFlag = selectedModel ? ` --model ${selectedModel}` : ''
@@ -339,7 +338,7 @@ EOF`
339338
}
340339
}
341340

342-
result = {
341+
const result = {
343342
success: true, // We'll determine actual success based on git changes
344343
output: capturedOutput,
345344
error: capturedError,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coding-agent-template",
3-
"version": "0.1.0",
3+
"version": "1.5.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev --turbopack",

0 commit comments

Comments
 (0)