Skip to content

enhance batch process with phase tracking#3906

Closed
ComputelessComputer wants to merge 1 commit intofeat/ai-note-enhancement-flowfrom
c-branch-9
Closed

enhance batch process with phase tracking#3906
ComputelessComputer wants to merge 1 commit intofeat/ai-note-enhancement-flowfrom
c-branch-9

Conversation

@ComputelessComputer
Copy link
Collaborator

@ComputelessComputer ComputelessComputer commented Feb 12, 2026

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment on lines 263 to +272
});
}),
),
Effect.tap(() => Effect.sync(() => clearBatchSession(sessionId))),
Effect.flatMap(() => Effect.promise(() => runBatch(path))),
Effect.flatMap(() =>
Effect.tryPromise({
try: () => runBatch(path),
catch: (error) =>
error instanceof Error ? error : new Error(String(error)),
}),
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Removal of clearBatchSession before runBatch causes batch transcription to silently abort

The audio upload + batch transcription flow is broken. When uploading an audio file, handleBatchStarted(sessionId, "importing") is called at options-menu.tsx:247, which sets batch[sessionId] in the store. Then after the audio import succeeds, runBatch(path) is called at line 268. This eventually invokes general.ts:runBatch, which at line 461 checks getSessionMode(sessionId). Because batch[sessionId] already exists (set by the earlier handleBatchStarted), getSessionMode returns "running_batch" (see general.ts:595). The guard at general.ts:469 then triggers: if (mode === "running_batch") { return; }, silently aborting the transcription.

Root Cause

The old code had a clearBatchSession(sessionId) call between the audio import and runBatch that cleared the batch state, allowing runBatch to proceed:

Effect.tap(() => Effect.sync(() => clearBatchSession(sessionId))),
Effect.flatMap(() => Effect.promise(() => runBatch(path))),

This PR removed the clearBatchSession call and clearBatchSession from the component entirely. The new code calls handleBatchStarted(sessionId, "importing") to show the importing phase, but never clears it before calling runBatch. Inside general.ts:runBatch at line 469, the running_batch mode guard causes an immediate return, so the actual batch transcription command (listener2Commands.runBatch) is never executed.

Impact: Every audio file upload will import the file but never transcribe it. The user sees the "importing" progress indicator, then the flow silently fails without any error message shown to the user (only a console.warn).

(Refers to lines 246-272)

Prompt for agents
The batch state set by handleBatchStarted(sessionId, "importing") at line 247 needs to be cleared before runBatch is called, so the running_batch guard in general.ts:469 does not abort the transcription. There are two possible approaches:

1. Re-add clearBatchSession: Add back the clearBatchSession selector from useListener at the top of the component (it was removed in this PR), and insert an Effect.tap step that calls clearBatchSession(sessionId) between the audio import step (around line 264) and the Effect.flatMap that calls runBatch (line 266). This restores the old behavior while keeping the new importing phase.

2. Modify general.ts:runBatch: Change the running_batch guard in general.ts around line 469 to allow re-entry when the batch is in the importing phase, e.g. check state.batch[sessionId]?.phase === "importing" and allow proceeding in that case. This is more nuanced and changes the semantics of the guard.

Approach 1 is simpler and safer. Add clearBatchSession back and insert it before runBatch in the Effect pipeline.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant