dev/familiar-debug-loop/SKILL.md
Debug a stuck or misbehaving familiar-ai ReAct loop. Diagnoses tool-call failures, model output issues, prompt-mode parsing errors, and silent tool skips.
npx skillsauth add lifemate-ai/familiar-ai familiar-debug-loopInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Diagnose why the familiar-ai agent loop is stuck, looping, or behaving unexpectedly.
Work through these checks in order. Stop at the first confirmed cause.
The agent skips tool init silently if env vars are missing. Verify each tool actually initialized:
# In a Python REPL or quick script:
from familiar_agent.config import AgentConfig
from familiar_agent.agent import FamiliarAgent
cfg = AgentConfig()
agent = FamiliarAgent(cfg)
print("Camera:", agent._camera) # None = not initialized
print("Mobility:", agent._mobility) # None = not initialized
print("TTS:", agent._tts) # None = not initialized
print("Tools:", [t["name"] for t in agent._all_tool_defs])
If a tool is None, run familiar-check-env to find the missing config.
In TOOLS_MODE=prompt, the model must output <tool_call>{...}</tool_call> blocks.
In TOOLS_MODE=native, the model must return finish_reason="tool_calls".
Enable debug logging to see raw model output:
# .env
LOG_LEVEL=DEBUG
Or in Python:
import logging
logging.basicConfig(level=logging.DEBUG)
Look for lines like:
DEBUG familiar_agent.backend - ...
Prompt-mode symptoms:
<tool_call> but nothing happens → check _TOOL_CALL_RE regex parse<tool_call> → model isn't following the tools prompt; try a different/larger model<tool_call> then keeps talking → model ignored the "STOP after tool_call" instruction; try TOOLS_MODE=prompt with a stronger system prompt hintNative-mode symptoms:
finish_reason is "stop" instead of "tool_calls" → model doesn't support native function calling; switch to TOOLS_MODE=prompttools parameter; switch to TOOLS_MODE=promptIn agent.py → _execute_tool(), tool calls are routed by name string matching.
If you added a new tool but it's returning "Tool 'xyz' not available":
get_tool_definitions() matches exactly the string being routed in _execute_tool()_execute_tool():
<name>_tools = {"<verb1>", "<verb2>"}
if name in <name>_tools and self._<name>:
return await self._<name>.call(name, tool_input)
self._<name> is not None (see Check 1)"see() returns no image"
CAMERA_HOST, CAMERA_ONVIF_PORTCAMERA_HOSTwhich ffmpeg"look() does nothing"
2020, other brands vary"Connection refused"
"say() returns success but no sound"
~/.cache/embodied-claude/go2rtc/go2rtc exists and is executablempv / ffplay not in PATH → no local playback fallback; install one"TTS API failed (401)"
ELEVENLABS_API_KEY is wrong or expired"TTS API failed (422)"
Agent loops on the same action:
MAX_ITERATIONS (default 50) in agent.pyAgent ends turn immediately after one action:
say() is the last required step, the loop ends naturallystop_reason == "end_turn" is coming too early — model may be concluding the task prematurelyAgent never enters tool-calling mode (just talks):
_all_tool_defs returns empty list → all tools are None; run Check 1"recall() returns nothing"
~/.cache/huggingface/MEMORY_DB_PATH or default ~/.familiar_ai/observations.db"remember() hangs"
uv add torch --extra-index-url https://download.pytorch.org/whl/cpuLOG_LEVEL=DEBUG # Full backend request/response, tool routing
LOG_LEVEL=INFO # Tool init, backend selection, key events (default)
LOG_LEVEL=WARNING # Only problems
Log file location: ~/.cache/familiar-ai/familiar-ai.log
# Check what tools are available given current .env
uv run python -c "
from familiar_agent.config import AgentConfig
from familiar_agent.agent import FamiliarAgent
a = FamiliarAgent(AgentConfig())
print([t['name'] for t in a._all_tool_defs])
"
# Tail the log
tail -f ~/.cache/familiar-ai/familiar-ai.log
# Check DB exists and has records
sqlite3 ~/.familiar_ai/observations.db "SELECT count(*) FROM observations;"
tools
Validate the .env configuration for familiar-ai. Detects common misconfigurations like wrong ports, missing MODEL, or TOOLS_MODE issues that cause silent failures or timeouts.
tools
Scaffold a new sensor/actuator tool for familiar-ai. Generates the tool file and registers it in all required places in agent.py.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------