Repository navigation
fix(slm): _ssh_key_usable helper — degrade to default identity on unreadable key, warn once (#11793) - #11804
Merged
Conversation
…eadable key, warn once (#11793)
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
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.
Closes #11793
Thinking Path
Owner decision (2026-07-16): one safe helper, degrade + warn. Exhaustive grep found 9 sites gating
-i <key>on crash-pronePath(...).exists()— the 7 filed plusapi/nodes.py:2740andapi/code_sync.py:2550(the latter keeps its hard-fail semantics, message corrected "not found" → "not usable").What Changed
services/ssh_utils.py::_ssh_key_usable(path)(no existing shared ssh module fits; api modules already importservices.*): missing key → False quietly (old behavior); PermissionError/OSError → False + ONE actionable WARNING per path (module-level seen-set) → ssh falls back to default identity. Success path unchanged when the key is readable.sync_orchestrator.py,code_distributor.py,api/nodes_execution.py,api/nodes.py,api/code_sync.py.code_distributor.pybuilt-o -o ConnectTimeout=30(stray duplicate token — ssh rejects it; same bug(slm): malformed ssh command in node role-sync — stray '-o' breaks every sync ('no argument after keyword -o') #10277 bug class) — removed + regression-guarded bytest_code_distributor_ssh_argv_is_wellformed.services.ssh_utils(the AST-derived stub loop would otherwise MagicMock it truthy, silently re-adding-ieverywhere).Verification
tests/services/: 321 passed / 1 skipped / 0 failed (313 baseline + 8 new helper tests: readable/missing/unreadable/warn-once-per-path/OSError/integration on the exact bug(slm): ssh key checks crash with PermissionError when key dir unreadable — Path(SSH_KEY_PATH).exists() at 7 sites #11793 traceback site — command built WITHOUT-i, no exception, one WARNING). Independent re-run identical.api/nodes_execution_test.py149 passed. flake8 clean ×8. Full-sweep failures byte-identical to clean HEAD (cp-based revert/restore proof) — pre-existing, tracked in test(slm): whole-backend sweep RUN phase — 105 pre-existing runtime failures from sys.modules order-rot and never-run files (post-#11794) #11798.Model Used
Claude Fable 5 (subagent: general-purpose)