Skip to content

fix(agent): catch RuntimeError from expanduser() with ~nonexistent_user (#43963) - #44056

Closed
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-43963
Closed

fix(agent): catch RuntimeError from expanduser() with ~nonexistent_user (#43963)#44056
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-43963

Conversation

@kyssta-exe

Copy link
Copy Markdown
Contributor

Fixes #43963. Path.expanduser() raises RuntimeError (not OSError/ValueError) when a ~user token references a non-existent account via passwd lookup. Added RuntimeError to the except tuple in _add_path_candidate so it degrades gracefully instead of crashing the agent turn.

…er (NousResearch#43963)

Path.expanduser() raises RuntimeError (not OSError/ValueError) when
a ~user token references a non-existent account (passwd lookup fails).
Add RuntimeError to the except tuple so _add_path_candidate degrades
gracefully instead of crashing the agent turn.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists labels Jun 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #29433 — same fix: add RuntimeError to the except in _add_path_candidate (agent/subdirectory_hints.py) so ~nonexistent_user expanduser() no longer aborts the turn. #29433 is the earliest open PR (sibling #43970 also fixes #43963).

@kyssta-exe

Copy link
Copy Markdown
Contributor Author

Duplicate of #29433 — same RuntimeError catch for expanduser with nonexistent user (#43963). Closing as superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: _add_path_candidate crashes the agent turn on ~user expanduser() RuntimeError (except misses RuntimeError)

2 participants