Skip to content

index: keep recoverable recordings queued - #415

Open
rcheramy wants to merge 1 commit into
coredevices:masterfrom
rcheramy:fix/index-offline-transcription-retry
Open

rcheramy wants to merge 1 commit into
coredevices:masterfrom
rcheramy:fix/index-offline-transcription-retry

Conversation

@rcheramy

Copy link
Copy Markdown

Summary

Keep recoverable Index recording-processing tasks pending until they succeed instead of permanently failing them after three attempts.

Problem

I captured many Index 01 recordings while fishing in the Northwest Territories without internet access. The audio was preserved, but after the queue exhausted its three attempts, every recording had to be opened and retried manually after connectivity returned. That also prevented transcript-bearing webhooks from running automatically.

RecoverableTaskException already distinguishes transient network/model-busy failures from deterministic failures. Deterministic failures are immediately marked Failed, so the generic three-attempt cap only cuts off tasks explicitly classified as recoverable.

Change

  • Remove the three-attempt cap from PersistentQueueScheduler.
  • Keep recoverable tasks in Pending so scheduled retries and app-start recovery can continue.
  • Add a regression test covering three network failures followed by a successful fourth transcription.
  • Verify that retrying reuses the original recording entry rather than creating a duplicate.

Once transcription succeeds, the existing onTranscriptionPersisted path delivers configured transcript-bearing webhooks.

Testing

  • git diff --check
  • Added localAudioProcessing_transcriptionNetworkError_keepsRetryingUntilServiceReturns.
  • I could not execute the Gradle test locally because the isolated environment could not download Gradle 9.6.1; CI should run it.

AI disclosure

AI assistance was used to inspect the processing pipeline, identify the retry cutoff, implement the minimal patch, and draft this PR. I reviewed the resulting change and test.

Signed-off-by: Reg Cheramy <rcheramy@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32fbaad35b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 45 to 46
}
if (task.attempts >= maxAttempts) {
logger.e { "Task with id $id has reached max attempts ($maxAttempts), marking as failed" }
repository.updateStatus(id, TaskStatus.Failed)
return@flow
}
repository.incrementAttempts(id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Deduplicate retries before leaving tasks pending

When a recording stays offline beyond three attempts, its entry remains transcription_error, so the existing feed/details UI still offers Retry; retryRecording/retryLocalRecording then inserts another task for the same recording entry without cancelling the original. With this cap removed, both tasks remain pending and, after connectivity returns, each can transcribe and run the agent/tool path because the scheduler checks only the task status, potentially creating duplicate notes, reminders, or other actions. Reuse or cancel the existing pending task, or suppress manual retry while it is queued.

Useful? React with 👍 / 👎.

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