loop: shared bounded-turn core accepts history + knobs (ServeTurn)

Turn machinery refactored so the upcoming serve front door reuses it
instead of copying it: the round loop is now runTurn over arbitrary
message history with an optional tool palette and forwarded max_tokens/
temperature. The serve path (ServeTurn) is stateless chat over client
history with tools hard-off: a tool call the model produces anyway is
refused as a tool result, never executed. Also exposes the model router
(so serve can build its catalog) and a sorted class list; llm requests
can now carry temperature.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
This commit is contained in:
2026-08-29 01:07:47 -05:00
parent 2901bb8cae
commit 8614827d44
5 changed files with 242 additions and 13 deletions
+3
View File
@@ -50,6 +50,9 @@ type ChatRequest struct {
Messages []Message `json:"messages"`
Tools []Tool `json:"tools,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
// Temperature is optional sampling heat; nil = provider default.
// Forwarded as-is (the serve front door passes the client's value).
Temperature *float64 `json:"temperature,omitempty"`
}
type ChatResponse struct {