{ "permissions": { "allow": [ "Bash(uv run ruff:*)", "Bash(uv run black:*)", "Bash(uv run mypy:*)", "Bash(uv run pytest:*)", "Bash(git checkout:*)", "Bash(git add:*)", "Bash(git commit:*)", "Bash(git push:*)", "Bash(gh pr create --title \"fix: prevent UnboundLocalError when large recordings are skipped\" --body \"$\\(cat <<''EOF''\n## Summary\n- Fixed crash occurring when recordings >100MB were encountered\n- Resolved `UnboundLocalError: cannot access local variable ''file_name''` that was causing daily service crashes\n\n## Root Cause\nWhen a recording file exceeded 100MB:\n1. `get_recorded_file\\(\\)` returned `None` \\(line 439 in amcrest_api.py\\)\n2. `store_recording_in_media\\(\\)` skipped the entire `if recording:` block where `file_name` was defined\n3. The function attempted to return undefined `file_name` variable \\(line 293\\)\n4. This triggered `UnboundLocalError` and crashed the main event loop\n\n## Changes\n- Moved `return file_name` inside the `if recording:` block at [helpers.py:293]\\(https://github.com/weirdtangent/amcrest2mqtt/blob/fix/unbound-local-error-file-name/src/amcrest2mqtt/mixins/helpers.py#L293\\)\n- Added explicit `return None` for when recording is skipped\n\n## Test Plan\n- [x] Ruff linting passes\n- [x] Black formatting passes\n- [x] Mypy type checking passes\n- [ ] CI/CD checks pass \\(pending\\)\n\n## Related Issue\nFixes the daily crashes caused by VideoBlind events generating large recordings that are skipped.\n\n🤖 Generated with [Claude Code]\\(https://claude.com/claude-code\\)\nEOF\n\\)\")", "Bash(mypy:*)", "Bash(gh pr create --title \"fix: use pattern matching for camera model validation\" --body \"$\\(cat <<''EOF''\n## Summary\n- Changed camera model validation from exact string matching to pattern-based matching using `startswith\\(\\)`\n- Supports any suffix variant \\(B/W/E/EB/EW, etc.\\) for all base camera models\n- Fixes issue where IP4M-1041W was rejected because only IP4M-1041B was in the allowlist\n\n## Test plan\n- [ ] Verify IP4M-1041W camera is now recognized\n- [ ] Verify existing cameras \\(IP4M-1041B, IP3M-956E, etc.\\) still work\n- [ ] Check CI/CD passes \\(ruff, black, mypy\\)\n\n🤖 Generated with [Claude Code]\\(https://claude.com/claude-code\\)\nEOF\n\\)\")", "Bash(git stash:*)", "Bash(git pull:*)", "Bash(git stash pop:*)", "Bash(gh pr create:*)" ] } }