Procházet zdrojové kódy

refactor: trim verbose comments in interview service to match repo style

bobbyunknown před 2 měsíci
rodič
revize
571ce2e597
1 změnil soubory, kde provedl 5 přidání a 11 odebrání
  1. 5 11
      src/interview/service.ts

+ 5 - 11
src/interview/service.ts

@@ -383,11 +383,7 @@ export function createInterviewService(
     // Rename file if assistant provided a title (and file hasn't been renamed yet)
     await maybeRenameWithTitle(interview, state.title);
 
-    // Only rewrite the document when we have structured state from the agent.
-    // When parsed.state is null (e.g. after confirm-complete), the agent has
-    // already written the final polished spec directly to the file — rewriting
-    // would clobber it with a rebuild that loses the agent's formatting and
-    // Q&A history (due to case-sensitive marker mismatch).
+    // Skip rewrite when parsed.state is null — agent already wrote the final spec
     let document: string;
     if (parsed.state) {
       document = await rewriteInterviewDocument(interview, state.summary);
@@ -644,15 +640,13 @@ export function createInterviewService(
         const wasBusy = sessionBusy.get(sessionID) === true;
         sessionBusy.set(sessionID, status?.type === 'busy');
 
-        // When session transitions from busy → idle, sync state so the
-        // browser gets the final push (e.g. after confirm-complete or
-        // chat message processing). Without this, the browser stays
-        // stuck on "Agent Thinking" because no poll triggers syncInterview.
+        // Sync state on busy → idle so the browser gets the final push
         if (wasBusy && status?.type !== 'busy') {
           const activeId = activeInterviewIds.get(sessionID);
-          const interview = activeId ? interviewsById.get(activeId) : null;
+          const interview = activeId
+            ? interviewsById.get(activeId)
+            : null;
           if (interview && interview.status === 'active') {
-            // Fire-and-forget — syncInterview pushes state via onStateChange
             syncInterview(interview).catch(() => {});
           }
         }