fix: only send tools to backends that support them (cloud)

The MI50 llama.cpp server 500s on the `tools` param unless launched with
--jinja, so sending tools to mi50 broke chat on that backend. Gate tools to
TOOL_BACKENDS={"cloud"} for now; mi50 chat works again (just without tools).
Add "mi50" once its server runs with --jinja.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 20:52:47 +00:00
parent 49b88af3cc
commit ac04ad1df6
+5 -1
View File
@@ -18,6 +18,10 @@ RECALL_K = 3 # raw cross-session "sharp detail" hits
RECENT_N = 10 # raw turns of the current session
SUMMARY_K = 3 # other-session gists
MAX_TOOL_ROUNDS = 5 # cap tool-call iterations per turn
# Backends that support function-calling. The MI50's llama.cpp server only does
# tools when launched with --jinja; until it is, keep tools to cloud so MI50 chat
# doesn't 500 on the tools param. Add "mi50" here once that flag is set.
TOOL_BACKENDS = {"cloud"}
def _summary_note(summaries: list[memory.Summary]) -> Message:
@@ -126,7 +130,7 @@ def respond(session_id: str, user_msg: str, backend: Backend = "cloud") -> str:
# Tool loop: offer Lyra her tools; if she calls one, run it and feed the
# result back so she can continue, until she returns a normal text reply.
tool_specs = toolkit.specs() if backend in ("cloud", "mi50") else None
tool_specs = toolkit.specs() if backend in TOOL_BACKENDS else None
ctx = {"session_id": session_id, "backend": backend}
reply = ""
for _ in range(MAX_TOOL_ROUNDS):