Skip to content

fix(slm): _ssh_key_usable helper — degrade to default identity on unreadable key, warn once (#11793) - #11804

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
issue-11793
Jul 16, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
issue-11793

Conversation

@mrveiss

@mrveiss mrveiss commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Closes #11793

Thinking Path

Owner decision (2026-07-16): one safe helper, degrade + warn. Exhaustive grep found 9 sites gating -i <key> on crash-prone Path(...).exists() — the 7 filed plus api/nodes.py:2740 and api/code_sync.py:2550 (the latter keeps its hard-fail semantics, message corrected "not found" → "not usable").

What Changed

  • New services/ssh_utils.py::_ssh_key_usable(path) (no existing shared ssh module fits; api modules already import services.*): 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.
  • 9 sites migrated across sync_orchestrator.py, code_distributor.py, api/nodes_execution.py, api/nodes.py, api/code_sync.py.
  • Adjacent real bug fixed in-scope: code_distributor.py built -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 by test_code_distributor_ssh_argv_is_wellformed.
  • Conftest: root conftest real-loads services.ssh_utils (the AST-derived stub loop would otherwise MagicMock it truthy, silently re-adding -i everywhere).

Verification

Model Used

Claude Fable 5 (subagent: general-purpose)

@github-actions

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss
mrveiss merged commit 6c51fa8 into Dev_new_gui Jul 16, 2026
37 of 38 checks passed
@mrveiss
mrveiss deleted the issue-11793 branch July 16, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant