@@ -1098,32 +1098,42 @@ export function updateProject(
10981098 defaultChatRuntimeProfileId ?: string | null ;
10991099 } ,
11001100) : ProjectRow | undefined {
1101+ const patch : Partial < ProjectRow > = {
1102+ name : input . name ,
1103+ rootPath : input . rootPath ,
1104+ plannerMaxBudgetUsd : input . plannerMaxBudgetUsd ?? null ,
1105+ planCheckerMaxBudgetUsd : input . planCheckerMaxBudgetUsd ?? null ,
1106+ implementerMaxBudgetUsd : input . implementerMaxBudgetUsd ?? null ,
1107+ reviewSidecarMaxBudgetUsd : input . reviewSidecarMaxBudgetUsd ?? null ,
1108+ parallelEnabled : input . parallelEnabled ?? false ,
1109+ updatedAt : new Date ( ) . toISOString ( ) ,
1110+ } ;
1111+ if ( input . defaultTaskRuntimeProfileId !== undefined ) {
1112+ patch . defaultTaskRuntimeProfileId = input . defaultTaskRuntimeProfileId ;
1113+ }
1114+ if ( input . defaultPlanRuntimeProfileId !== undefined ) {
1115+ patch . defaultPlanRuntimeProfileId = input . defaultPlanRuntimeProfileId ;
1116+ }
1117+ if ( input . defaultReviewRuntimeProfileId !== undefined ) {
1118+ patch . defaultReviewRuntimeProfileId = input . defaultReviewRuntimeProfileId ;
1119+ }
1120+ if ( input . defaultChatRuntimeProfileId !== undefined ) {
1121+ patch . defaultChatRuntimeProfileId = input . defaultChatRuntimeProfileId ;
1122+ }
1123+
11011124 log . debug (
11021125 {
11031126 projectId : id ,
1104- defaultTaskRuntimeProfileId : input . defaultTaskRuntimeProfileId ?? null ,
1105- defaultPlanRuntimeProfileId : input . defaultPlanRuntimeProfileId ?? null ,
1106- defaultReviewRuntimeProfileId : input . defaultReviewRuntimeProfileId ?? null ,
1107- defaultChatRuntimeProfileId : input . defaultChatRuntimeProfileId ?? null ,
1127+ defaultTaskRuntimeProfileId : patch . defaultTaskRuntimeProfileId ?? null ,
1128+ defaultPlanRuntimeProfileId : patch . defaultPlanRuntimeProfileId ?? null ,
1129+ defaultReviewRuntimeProfileId : patch . defaultReviewRuntimeProfileId ?? null ,
1130+ defaultChatRuntimeProfileId : patch . defaultChatRuntimeProfileId ?? null ,
11081131 } ,
11091132 "Updating project runtime defaults" ,
11101133 ) ;
11111134 getDb ( )
11121135 . update ( projects )
1113- . set ( {
1114- name : input . name ,
1115- rootPath : input . rootPath ,
1116- plannerMaxBudgetUsd : input . plannerMaxBudgetUsd ?? null ,
1117- planCheckerMaxBudgetUsd : input . planCheckerMaxBudgetUsd ?? null ,
1118- implementerMaxBudgetUsd : input . implementerMaxBudgetUsd ?? null ,
1119- reviewSidecarMaxBudgetUsd : input . reviewSidecarMaxBudgetUsd ?? null ,
1120- parallelEnabled : input . parallelEnabled ?? false ,
1121- defaultTaskRuntimeProfileId : input . defaultTaskRuntimeProfileId ?? null ,
1122- defaultPlanRuntimeProfileId : input . defaultPlanRuntimeProfileId ?? null ,
1123- defaultReviewRuntimeProfileId : input . defaultReviewRuntimeProfileId ?? null ,
1124- defaultChatRuntimeProfileId : input . defaultChatRuntimeProfileId ?? null ,
1125- updatedAt : new Date ( ) . toISOString ( ) ,
1126- } )
1136+ . set ( patch )
11271137 . where ( eq ( projects . id , id ) )
11281138 . run ( ) ;
11291139 return findProjectById ( id ) ;
0 commit comments