Repository navigation
Conversation
scene save ignored GetVolume and GetMute errors and stored the zero values. A later apply would turn that room down and unmute it. Return the read error and leave the saved scene unchanged. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR stops scene saving when a room's volume or mute read fails, preserving previously saved scenes. Example: Kitchen's GetVolume request times out during
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a concrete bug still present in main and v0.3.5: failed audio reads can overwrite a scene with incorrect values; no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe scene CLI reads topology and per-room audio settings through the Sonos client, stores a named JSON snapshot, and later restores its grouping, volume, and mute values. flowchart TD
A[Scene save command] --> B[Discover visible rooms]
B --> C[Read volume and mute]
C --> D[Return room error]
C --> E[Store complete scene]
E --> F[Scene apply command]
F --> G[Restore speaker settings]
Technical reviewBest possible solution: Keep the focused error checks in the existing scene-save owner so only complete, successfully read snapshots reach storage. Do we have a high-confidence way to reproduce the issue? The source establishes the failure path: Sonos read errors return 0 or false, main ignores those errors, and scene apply later restores those values; no target code was executed during this read-only review. Is this the best way to solve the issue? Returning before the existing persistence call fixes the reported read-error bug without adding another owner, changing the scene format, or rejecting a legitimate volume of 0. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 63f57580a780. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 6, 2026, 1:46 PM ET / 18:46 UTC. |
|
Thanks for finding and fixing this. Consolidated into #35 with your authorship credit, regression tests, compatible dependency updates and actual CLI/transport proof. The recorded Linux run covers preservation of v0.3.5 scenes, each speaker failure, successful zero volume and safe queue recovery. Closing this copy to keep one candidate for CI and landing. |
What Problem This Solves
sonos scene saveread each room's volume and mute and ignored the errors. The zero values are volume 0 and mute off. The command still stored the scene and reported success. A laterscene applywould turn that room down and unmute it.A volume that the speaker really reports as 0 is still stored.
Evidence
Before this change,
scene save Morningwith the KitchenGetVolumecall returningtimeoutfinished with no error:The same happened when
GetMutefailed. After this change, that save returns the read error and does not write the scene. A Living Room that reports volume 0 still saves.Real behavior proof
/tmp/pr-wave/sonoscli-f001at3067e5ce1f67. No Sonos speaker was on the network. The CLI command ran with a speaker client whose read returnedtimeout.go test -count=1 -v -run 'TestSceneSaveDoesNotStoreZeroWhenLevelReadFails|TestSceneSaveKeepsAReportedZeroVolume' ./internal/cli/Description
scene savereturnsget volume for <room>orget mute for <room>and leaves the previous scene file unchanged.