openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

AgentAccessPanel should display live action_dir and workspace_dir via RPC

Open CodeGhost21 opened this issue 6 months ago • 0 comments

Summary

Make AgentAccessPanel show the live Config.action_dir and workspace_dir values via RPC, instead of hard-coding the default strings ~/OpenHuman/projects and ~/.openhuman/workspace. Users who set OPENHUMAN_ACTION_DIR (or change the path in config.toml) currently see a Settings panel that misrepresents where the agent will actually write.

Problem

#3051 acceptance criterion 4: "~/OpenHuman/projects (trusted root) and per-user actions/ relationship is documented; Settings → Agent access reflects both."

PR #3074 added a "Directories" section to app/src/components/settings/panels/AgentAccessPanel.tsx:322-363 showing:

  • Action sandbox (read+write) — hard-coded as ~/OpenHuman/projects
  • Internal state (agent-blocked) — hard-coded as ~/.openhuman/workspace

with full i18n in all 14 locales. The split is communicated, which is good. But the strings are literals, not values read from the core. If a user (or operator) sets OPENHUMAN_ACTION_DIR=/custom/path, the panel still claims ~/OpenHuman/projects — actively misleading.

Who it hurts:

  • Users who relocate the action sandbox for disk-space or per-project reasons.
  • Operators of the staging / docker / multi-tenant setups where action dirs are non-default.
  • Anyone debugging "why did the agent write to X" — Settings is the natural first stop and currently lies.

Solution (optional)

  • Add an RPC like config.get_paths returning { action_dir, workspace_dir, projects_dir } (or expose them in the existing fetchCoreAppSnapshot payload — CoreStateProvider already pulls a snapshot at boot).
  • Have AgentAccessPanel read those values and render them; fall back to the hard-coded defaults only if the RPC isn't available.
  • Update i18n strings so the path is a {path} substitution, not embedded in the translated phrase.

Acceptance criteria

  • [ ] RPC or snapshot field — core exposes action_dir / workspace_dir / projects_dir to the frontend (path strings).
  • [ ] Panel renders live paths — AgentAccessPanel displays the value returned by the core, not a hard-coded string.
  • [ ] i18n uses {path} substitution — translations include a placeholder for the path, so paths aren't baked into translated text.
  • [ ] Override is reflected — setting OPENHUMAN_ACTION_DIR=/tmp/custom-actions and restarting shows /tmp/custom-actions in the panel.
  • [ ] Tests — Vitest component test for the panel asserting the rendered string matches the RPC payload, including an override scenario.
  • [ ] 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
  • Audit: this is gap #3 (criterion 4, "Projects alignment") — verdict PARTIAL.
  • Relevant code: app/src/components/settings/panels/AgentAccessPanel.tsx:322-363, app/src/lib/i18n/*.ts (directories block), src/openhuman/config/ for the RPC source.

CodeGhost21 avatar Jun 02 '26 21:06 CodeGhost21