feat: add ReAct agent loop and build-time config (mimi_secrets.h)

Rewrite agent_loop.c with ReAct tool use loop: LLM call → tool
execution → repeat until end_turn (max 10 iterations). Add tool
guidance to system prompt. Add set_search_key CLI command.

Add mimi_secrets.h for build-time credentials with highest priority
over NVS/CLI values. All modules (wifi, telegram, llm, proxy,
web_search) check build-time secrets first, fall back to NVS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
crispyberry
2026-02-07 00:37:43 +08:00
parent 2fe81b8ee1
commit 0e1da79b74
9 changed files with 255 additions and 57 deletions

View File

@@ -20,6 +20,7 @@
#include "gateway/ws_server.h"
#include "cli/serial_cli.h"
#include "proxy/http_proxy.h"
#include "tools/tool_registry.h"
static const char *TAG = "mimi";
@@ -104,6 +105,7 @@ void app_main(void)
ESP_ERROR_CHECK(http_proxy_init());
ESP_ERROR_CHECK(telegram_bot_init());
ESP_ERROR_CHECK(llm_proxy_init());
ESP_ERROR_CHECK(tool_registry_init());
ESP_ERROR_CHECK(agent_loop_init());
/* Start Serial CLI first (works without WiFi) */