Make action_dir editable in Settings UI (currently env/TOML only)
Summary
Expose Config.action_dir in the Settings UI as an editable path, so users can relocate the action sandbox without editing config.toml or restarting with OPENHUMAN_ACTION_DIR. PR #3074 introduced the field but left it configurable only via env var / TOML.
Problem
PR #3074's description implies the Action Sandbox is user-configurable, but AgentAccessPanel.tsx (and surrounding Settings panels) only display the action path — no input control, no RPC to update. The only ways to change it today:
- Set
OPENHUMAN_ACTION_DIR=/custom/pathbefore launching the desktop app. - Edit
~/.openhuman/users/<id>/config.tomland restart.
Neither is discoverable from the UI. Users who keep their code on an external drive, want per-project sandboxes, or share a host machine cannot move the action sandbox through the supported product surface.
Related: this is also a prerequisite for the panel showing a meaningful path to the user (see #3237 — the audit follow-up that makes the panel read live values). Editability sits on top of that work.
Solution (optional)
- Add an "Action sandbox path" row in
AgentAccessPanel(app/src/components/settings/panels/AgentAccessPanel.tsx) with a text input + folder-picker (Tauridialog::openwithdirectory: true). - Add an RPC like
config.set_action_dir(path)insrc/openhuman/config/that validates: directory exists or can be created, not underworkspace_dir, not underforbidden_paths, agent has permission to write there. - On save: persist to
config.toml, swap the liveSecurityPolicy(the existingsecurity::live_policypattern), and broadcast aDomainEventso other surfaces refresh. - Show validation errors inline (path collides with internal workspace, etc.).
- Keep
OPENHUMAN_ACTION_DIRas an env override that wins over the persisted value (consistent with the existing env-as-config pattern).
Acceptance criteria
- [ ]
config.set_action_dirRPC — validates path, writesconfig.toml, swaps live policy. - [ ] Settings input —
AgentAccessPanelhas an editable path field with folder picker. - [ ] Validation — rejects paths under
workspace_dir, underforbidden_paths, or non-creatable; surfaces a clear error. - [ ] Hot apply — change takes effect in the running session without restart (new agent turns use the new path).
- [ ] Env override precedence preserved —
OPENHUMAN_ACTION_DIRstill wins; UI shows it as "(overridden by env)" and disables editing. - [ ] Tests — Vitest component test for the input + validation feedback; Rust unit test for the RPC validating allow/deny cases; integration test that a tool run after
set_action_dirwrites to the new path. - [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by
.github/workflows/pr-ci.yml).
Related
- Parent issue: #3051
- Implementing PR: #3074
- Depends on (or coordinates with): #3237 — live path display in
AgentAccessPanel. - Audit: gap #6 — beyond the strict acceptance criteria of #3051 but called out in the PR description, so worth closing the loop.
- Relevant code:
app/src/components/settings/panels/AgentAccessPanel.tsx,src/openhuman/config/,src/openhuman/security/live_policy.