Skip to content

Comments

Fix typing tool fallback and server reliability#9

Merged
csheaff merged 9 commits intomainfrom
fix/typing-tool-fallback
Feb 21, 2026
Merged

Fix typing tool fallback and server reliability#9
csheaff merged 9 commits intomainfrom
fix/typing-tool-fallback

Conversation

@csheaff
Copy link
Owner

@csheaff csheaff commented Feb 21, 2026

Summary

  • Typing tool fallback chain: try wtype → ydotool+daemon → xdotool → bare ydotool (with warning), instead of failing silently when the preferred tool doesn't work
  • Skip xdotool on Wayland: it returns 0 but types nothing on Wayland sessions
  • Server config propagation: server scripts now source ~/.config/talktype/config directly so WHISPER_MODEL and other settings work when invoked standalone or after reboot
  • Dead daemon detection: if the daemon crashes (e.g. CUDA not ready after reboot), detect the stale socket and restart instead of hanging forever
  • Socat timeout: add 30s safety timeout to prevent indefinite hangs

Test plan

  • All 25 BATS tests pass
  • ShellCheck clean
  • Manual testing: reboot → talktype works on second invocation (daemon auto-starts)
  • transcribe-server start loads configured model (large-v3-turbo) instead of defaulting to base

🤖 Generated with Claude Code

csheaff and others added 9 commits February 15, 2026 09:48
…ak (#7)

Each ydotool invocation without ydotoold creates a kernel virtual input
device that persists until reboot. Add auto-detection fallback chain
(wtype → ydotool+daemon → xdotool → ydotool with warning) configurable
via TALKTYPE_TYPE_CMD, matching the existing ffmpeg/pw-record pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dge cases

- Add pgrep mock for deterministic tests (default: no ydotoold running)
- Add test for ydotool+daemon detection path
- Add test for bare ydotool warning (once-per-session)
- Error explicitly if auto-detection finds no typing tool
- Update line counts in CLAUDE.md and README.md
- Update architecture description in CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
wtype can be installed but fail at runtime if the compositor doesn't
support virtual-keyboard-unstable-v1 (e.g. GNOME). Change auto mode
to actually try each tool and fall through on failure, rather than
just checking if the binary exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bare ydotool without ydotoold leaks kernel input devices that can crash
the system. Auto mode now only uses safe tools (wtype, ydotool+daemon,
xdotool) and errors with clear instructions if none work. Users can
still opt in to bare ydotool via TALKTYPE_TYPE_CMD=ydotool.

Also remove Parakeet backend from README (CTC model outputs lowercase
without punctuation, not useful for typing).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On GNOME Wayland, wtype fails (no virtual-keyboard protocol) and
xdotool fails (X11 events ignored by Wayland apps). Bare ydotool is
the only working option. Testing shows ydotool 0.1.8-3build1 cleans
up its virtual input devices, so allow it as a last resort with a
once-per-session warning about the potential device leak.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xdotool sends X11 key events that Wayland-native apps silently ignore,
yet returns exit 0. Only try xdotool on pure X11 sessions (DISPLAY set,
WAYLAND_DISPLAY unset) so it doesn't block the ydotool fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Server scripts (transcribe-server, moonshine-server, parakeet-server)
now source ~/.config/talktype/config directly. Previously, env vars
like WHISPER_MODEL were shell-local in talktype and didn't propagate
to server subprocesses, causing the daemon to load the wrong model.

Also bumps startup timeout from 30s to 60s for whisper and moonshine
servers (large models + cold CUDA init can exceed 30s on reboot).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
If the daemon crashes (e.g. CUDA not ready right after reboot), the
socket file remains but nobody is listening. Previously socat would
hang forever. Now the transcribe command checks the PID is alive before
connecting, cleans up stale state if not, and restarts the daemon.
Also adds socat -T 30 timeout as a safety net.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@csheaff csheaff merged commit c4937fd into main Feb 21, 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.

1 participant