@@ -122,7 +122,7 @@ export async function POST(request: NextRequest) {
122122 } )
123123 . where ( eq ( tasks . id , taskId ) )
124124
125- await logger . success ( ` Generated AI branch name: ${ aiBranchName } ` )
125+ await logger . success ( ' Generated AI branch name' )
126126 } catch ( error ) {
127127 console . error ( 'Error generating AI branch name:' , error )
128128
@@ -139,7 +139,7 @@ export async function POST(request: NextRequest) {
139139 . where ( eq ( tasks . id , taskId ) )
140140
141141 const logger = createTaskLogger ( taskId )
142- await logger . info ( ` Using fallback branch name: ${ fallbackBranchName } ` )
142+ await logger . info ( ' Using fallback branch name' )
143143 } catch ( dbError ) {
144144 console . error ( 'Error updating task with fallback branch name:' , dbError )
145145 }
@@ -278,7 +278,7 @@ async function processTask(
278278 const taskStartTime = Date . now ( )
279279
280280 try {
281- console . log ( `[TASK ${ taskId } ] Starting task processing at ${ new Date ( ) . toISOString ( ) } ` )
281+ console . log ( ' Starting task processing' )
282282
283283 // Update task status to processing with real-time logging
284284 await logger . updateStatus ( 'processing' , 'Task created, preparing to start...' )
@@ -310,13 +310,13 @@ async function processTask(
310310 }
311311
312312 if ( aiBranchName ) {
313- await logger . info ( ` Using AI-generated branch name: ${ aiBranchName } ` )
313+ await logger . info ( ' Using AI-generated branch name' )
314314 } else {
315315 await logger . info ( 'AI branch name not ready, will use fallback during sandbox creation' )
316316 }
317317
318- await logger . updateProgress ( 15 , 'Creating sandbox environment... ' )
319- console . log ( `[TASK ${ taskId } ] Creating sandbox at ${ new Date ( ) . toISOString ( ) } ` )
318+ await logger . updateProgress ( 15 , 'Creating sandbox environment' )
319+ console . log ( ' Creating sandbox' )
320320
321321 // Create sandbox with progress callback and 5-minute timeout
322322 const sandboxResult = await createSandbox (
@@ -371,7 +371,7 @@ async function processTask(
371371
372372 const { sandbox : createdSandbox , domain, branchName } = sandboxResult
373373 sandbox = createdSandbox || null
374- console . log ( `[TASK ${ taskId } ] Sandbox created successfully at ${ new Date ( ) . toISOString ( ) } ` )
374+ console . log ( ' Sandbox created successfully' )
375375
376376 // Update sandbox URL and branch name (only update branch name if not already set by AI)
377377 const updateData : { sandboxUrl ?: string ; updatedAt : Date ; branchName ?: string } = {
@@ -393,8 +393,8 @@ async function processTask(
393393 }
394394
395395 // Log agent execution start
396- await logger . updateProgress ( 50 , ` Installing and executing ${ selectedAgent } agent...` )
397- console . log ( `[TASK ${ taskId } ] Starting ${ selectedAgent } agent execution at ${ new Date ( ) . toISOString ( ) } ` )
396+ await logger . updateProgress ( 50 , ' Installing and executing agent' )
397+ console . log ( ' Starting agent execution' )
398398
399399 // Execute selected agent with timeout (different timeouts per agent)
400400 const getAgentTimeout = ( agent : string ) => {
@@ -447,9 +447,7 @@ async function processTask(
447447 } )
448448
449449 if ( mcpServers . length > 0 ) {
450- await logger . info (
451- `Found ${ mcpServers . length } connected MCP servers: ${ mcpServers . map ( ( s ) => s . name ) . join ( ', ' ) } ` ,
452- )
450+ await logger . info ( 'Found connected MCP servers' )
453451
454452 // Store MCP server IDs in the task
455453 await db
@@ -484,15 +482,15 @@ async function processTask(
484482 agentTimeoutPromise ,
485483 ] )
486484
487- console . log ( `[TASK ${ taskId } ] Agent execution completed at ${ new Date ( ) . toISOString ( ) } ` )
485+ console . log ( ' Agent execution completed' )
488486
489487 if ( agentResult . success ) {
490488 // Log agent completion
491- await logger . success ( ` ${ selectedAgent } agent execution completed` )
492- await logger . info ( agentResult . output || 'Code changes applied successfully' )
489+ await logger . success ( 'Agent execution completed' )
490+ await logger . info ( 'Code changes applied successfully' )
493491
494492 if ( agentResult . agentResponse ) {
495- await logger . info ( ` Agent Response: ${ agentResult . agentResponse } ` )
493+ await logger . info ( ' Agent response received' )
496494 }
497495
498496 // Agent execution logs are already logged in real-time by the agent
@@ -508,7 +506,7 @@ async function processTask(
508506 if ( shutdownResult . success ) {
509507 await logger . success ( 'Sandbox shutdown completed' )
510508 } else {
511- await logger . error ( ` Sandbox shutdown failed: ${ shutdownResult . error } ` )
509+ await logger . error ( ' Sandbox shutdown failed' )
512510 }
513511
514512 // Check if push failed and handle accordingly
@@ -521,14 +519,11 @@ async function processTask(
521519 await logger . updateStatus ( 'completed' )
522520 await logger . updateProgress ( 100 , 'Task completed successfully' )
523521
524- const totalTaskTime = ( ( Date . now ( ) - taskStartTime ) / 1000 ) . toFixed ( 2 )
525- console . log (
526- `[TASK ${ taskId } ] Task completed successfully at ${ new Date ( ) . toISOString ( ) } (total time: ${ totalTaskTime } s)` ,
527- )
522+ console . log ( 'Task completed successfully' )
528523 }
529524 } else {
530525 // Agent failed, but we still want to capture its logs
531- await logger . error ( ` ${ selectedAgent } agent execution failed` )
526+ await logger . error ( 'Agent execution failed' )
532527
533528 // Agent execution logs are already logged in real-time by the agent
534529 // No need to log them again here
@@ -546,7 +541,7 @@ async function processTask(
546541 if ( shutdownResult . success ) {
547542 await logger . info ( 'Sandbox shutdown completed after error' )
548543 } else {
549- await logger . error ( ` Sandbox shutdown failed: ${ shutdownResult . error } ` )
544+ await logger . error ( ' Sandbox shutdown failed' )
550545 }
551546 } catch ( shutdownError ) {
552547 console . error ( 'Failed to shutdown sandbox after error:' , shutdownError )
@@ -557,7 +552,7 @@ async function processTask(
557552 const errorMessage = error instanceof Error ? error . message : 'Unknown error occurred'
558553
559554 // Log the error and update task status
560- await logger . error ( ` Error: ${ errorMessage } ` )
555+ await logger . error ( ' Error occurred during task processing' )
561556 await logger . updateStatus ( 'error' , errorMessage )
562557 }
563558}
0 commit comments