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).
This commit is contained in:
@@ -229,7 +229,10 @@ fn handle_dharma_recv(body: String) -> String {
|
||||
}
|
||||
let agentic_flag: Bool = json_get_bool(eff_payload, "agentic")
|
||||
let raw_msg: String = json_get(chat_body, "message")
|
||||
let reply: String = if agentic_flag {
|
||||
let req_mode: String = json_get(chat_body, "mode")
|
||||
let reply: String = if str_eq(req_mode, "plan") {
|
||||
handle_chat_plan(chat_body)
|
||||
} else if agentic_flag {
|
||||
handle_chat_agentic(chat_body)
|
||||
} else {
|
||||
let screened_reply: String = layered_cycle(raw_msg)
|
||||
@@ -391,7 +394,10 @@ fn handle_request(method: String, path: String, body: String) -> String {
|
||||
return "{\"error\":\"message is required\",\"code\":\"missing_param\"}"
|
||||
}
|
||||
let agentic_flag: Bool = json_get_bool(body, "agentic")
|
||||
let reply: String = if agentic_flag {
|
||||
let req_mode: String = json_get(body, "mode")
|
||||
let reply: String = if str_eq(req_mode, "plan") {
|
||||
handle_chat_plan(body)
|
||||
} else if agentic_flag {
|
||||
handle_chat_agentic(body)
|
||||
} else {
|
||||
let screened_reply: String = layered_cycle(eff_msg)
|
||||
@@ -540,7 +546,10 @@ fn handle_request(method: String, path: String, body: String) -> String {
|
||||
return "{\"error\":\"message is required\",\"code\":\"missing_param\"}"
|
||||
}
|
||||
let agentic_flag: Bool = json_get_bool(body, "agentic")
|
||||
let reply: String = if agentic_flag {
|
||||
let req_mode: String = json_get(body, "mode")
|
||||
let reply: String = if str_eq(req_mode, "plan") {
|
||||
handle_chat_plan(body)
|
||||
} else if agentic_flag {
|
||||
handle_chat_agentic(body)
|
||||
} else {
|
||||
let screened_reply: String = layered_cycle(raw_msg)
|
||||
|
||||
Reference in New Issue
Block a user