fix(cli): report passwordless sudo in status - #18315
Conversation
|
Related to #12431 (same scope — sudo status display when env var is empty/unset). This PR supersedes it with a full sudo -n probe approach. |
|
Related to #12431 |
|
Rebased this PR onto the current Verification on the refreshed branch:
I also reproduced those same 6 failures in a clean worktree at current |
|
Refreshed this PR onto the current Verification on the refreshed branch:
So this PR-specific change is still green on its relevant status coverage, while the remaining red checks I sampled are baseline failures on current |
…s-passwordless-sudo
|
Refreshed this PR onto the current What I changed:
Verification on the refreshed branch:
Codex was attempted first for repo-safe PR review, but it hit sandbox / CA-bundle workspace failures and could not inspect the checkout, so Hermes handled the fallback and branch refresh directly. I’ve pushed the refreshed branch, so CI should rerun against the current base. |
…tus-passwordless-sudo
|
Refreshed this PR onto the current What I changed:
Verification on the refreshed branch:
Codex was attempted first for repo-safe PR review, but it hit the known sandbox / CA-bundle workspace failures and could not inspect the checkout, so Hermes handled the fallback refresh and verification directly. |
|
One more note from the refreshed CI rerun: |
…tus-passwordless-sudo
|
Refreshed this PR onto the current What I changed:
Verification on the refreshed branch:
Codex was attempted first for repo-safe PR review, but it hit the known sandbox / CA-bundle workspace failures and could not inspect the checkout, so Hermes handled the fallback refresh and verification directly. I’ve pushed the refreshed branch, so CI should rerun against the current base. |
|
Refreshed this PR onto the current What I changed:
Why this run was actionable:
Verification on the refreshed branch:
Codex was attempted first for repo-safe PR review, but it hit the known workspace / CA-bundle sandbox failures ( |
…tus-passwordless-sudo
|
Refreshed this PR onto the current What I changed:
Why this run was actionable:
Verification on the refreshed branch:
Codex was attempted first for repo-safe diagnosis, but it hit the known workspace / CA-bundle sandbox failures ( CI should rerun now against the current base. |
…tus-passwordless-sudo # Conflicts: # tests/hermes_cli/test_status.py
…tus-passwordless-sudo
…tus-passwordless-sudo
|
Refreshed this PR onto the current What I changed:
Why this run was actionable:
Verification on the refreshed branch:
Push / CI verification:
Codex was attempted first for repo-safe PR review, but it hit the known workspace / CA-bundle sandbox failures ( |
…tus-passwordless-sudo
|
Refreshed this PR onto the current What I changed:
Why this run was actionable:
Verification on the refreshed branch:
Push / CI verification:
Codex was attempted first for repo-safe PR inspection, but it hit the known hidden-workspace / CA-bundle sandbox failures ( |
…tus-passwordless-sudo
|
Refreshed this PR onto the current What I changed:
Why this run was actionable:
Verification on the refreshed branch:
Push / CI verification:
Codex was attempted first for repo-safe PR inspection, but it hit the known hidden-workspace / CA-bundle sandbox failures ( |
…tus-passwordless-sudo
|
Synced this PR branch with the latest What I checked:
Local verification after the refresh:
Those all passed locally, and fresh checks are now queued on the updated PR head. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing the missing local sudo-status signal. The current-main premise is valid: hermes_cli/status.py:429-430 still treats only SUDO_PASSWORD as enabled.
Problems
hermes_cli/status.py:107probes the host process unconditionally even though the status view has already selected a terminal backend athermes_cli/status.py:411-415. The existing terminal contract explicitly limits this probe tolocalbecause Docker/SSH/Modal/etc. must not inherit host sudo state (tools/terminal_tool.py:680-703), with a regression test attests/tools/test_terminal_tool.py:179-187.
Suggested changes
- Gate this detection to the local backend (or present remote availability as unknown rather than using the host result), and add a status test that a remote backend does not call the host sudo probe.
Automated hermes-sweeper review.
| ) | ||
| except Exception: | ||
| return False, "disabled" | ||
|
|
There was a problem hiding this comment.
This host subprocess probe needs a TERMINAL_ENV == "local" guard. tools/terminal_tool.py:680-703 deliberately forbids inheriting host sudo state for Docker/SSH/Modal/etc.; otherwise this status row can describe the host rather than the configured execution backend.
|
Addressed the sweeper feedback about remote terminal backends inheriting host sudo state.\n\nWhat changed:\n- |
Summary
sudo -n trueprobe whenSUDO_PASSWORDis unsetVerification
scripts/run_tests.sh tests/hermes_cli/test_status.py tests/hermes_cli/test_status_model_provider.py tests/cli/test_cli_status_command.pyCloses #18110