Skip to content

fix(history): release mutation lock before retention cleanup - #89

Merged
GalaxyRuler merged 13 commits into
mainfrom
codex/history-retention-deadlock-fix
Aug 7, 2026
Merged

fix(history): release mutation lock before retention cleanup#89
GalaxyRuler merged 13 commits into
mainfrom
codex/history-retention-deadlock-fix

Conversation

@GalaxyRuler

Copy link
Copy Markdown
Owner

Summary

  • Release the history recording-mutation mutex before retention cleanup.
  • Add regression coverage proving cleanup can reacquire the guard after the history mutation.

Root cause

save_entry_with_all_metadata held the non-reentrant recording-mutation mutex while calling retention cleanup. Cleanup can delete old rows/files through a helper that reacquires the same mutex, leaving dictation stuck in Processing after ASR and history persistence.

Validation

  • Focused history regression and adjacent retention tests: passed.
  • Backend check: passed.
  • Full Rust library suite: 816 passed, 0 failed.
  • Rust formatting and diff checks: passed.
  • Windows dev installer build: passed.
  • Packaged native smoke: passed all phases.
  • WhiteKnight real dictation lane: not completed because the dedicated remote runner refused its pre-existing clipboard precondition; it failed closed before app startup and cleaned up successfully.

Base note

This branch was cut from local codex/packaged-insertion-safety, which is not currently present on origin. The draft therefore targets main and includes that branch's preceding commits; retarget it if that base branch is restored.

@GalaxyRuler
GalaxyRuler marked this pull request as ready for review August 7, 2026 09:35
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

timeoutMs: Math.max(timeoutMs, 90000),

P2 Badge Give real-inference execution headroom beyond model loading

When --real-inference-wav uses the default timeout, the runner kills the phase after 90 seconds while VERBATIM_SMOKE_REAL_INFERENCE_TIMEOUT_MS gives the app the same 90 seconds solely to load the model. Startup time, the unbounded transcription call, status serialization, and the additional 2-second smoke-exit delay all occur outside that allowance, so a model that loads successfully near the deadline will always be terminated and reported as a smoke failure. Set the process timeout above the internal model-load timeout with enough margin for inference and shutdown.

ℹ️ 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".

@GalaxyRuler
GalaxyRuler merged commit f6abe20 into main Aug 7, 2026
14 checks passed
@GalaxyRuler
GalaxyRuler deleted the codex/history-retention-deadlock-fix branch August 7, 2026 10:11
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