Repository navigation
Fix three ways Ember blamed the user for its own failures - #121
Merged
Merged
Conversation
1. "it won't control my mouse as apparently i am moving it" The takeover monitor compared the cursor only against where Ember last WROTE it, so a cursor that never moved — because Ember had no permission to move it, the usual macOS Accessibility case — looked identical to one being dragged away by a hand. Removing detached mode made every move run through this check, which is why it started showing up now. A takeover means the cursor is off-target AND still moving between samples. A cursor that is off-target and frozen means Ember's writes are going nowhere. TakeoverMonitor now distinguishes the two and sets `stalled` for the second; move() reports it separately and tools.py surfaces the actual fix — the Accessibility permission on macOS, running as administrator on Windows, the Wayland restriction on Linux — instead of telling the user to let go of a mouse they were not touching. 2. Mic test: "No working microphone backend" for a microphone that worked audio_backend._record_sounddevice used sd.rec(), which returns a NumPy array and therefore needs NumPy. Ember.spec deliberately EXCLUDES NumPy to keep the bundle small, so recording failed inside Ember.app while the mic itself opened fine — audio_level uses RawInputStream, which has no such dependency. Hence "Mic opened but capture failed". _record_sounddevice now uses RawInputStream too. Tests assert sd.rec() stays out of that path and that NumPy stays excluded, so the pairing is self-explaining if anyone reaches for sd.rec() again. The failure message was also impossible to act on: it told the user to run "/Applications/Ember.app/Contents/MacOS/Ember" -m pip install sounddevice sys.executable inside the bundle is the Ember binary, not a Python anything can be installed into. The frozen build now says it is a packaging fault and points at running from source meanwhile. 3. "i cannot interrupt ember in voice mode" Stop cancelled the agent turn but never stopped speech and left an orb conversation running, so Ember kept talking and kept listening for the next turn. The mic is deliberately closed while Ember speaks, so there was no voice route either — the one control that should have worked did not. _on_stop now silences TTS and ends the conversation before stopping the turn. Full suite 1353 passed, same 23 pre-existing environment failures. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WebHeGmZb12sW6ZUuyUNix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. "it won't control my mouse as apparently i am moving it"
The takeover monitor compared the cursor only against where Ember last wrote it. A cursor that never moved — because Ember had no permission to move it, the usual macOS Accessibility case — looked identical to one being dragged away by a hand. Removing detached mode made every move run through this check, which is why it surfaced now.
A takeover means the cursor is off-target AND still moving between samples. Off-target and frozen means Ember's writes are going nowhere.
TakeoverMonitornow distinguishes the two and setsstalledfor the second;tools.pysurfaces the actual fix — Accessibility on macOS, running as administrator on Windows, the Wayland restriction on Linux — instead of telling the user to let go of a mouse they were not touching.2. "No working microphone backend" for a microphone that worked
audio_backend._record_sounddeviceusedsd.rec(), which returns a NumPy array and therefore needs NumPy.Ember.specdeliberately excludes NumPy to keep the bundle small, so recording failed insideEmber.appwhile the mic itself opened fine —audio_levelusesRawInputStream, which has no such dependency. Hence the exact wording: "Mic opened but capture failed"._record_sounddevicenow usesRawInputStreamtoo. Tests assertsd.rec()stays out of that path and that NumPy stays excluded, so the pairing explains itself if anyone reaches forsd.rec()again.The message was also impossible to act on:
sys.executableinside the bundle is the Ember binary, not a Python anything can be installed into. The frozen build now says it's a packaging fault and points at running from source meanwhile.3. "i cannot interrupt ember in voice mode"
Stop cancelled the agent turn but never stopped speech, and left an orb conversation running — so Ember kept talking and kept listening for the next turn. The mic is deliberately closed while Ember speaks, so there was no voice route either. The one control that should have worked did not.
_on_stopnow silences TTS and ends the conversation before stopping the turn.Results
1353 passed, same 23 pre-existing environment failures.
The mouse and mic fixes are verified against stubs that reproduce the exact failure — a
pyautoguithat accepts moves and never moves anything, and asounddevicewith no NumPy. Neither has been run on a real Mac.Note on #3: this makes the Stop button work. It does not restore voice barge-in — the mic stays closed while Ember speaks, so "stop" spoken aloud still won't be heard. Keeping the mic live during TTS risks Ember hearing itself; that's a real design decision rather than a bug fix, and I haven't made it.
Generated by Claude Code