Repository navigation
fix: preserve redirected SSH failure diagnostics - #132
Merged
Merged
Conversation
Signed-off-by: Asahi Arataki <[email protected]>
TMHSDigital
added a commit
to laozhej/Home-Lab-Developer-Tools
that referenced
this pull request
Nov 18, 2026
Resolve conflicts with TMHSDigital#132 by keeping both changelog entries and both test imports. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: TM Hospitality Strategies <[email protected]>
1 task
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.
What changed
Failed SSH commands now use the captured stdout tail when stderr is empty or whitespace-only, preserving diagnostics from commands using
2>&1. Stderr still takes precedence, both streams retain the existingHOMELAB_MAX_OUTPUT_BYTESbound, and signal failures retain their diagnostic too.homelab_systemdServicesreturns the status text for a requested unit whensystemctl statusexits 3. Other exit codes and failures while listing units remain errors.homelab_certChecknow includes its certificate-retrieval explanation and the original command diagnostic when the OpenSSL pipeline fails.Why
Fixes #113. Redirected output was discarded on failure, leaving callers with only an exit code. The two affected handlers also skipped their useful status or fallback output. The systemctl behavior follows its documented exit statuses.
Type
Testing
cd mcp-server && npm run build && npm testpasses: 329 tests passed, 10 live-Pi tests skipped on Node 22.23.0.pytest tests/ -v --tb=shortpasses: 273 tests on Python 3.15.2.Six regression checks fail before the fix and pass after. Tests cover stdout-only errors, whitespace-only stderr, bounded output, stderr precedence, empty output, signal failures, inactive and missing units, list failures, certificate failures, and unrelated SSH errors.
git diff --checkpasses.Checklist
Prepared with OpenAI Codex assistance. The commit includes the required DCO sign-off. This branch is independent of #131.
Hosted CI currently requires maintainer approval for this fork contribution (MCP Server CI run); the build/test jobs have not run on GitHub yet. Results above are local.