Repository navigation
Accept exit-zero commands with stderr and add debug stderr details - #126
Merged
Merged
Conversation
…d compatible GitHub CLI
pponce
marked this pull request as ready for review
October 13, 2026 16:11
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.
ON/OFF commands can operate a device and update its state file successfully, yet Script2 reports a HomeKit error whenever stderr is nonempty. This can produce the scene/Siri failure and switch flicker reported in #125.
Treat ON/OFF and stateless trigger commands as successful when execution completes without an error, even with stderr. Nonzero exits, timeouts, termination, and output overflow still fail. The state-script
fail_on_state_exit_codebehavior from #29 remains unchanged, including its default use of usable stdout after an ordinary nonzero exit.Log a warning for nonblank stderr at the normal log level. Homebridge debug logs show stderr for ON, OFF, trigger, and state commands, capped at 4,096 characters and escaped to prevent control characters from injecting log entries. Raw commands and stdout remain omitted. Document that debug stderr can include sensitive script output and should be redacted before sharing.
Validation: all 49 runtime tests pass, including 14 new regressions and real child processes that write stderr while creating/deleting a state file; installed file-watcher test passes; all JavaScript syntax, package-content checks, and publisher regressions pass. Full
npm test/npm run checkare blocked locally because the environment denies npm-registry downloads for the existing Ajv dependency; GitHub CI still needs to run those checks. UI and configuration schema are unchanged.Related to #125; the reporter's stderr hypothesis still needs confirmation.