fix(sessions): unify dual suspension systems, wire approve to agentic_resume #18

Open
will.anderson wants to merge 1 commits from fix/agentic-tool-approval-unification into main
Owner

Unifies the two separate suspension systems so tool approval works for all modern agentic_loop sessions.

Unifies the two separate suspension systems so tool approval works for all modern agentic_loop sessions.
will.anderson added 1 commit 2026-06-15 18:04:58 +00:00
fix(sessions): unify dual suspension systems in handle_session_approve
Neuron Soul CI / build (pull_request) Failing after 11m26s
7c7dc310a0
The approve endpoint was permanently broken for all sessions going through
the modern agentic_loop path. agentic_loop suspends via bridge_save() into
mcp_bridge:<session_id>, but handle_session_approve was reading from
pending_tool_<session_id> — a different key — so it always returned
"no pending tool for session".

Replace the body of handle_session_approve with a two-path design:

Modern path: check mcp_bridge:<session_id> first. If the blob is there,
dispatch_tool() on allow (or build the denial string), then delegate to
agentic_resume() which re-enters agentic_loop from the exact suspension
point. This is the path all live sessions take.

Legacy path: if only pending_tool_<session_id> exists (in-flight session
from before this deploy), synthesise a bridge blob from the stored
messages_so_far and route through agentic_resume() as well. The stale
inline agentic loop (90 lines, agentic_tools_literal only, no MCP
connector support, no bridge suspension) is removed entirely.

routes.el already calls handle_session_approve correctly — no change needed.
Some required checks failed
Neuron Soul CI / build (pull_request) Failing after 11m26s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/agentic-tool-approval-unification:fix/agentic-tool-approval-unification
git checkout fix/agentic-tool-approval-unification
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: neuron-technologies/neuron#18