fix(tools): guard Path.home() against PermissionError in has_direct_modal_credentials - #33528
Merged
benbarclay merged 1 commit intoMay 29, 2026
Conversation
…odal_credentials When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
KKT-OPT
pushed a commit
to KKT-OPT/hermes-agent
that referenced
this pull request
May 31, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
alt-glitch
pushed a commit
that referenced
this pull request
Jun 14, 2026
…odal_credentials (#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes #33525
T02200059
pushed a commit
to T02200059/hermes-agent
that referenced
this pull request
Jun 18, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
xyshanren
pushed a commit
to xyshanren/hermes-agent-cn
that referenced
this pull request
Jun 25, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
donbowman
pushed a commit
to donbowman/hermes-agent
that referenced
this pull request
Jul 13, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…odal_credentials (NousResearch#33528) When HOME=/root (Docker containers) and the process runs as unprivileged user (hermes, uid 10000), Path.home() / '.modal.toml' raises PermissionError because /root/ is inaccessible. This crashes the dashboard /api/skills endpoint. Catch PermissionError/OSError and treat as 'no config file'. Env vars still take priority (tested). Fixes NousResearch#33525
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 does this PR do?
Guards
Path.home() / ".modal.toml"inhas_direct_modal_credentials()againstPermissionError(andOSError).When Hermes runs in Docker containers with
HOME=/rootbut the process is the unprivilegedhermesuser (uid 10000),Path.home()resolves to/root/. Calling.exists()on a path under/root/raisesPermissionError: [Errno 13] Permission denied: '/root/.modal.toml'. This crashes the dashboard/api/skillsendpoint.Why
The
has_direct_modal_credentials()function is called during skills page load (line 4479 inweb_server.py) to evaluate tool requirements. In Docker, the dashboard service inheritsHOME=/rootfrom the container environment but runs ashermesuser who can't read/root/.Changes
tools/tool_backend_helpers.py(1 file):Path.home() / ".modal.toml"intry/except (PermissionError, OSError)tests/tools/test_tool_backend_helpers.py(1 file):test_home_dir_permission_denied: verifiesPermissionErrorreturnsFalsewhen no env vars settest_home_dir_permission_denied_with_env_vars: verifies env vars still work whenPath.home()raisesTesting
All 49 tests in
test_tool_backend_helpers.pypass, including the 2 new ones:test_home_dir_permission_denied—PermissionError→False(no env vars)test_home_dir_permission_denied_with_env_vars—PermissionError→True(env vars set)Related
Fixes #33525
Code Intelligence
tools/tool_backend_helpers.py:has_direct_modal_credentials(callers: web_server.py skills endpoint, test_tool_backend_helpers.py, test_nous_subscription.py)Path.home()usage in Docker containers with mixed user contexts