Skip to content

feat: add Xiaomi MiMo ASR and explicit hotkey trigger modes - #2

Merged
smartcmd merged 1 commit into
typex-ink:masterfrom
fish2lab:codex/mimo-asr-hotkey-modes
Jul 30, 2026
Merged

feat: add Xiaomi MiMo ASR and explicit hotkey trigger modes#2
smartcmd merged 1 commit into
typex-ink:masterfrom
fish2lab:codex/mimo-asr-hotkey-modes

Conversation

@fish2lab

Copy link
Copy Markdown
Contributor

Summary

  • Add a native Xiaomi MiMo STT adapter using /chat/completions, Base64-encoded WAV input, and asr_options.language.
  • Register ProviderKind::Mimo throughout provider validation, registry construction, migrations, and the settings preset list.
  • Replace duration-based hotkey intent detection with an explicit Hold to talk / Press to toggle setting.
  • Apply the selected trigger mode consistently to dictation, translation, and assistant sessions.
  • Migrate settings schema from v10 to v11 while preserving existing users on hold.

Motivation

MiMo ASR does not use the multipart /audio/transcriptions wire format used by OpenAI-compatible STT providers. It requires a dedicated JSON request shape, so treating it as a generic OpenAI-compatible endpoint would produce an invalid request.

The previous hotkey state machine inferred hold versus toggle behavior from a 350 ms release boundary. This made short presses timing-sensitive and unreliable for page turners and third-party keyboards that emit brief down/up pulses instead of a stable held-key signal. Assistant toggle sessions also waited for the second release, creating an additional sticky interaction.

Behavior

  • hold: the first keydown starts recording and the matching keyup stops it.
  • toggle: the first keydown starts recording, releases are ignored, and the second keydown stops recording immediately.
  • The trigger mode is snapshotted when recording starts, so changing settings does not alter an active session.
  • Existing v10 settings migrate to hold; the obsolete hold_threshold_ms field is removed.
  • Long-audio incremental transcription and live dictation are intentionally out of scope.

Validation

  • cargo test --manifest-path src-tauri/Cargo.toml --no-default-features --lib orchestrator::session::tests — 32 passed
  • Targeted v10 → v11 migration test — passed
  • pnpm gen:ipc — passed
  • pnpm test — 160 passed
  • pnpm tauri build --debug --bundles app -- --no-default-features — passed
  • Manual MiMo cloud smoke test returned a successful transcription; the credential remained in local runtime configuration and is not present in the repository

@fish2lab
fish2lab marked this pull request as ready for review July 29, 2026 17:39
@smartcmd
smartcmd merged commit 1dd05de into typex-ink:master Jul 30, 2026
6 checks passed
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.

2 participants