File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,12 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
5656} ) ) ;
5757
5858// Handle tool calls
59- server . setRequestHandler ( CallToolRequestSchema , ( request ) =>
60- handleToolCall ( {
59+ server . setRequestHandler ( CallToolRequestSchema , async ( request ) => {
60+ // Reload state from disk before each request to ensure consistency
61+ if ( workflowState ) {
62+ await workflowState . load ( ) ;
63+ }
64+ return handleToolCall ( {
6165 request,
6266 normalizeRequestArgs,
6367 workflowState,
@@ -72,8 +76,8 @@ server.setRequestHandler(CallToolRequestSchema, (request) =>
7276 workingTreeSummary,
7377 } ,
7478 utils : { shellEscape, determineReleaseTypeFromCommit, createCommitMessageParts } ,
75- } )
76- ) ;
79+ } ) ;
80+ } ) ;
7781
7882// Helper function
7983export function getNextStep ( status ) {
Original file line number Diff line number Diff line change @@ -781,14 +781,18 @@ async function handleProjectSummaryDb(workflowState) {
781781}
782782
783783async function handleRerunWorkflow ( workflowState ) {
784+ // Capture task context BEFORE reset to avoid losing it
784785 const currentDescription = workflowState . state . taskDescription ;
785786 const currentType = workflowState . state . taskType ;
786787
787788 if ( ! currentDescription ) {
788789 return textResponse ( "⚠️ No active task to rerun. Use 'start_task' to begin a new workflow." ) ;
789790 }
790791
792+ // Reset all progress flags but preserve history
791793 workflowState . reset ( ) ;
794+
795+ // Restore task context after reset
792796 workflowState . state . currentPhase = "coding" ;
793797 workflowState . state . taskDescription = currentDescription ;
794798 workflowState . state . taskType = currentType ;
You can’t perform that action at this time.
0 commit comments