propose(agentic): read agent_workspace_root from request body (wire UI to merged #23) #28
Reference in New Issue
Block a user
Delete Branch "propose/agent-workspace-root-read"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Proposal (for Will's review — please do not merge without sign-off)
Completes the UI↔soul contract for #23 (scope file/command tools to an agent workspace root), which is already merged to
main.The gap
#23 made the path/command tool guards read the root from
state_get("agent_workspace_root")(or envNEURON_AGENT_ROOT). But nothing in the desktop UI ever set that state key —WorkspaceStorehad deferred the push to "Phase 2 when #23 lands." #23 landed; the wiring didn't. Result: the agent panel's Workspace Folder is cosmetic — the user picks "Documents" expecting confinement, but with no root set the soul takes the default-allow path and file/command tools run unscoped.The existing
/api/neuron/config/tuneendpoint can't fix this UI-side: it writesConfigEntryengram nodes, a different store than the in-memory statestate_getreads.This change (11 lines,
chat.el)At the top of
handle_chat_agentic, readagent_workspace_rootfrom the request body andstate_setit before tool dispatch. Mirrors the existingjson_get+state_setpattern used throughout the file. Empty field ⇒ unscoped (backward-compatible) and still falls through to theNEURON_AGENT_ROOTenv.Pairs with
neuron-ui PR #32 —
ChatRequest.agentWorkspaceRoot→ bodyagent_workspace_root, sent on every agentic send (state.workspaceRoot).Review questions for you
cdout). This PR doesn't change that — it just makes the (soft) scope actually engage. Want the real confinement (cwd-locked exec /sandbox-exec) tracked separately?No rush / not a blocker for the Windows build — surfacing it because the UI now advertises a workspace boundary that isn't enforced until this lands.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.