|
Add per-user filesystem sandbox via current_user_id ContextVar
- tools/base.py: add current_user_id ContextVar (set by Agent before every tool call, cleared after) - core/agent.py: set current_user_id in run_stream from session.user_id and in run_ephemeral from parent_session.user_id; restore in finally - tools/filesystem.py: _check_path resolves all paths inside user_data/<user_id>/ when current_user_id is present; legacy mode (no user_id) falls back to FS_ALLOWED_PATHS - tools/share_file.py: validate source path is inside user sandbox Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
|---|
|
|
| navi/core/agent.py |
|---|
| navi/tools/base.py |
|---|
| navi/tools/filesystem.py |
|---|
| navi/tools/share_file.py |
|---|