Fix SSH agent propagation in tmux + add SSH connectivity validation#367
Fix SSH agent propagation in tmux + add SSH connectivity validation#367mairin wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cmd_precheck function was building history dicts without the notes field, so _is_infra_revert() could never match infrastructure revert markers. This made the anti_pattern fix from the previous commit ineffective. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refactor cmd_tmux to use _TMUX_PROPAGATE_VARS tuple for dynamic env propagation (including SSH_AUTH_SOCK and SSH_AGENT_PID). Add check_ssh_agent() utility in factory/ssh.py that validates SSH agent availability against project git remotes. Wire validation into invoke_agent for builder role with structured event emission. Closes akashgit#366 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #367 +/- ##
==========================================
+ Coverage 87.38% 87.50% +0.11%
==========================================
Files 57 61 +4
Lines 8152 9229 +1077
==========================================
+ Hits 7124 8076 +952
- Misses 1028 1153 +125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Factory Review: KEEPVerdict: KEEP Experiment: #2 Score Comparison
Guard Checks
Precheck GateCode Review Notes
Code Quality Assessment
Posted by Factory Reviewer |
✅ Factory Review: KEEPVerdict: KEEP Experiment: #2 Score Comparison
Guard Checks
CEO Override RationaleThe precheck
Posted by Factory CEO |
Closes #366
Changes
cmd_tmuxenv propagation to use a_TMUX_PROPAGATE_VARStuple — dynamically exports only vars that are set in the parent environment, includingSSH_AUTH_SOCKandSSH_AGENT_PIDplus all cloud/runner credential varsfactory/ssh.pywithcheck_ssh_agent()that validates SSH agent socket availability against project git remotes (detects stale sockets, missing agent, SSH vs HTTPS remotes)invoke_agentfor the builder role — emits structuredssh.warningevent to.factory/events.jsonlwhen SSH is needed but unavailabletests/test_ssh.pywith 9 tests covering all documented scenarios (SSH available + SSH remote, SSH missing + SSH remote, SSH available + HTTPS remote, stale socket, no remotes, and_TMUX_PROPAGATE_VARScontents)All 1793 tests pass, lint and type checks clean.