From 53f8d0912ee8ca89010d0a53488cf81d3e1fcabc Mon Sep 17 00:00:00 2001 From: Alexander Payne Date: Wed, 25 Feb 2026 17:18:44 -0500 Subject: [PATCH] fix: purge stale bytecache on make dev to prevent old .pyc errors The Agno Toolkit API fix (1bc2cdc) wasn't taking effect because Python was loading stale __pycache__/*.pyc files with the old add_tool() calls. Now `make nuke` clears all bytecache, and `make dev` sets PYTHONDONTWRITEBYTECODE=1 to prevent .pyc creation during development. Co-Authored-By: Claude Opus 4.6 --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3ef4a46..5f6a2f9 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ $(VENV)/bin/activate: # ── Development ─────────────────────────────────────────────────────────────── dev: nuke - $(UVICORN) dashboard.app:app --reload --host 0.0.0.0 --port 8000 + PYTHONDONTWRITEBYTECODE=1 $(UVICORN) dashboard.app:app --reload --host 0.0.0.0 --port 8000 # Kill anything on port 8000, stop Docker containers, clear stale state. # Safe to run anytime — idempotent, never errors out. @@ -52,9 +52,12 @@ nuke: @docker compose down --remove-orphans 2>/dev/null || true @# Kill any process holding port 8000 (errno 48 fix) @lsof -ti :8000 | xargs kill -9 2>/dev/null || true + @# Purge stale bytecache to prevent loading old .pyc files + @find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true + @find . -name "*.pyc" -delete 2>/dev/null || true @# Brief pause to let the OS release the socket @sleep 0.5 - @echo " ✓ Port 8000 free, containers stopped" + @echo " ✓ Port 8000 free, containers stopped, caches cleared" # Print the local IP addresses your phone can use to reach this machine. # Connect your phone to the same hotspot your Mac is sharing from,