Add Calibrate AI Control UI and fleet LLM backend wiring.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Operators toggle Logic gates vs AI Control on Settings, refresh local Ollama models, and save ai_endpoint settings via Calibrate PUT; server scheduler and agent snapshot/command paths support stateless 60s fleet decisions.
This commit is contained in:
AetherForge
2026-06-07 02:14:28 -07:00
parent 34afa28f81
commit 0002e5fd93
33 changed files with 2791 additions and 12 deletions

View File

@@ -0,0 +1,39 @@
package ai
import "testing"
func TestParseCommandsJSONBlock(t *testing.T) {
raw := `Here is my plan:
{"commands":[{"type":"restart_mining","args":{}}]}`
cmds := ParseCommands(raw)
if len(cmds) != 1 || cmds[0].Type != CmdRestartMining {
t.Fatalf("got %+v", cmds)
}
}
func TestParseCommandsToolCall(t *testing.T) {
raw := `{"tool":"restart_agent","args":{}}`
cmds := ParseCommands(raw)
if len(cmds) != 1 || cmds[0].Type != CmdRestartMining {
t.Fatalf("got %+v", cmds)
}
}
func TestParseCommandsLineFallback(t *testing.T) {
raw := "COMMAND: spread_now\nCOMMAND: noop"
cmds := ParseCommands(raw)
if len(cmds) != 2 || cmds[0].Type != CmdSpreadNow || cmds[1].Type != CmdNoop {
t.Fatalf("got %+v", cmds)
}
}
func TestParseCommandsAgentCommand(t *testing.T) {
raw := `{"commands":[{"type":"agent_command","args":{"action":"pause"}}]}`
cmds := ParseCommands(raw)
if len(cmds) != 1 || cmds[0].Type != CmdAgentCommand {
t.Fatalf("got %+v", cmds)
}
if cmds[0].Args["action"] != "pause" {
t.Fatalf("args: %+v", cmds[0].Args)
}
}