mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 08:19:40 +02:00
The companion chat had its own ad-hoc 3-round tool-calling pipeline: build a system prompt with tool descriptions, ask the LLM to emit ```tool JSON blocks, regex-extract, execute, feed back the result as a synthetic user message. Same fragility class as the old text-JSON planner — and now unnecessary since mana-llm speaks native function calling. Migrates companion/engine.ts to the shared runPlannerLoop, same as the mission runner (commit 5a) and the server tick (commit 6). Tools go to the LLM as proper function-schemas; tool_calls come back structured; the executor runs them directly under USER_ACTOR. Extends shared-ai/planner/loop.ts with an optional priorMessages[] input field so the chat can preserve multi-turn history between turns (missions don't need this and leave it empty). Deletes the old llm-tasks/companion-chat.ts LlmTask wrapper. Nothing else imported it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| tsconfig.json | ||