Skip to content

Fix first-run microphone config setup - #12

Open
psremilio wants to merge 2 commits into
dot-Justin:mainfrom
psremilio:codex/first-run-config-setup
Open

Fix first-run microphone config setup#12
psremilio wants to merge 2 commits into
dot-Justin:mainfrom
psremilio:codex/first-run-config-setup

Conversation

@psremilio

@psremilio psremilio commented Jun 24, 2026

Copy link
Copy Markdown

Fixes #7.

Summary

  • Resolve microphone config loading and saving to the repository-root mic_config.json, with a BONZI_MIC_CONFIG override path available for tests or custom installs.
  • Treat missing, invalid, or old mic_index configs as first-run setup instead of crashing or silently using a checked-in per-machine value.
  • Stop tracking the generated local mic_config.json and ignore local config, env, and Python cache files.
  • Load helpers/.env explicitly and clarify the first-run setup/reset steps in the README.
  • Add focused unittest coverage for missing config, override config path, invalid JSON, legacy config shape, and save/load round trips.

Verification

  • python -m unittest discover -s tests (6 tests)
  • python -Wall -m py_compile main.py helpers\mic.py helpers\llm.py helpers\tts.py tests\test_mic_config.py
  • python -c "from helpers import mic; print(mic.DEFAULT_CONFIG_FILE); print(mic.load_config())"
  • git diff --check origin/main...HEAD

I did not run a live microphone smoke test in this environment because PyAudio/audio hardware is not available here.

Copy link
Copy Markdown
Author

/claim #7

Claiming the Opire reward for this PR.

This PR fixes the first-run setup problem by:

  • resolving microphone config to the repository-root mic_config.json
  • treating missing, invalid, or legacy mic_index config as first-run setup
  • removing the checked-in local mic_config.json and ignoring generated local config/env/cache files
  • loading helpers/.env explicitly
  • adding focused unittest coverage for missing config, invalid JSON, legacy config, and save/load round trips

Verified locally:

  • python -m unittest discover -s tests
  • python -Wall -m py_compile main.py helpers\mic.py helpers\llm.py helpers\tts.py tests\test_mic_config.py
  • python -c "from helpers import mic; print(mic.DEFAULT_CONFIG_FILE); print(mic.load_config())"
  • git diff --check origin/main...HEAD

@opirebot

opirebot Bot commented Jun 25, 2026

Copy link
Copy Markdown

👀 We've notified the reward creators here.
Make sure your payment account is ready to receive the payment for your hard work 💪

Copy link
Copy Markdown
Author

Follow-up on current head 5e8328006537038162a1ace9fd00f09b60be2d0b:

  • Added focused coverage for the BONZI_MIC_CONFIG override path so the documented custom config path is tested end to end.
  • Re-ran local verification:
    • python -m unittest discover -s tests (6 tests)
    • python -Wall -m py_compile main.py helpers\mic.py helpers\llm.py helpers\tts.py tests\test_mic_config.py
    • python -c "from helpers import mic; print(mic.DEFAULT_CONFIG_FILE); print(mic.load_config())"
    • git diff --check origin/main...HEAD

GitHub currently reports no Actions/check runs for this repo/commit, and PR #12 is mergeable against main.

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.

I am confused (help) I did everthing ready but this feels like a flipped slide

2 participants