Add plan-mode endpoint: POST /api/chat {mode:'plan'} (#27) #61

Closed
will.anderson wants to merge 1 commits from feat/plan-mode-endpoint into main
Owner

Closes #27 item 2

What

Adds a mode: "plan" path to POST /api/chat:

POST /api/chat { "message": "<task>", "mode": "plan" }
→ { "plan": { "steps": [{"id":"s1","title":"...","detail":"..."},...] }, "model": "..." }

How

  • chat.el: handle_chat_plan(body) — single LLM call with a structured planning prompt. No tool calls. No state mutation. Grounded by Engram context for the message.
  • routes.el: all /api/chat handlers now check mode == "plan" before the agentic flag, routing to the new handler.

Why

The agent panel (neuron-ui feat/agent-panel) has a "Plan before running" toggle. When on, the panel sends {mode:"plan"} first, shows the step list, user edits/approves, then the real agentic request fires. This is the soul-side contract for that feature.

Deployment note

dist/soul.c regeneration needed to ship (standard dist refresh — same flow as prior soul releases).

Closes #27 item 2 ## What Adds a `mode: "plan"` path to `POST /api/chat`: ``` POST /api/chat { "message": "<task>", "mode": "plan" } → { "plan": { "steps": [{"id":"s1","title":"...","detail":"..."},...] }, "model": "..." } ``` ## How - **`chat.el`**: `handle_chat_plan(body)` — single LLM call with a structured planning prompt. No tool calls. No state mutation. Grounded by Engram context for the message. - **`routes.el`**: all `/api/chat` handlers now check `mode == "plan"` before the `agentic` flag, routing to the new handler. ## Why The agent panel (neuron-ui feat/agent-panel) has a "Plan before running" toggle. When on, the panel sends `{mode:"plan"}` first, shows the step list, user edits/approves, then the real agentic request fires. This is the soul-side contract for that feature. ## Deployment note `dist/soul.c` regeneration needed to ship (standard dist refresh — same flow as prior soul releases).
will.anderson added 1 commit 2026-06-28 19:23:56 +00:00
Add plan-mode endpoint to agentic path
Neuron Soul CI / build (pull_request) Has been cancelled
9aa8db1362
POST /api/chat {mode:'plan'} returns a structured step list from the LLM
without executing any tools. The client can show and edit this plan before
sending the real agentic request.

Implements issue #27 item 2 (Agent panel soul contract — plan mode).
will.anderson closed this pull request 2026-06-29 13:18:25 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
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#61