Spaces:
Sleeping
Sleeping
Commit History
-
Claude Code: Add /status endpoint with structured health checks (db, env, fs)
Claude Code +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>54b1241 -
Claude Code: Add structured /health endpoint with timestamp, STARTUP_MODE, and brain_loaded status
Claude Code +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>097b672 -
Claude Code: Rewrite app.py - clean FastAPI with WebSocket and static mount
Claude Code +1: Claude Opus 4.6- Simplify app.py to core FastAPI + WebSocket + static files - WebSocket /ws/agents sends Adam (Thinking) and Eve (Writing) every 2s - Mount frontend/ at root with StaticFiles(html=True) - Bind to 0.0.0.0:7860 via uvicorn Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>81c9c70 -
Claude Code: Fix app.py - add /ws/agents WebSocket, mount StaticFiles at /, use fastapi.staticfiles
Claude Code +1: Claude Opus 4.6- Import StaticFiles from fastapi.staticfiles (not starlette.staticfiles) - Mount frontend at root path "/" instead of "/frontend" - Add @app.websocket("/ws/agents") endpoint sending {"name": "Adam", "status": "Active"} every 2s - Add "Server started" log in lifespan startup - Import WebSocket from fastapi Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>57ecd84 -
Claude Code: Add /api/agents endpoint returning all HuggingClaw agents (Adam, Eve, Cain) with statuses and roles
Claude Code +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d6fead5 -
Claude Code: Fix A2A communication - add missing /a2a/jsonrpc endpoint
Claude Code +1: Claude Opus 4.6The A2A JSON-RPC endpoint was missing, causing all A2A communication to fail with 404 errors. Added proper /a2a/jsonrpc POST endpoint that: - Handles message/send method from other HuggingClaw agents - Processes messages through the brain - Returns proper JSON-RPC 2.0 responses - Updates worker state during processing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d783c91 -
Claude Code: Fix A2A communication - pre-initialize worker_state in minimal mode
Claude Code +1: Claude Opus 4.6Root cause: 3-second delay in state transition caused A2A communication failures during startup. Health endpoint returned STARTING stage while parent agent expected RUNNING. Fix: Pre-initialize _worker_state to RUNNING_A2A_READY in minimal mode at module import time, eliminating the delay and ensuring immediate A2A readiness. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>749b560 -
Claude Code: Fix health endpoint - explicitly set error=null to prevent 'Error: unknown' display
Claude Code +1: Claude Opus 4.6The health endpoint was setting 'error': None in the response dict, which serializes to 'error': null in JSON. HuggingFace's infrastructure displays this as 'Error: unknown'. Fix: Remove the error key entirely when there's no actual error, rather than setting it to None. The error field is now only included in the JSON response when there's a real error condition. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>7a5b921 -
Claude Code: Fix health endpoint - explicitly set error=null to prevent 'Error: unknown' display
Claude Code +1: Claude Opus 4.6The health endpoint now explicitly includes error: null in the response instead of omitting the field entirely. This prevents monitoring systems from displaying 'Error: unknown' when the error field is missing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>732447a -
Claude Code: Verify health endpoint - add debug logging
Claude Code +1: Claude Opus 4.6Investigation findings: - Uvicorn correctly binds to 0.0.0.0:7860 via entrypoint.sh - /health endpoint already has protection against "error": "unknown" - Status files have correct values (error=null, health=HEALTHY) - No code currently sets error to "unknown" Added debug logging to health endpoint to help diagnose "Error: unknown" display issue if it persists. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>2dc23e5 -
Claude Code: Fix A2A communication in minimal mode - add startup state transition
Claude Code +1: Claude Opus 4.6In minimal mode, the worker process is not spawned, which caused _worker_state to stay in "STARTING" state forever. This broke A2A communication because external agents poll /health expecting stage="RUNNING". Fix: Add background task that transitions state to RUNNING_A2A_READY after 3 seconds, enabling A2A discovery even without worker process. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fe057ec -
Claude Code: Skip worker spawn in minimal mode to ensure uvicorn starts immediately
Claude Codec860f1e -
Claude Code: Add debug prints to track uvicorn startup sequence
Claude Codee1064e4 -
Claude Code: Fix startup - add explicit uvicorn.run() with logging
Claude Code +1: Claude Opus 4.6- Add main block with uvicorn.run(app, host="0.0.0.0", port=7860) - Add explicit logging before server binding to verify execution - Ensure server binds to port 7860 regardless of agent status Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3eb8441 -
Claude Code: Fix 'Error: unknown' status display
Claude Code +1: Claude Opus 4.6- Add cleanup of stale 'unknown' error strings on app startup - Make /health endpoint defensive - only return error if real error exists - Cleanup runs on module import before FastAPI starts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e3aa6b2 -
Claude Code: Fix A2A communication - move static mount to /frontend subpath
Claude Code +1: Claude Opus 4.6The static file mount at "/" was overriding all API routes (/health, /agents). This broke A2A proxy discovery and health checks. Now static files are at /frontend and root redirects to /frontend/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>4805801 -
Claude Code: Add /_debug diagnostic route to expose filesystem state
Claude Code +1: Claude Opus 4.6- Adds /_debug endpoint to verify server responsiveness - Returns cwd, frontend existence, frontend listing, static mount status - Helps diagnose root route / static file issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3af5388 -
Claude Code: Fix frontend mount - use absolute path /app/frontend with root mount and html=True
Claude Code +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b8f337d -
Claude Code: Fix Cain - add static file mounting for /frontend directory
Claude Code +1: Claude Opus 4.6The frontend static files were not being served. Added StaticFiles mount for /frontend directory to serve index.html and related assets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1550d6c -
Claude Code: Fix Cain - spawn brain_minimal.py worker process on startup
Claude Code +1: Claude Opus 4.6The worker process was never started, causing health check to report "starting" forever. Added lifespan context manager to spawn worker subprocess on startup and terminate gracefully on shutdown. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>63e51e7 -
Claude Code: Check Cain's current application logs (stdout/stderr) to identify the "u
Claude Code78dea99 -
Claude Code: Fix Starlette middleware import - BaseMiddleware -> BaseHTTPMiddleware
Claude Code +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5982cbe -
Claude Code: Add full traceback logging middleware
Claude Code +1: Claude Opus 4.6- Import traceback and BaseMiddleware - Replace function middleware with class-based LoggingMiddleware - Log full stack trace with traceback.format_exc() on errors - Return JSONResponse with 500 status instead of re-raising Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ba6c66b -
Claude Code: Add request logging middleware and STARTUP_MODE support
Claude Code +1: Claude Opus 4.6- Add middleware to log all requests and exceptions to logs/runtime.log - Create logs/ directory automatically if it doesn't exist - Pass STARTUP_MODE from entrypoint.sh (default: minimal) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ce4bc03 -
Claude Code: Fix A2A - add /health and /agents endpoints
Claude Code- Add missing /internal/heartbeat endpoint for worker communication - Track worker state in-memory instead of hardcoded values - Fix "unknown" error by properly reporting worker stage79d6a8b -
Fix: Enforce strict uvicorn entrypoint configuration
Claude Code03d0f79 -
Claude Code: Fix A2A port routing - expose a2a-proxy on external port 7860
Claude Code +1: Claude Opus 4.6- Move a2a-proxy from internal 7861 to external 7860 (Docker exposed) - Move uvicorn to internal 7862 (only accessed by proxy) - Fixes external A2A health checks failing due to unreachable proxy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5db4585 -
Claude Code: Simplify app.py - remove redundant uvicorn.run() block, entrypoint.sh handles startup
Claude Code54e4ffb -
Claude Code: Fix stale 'unknown' error - ensure entrypoint cleans cached errors on restart
Claude Code45bc2ae -
Claude Code: Fix A2A - add /health and /agents endpoints
Claude Code441f392 -
Claude Code: Force minimal app.py - diagnostic for unknown error
Claude Code +1: Claude Opus 4.6Backup saved as app.py.broken. Testing if "unknown" error is in Python code layer or Docker/entrypoint layer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>7cab3bb -
Claude Code: Test Eve's hypothesis - disable error_handlers to break dependency chain
Claude Code +1: Claude Opus 4.6- Commented out error_handlers import and registration - Commented out RequestLoggingMiddleware - Added print("APP_READY") immediately after FastAPI instantiation - This will verify if error_handlers or middleware is causing startup hang Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>7d8ff40 -
Claude Code: Fix import structure - decouple error_handlers from app
Claude Code +1: Claude Opus 4.6- Remove module-level sys.path manipulation from error_handlers.py - Add register_error_handlers(app) function for explicit handler registration - Move sys.path setup to app.py where it belongs - This eliminates potential circular import issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3923b92 -
Claude Code: Restore entrypoint.sh to clean stale 'unknown' errors
Claude Code +1: Claude Opus 4.6- Dockerfile now uses entrypoint.sh instead of direct uvicorn - entrypoint.sh cleans stale 'unknown' errors from cain_status.json - This fixes the 'Error: unknown' display issue on HF Spaces Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1485017 -
Claude Code: Fix middleware import - use starlette instead of fastapi.middleware.base
Claude Code +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b620f47 -
Claude Code: Force Docker rebuild to fix fastapi.middleware.base import
Claude Code +1: Claude Opus 4.6- Minor comment update to trigger fresh Docker image build - requirements.txt already has fastapi>=0.104.0 and uvicorn[standard]>=0.24.0 - Dockerfile correctly installs from requirements.txt - The ModuleNotFoundError suggests stale cached Docker layers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1026301 -
Claude Code: Bypass entrypoint to expose raw Python traceback
Claude Code +1: Claude Opus 4.6Diagnose silent crash by running uvicorn directly instead of through entrypoint.sh, which redirects output to /app/logs/uvicorn.log. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8bbcf59
-
Claude Code: Fix container exit issue - log paths and restart loop
Claude Code0d0e2dd -
Claude Code: Simplify Dockerfile to reduce build time
Claude Code +1: Claude Opus 4.6- Remove nodejs/npm from system dependencies - Remove port 7861 exposure (A2A proxy) - Use --no-install-recommends for faster apt install - Should reduce Docker build time significantly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>29ac1bd -
Claude Code: Fix dependency error to use DEGRADED health
Claude Code +1: Claude Opus 4.6- Changed CRITICAL_FAILURE/DEPENDENCY_ERROR to RUNNING/DEGRADED - Ensures app stays healthy even with dependency issues - Health check already accepts DEGRADED as healthy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>40e21b9 -
Wake: trigger rebuild
Claude Code4c33592 -
Claude Code: Accept DEGRADED as healthy state for health check
Claude Code +1: Claude Opus 4.6- Health check now accepts "DEGRADED" as a healthy state - Allows app to serve requests even if worker fails to spawn - Prevents health check from failing when worker is not available Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b18694a -
Claude Code: Fix worker spawn blocking - remove heartbeat wait to prevent timeout
Claude Code +1: Claude Opus 4.6- WorkerManager.spawn_with_retry now non-blocking - Reduced max_attempts from 5 to 2 for faster startup - Reduced retry_delay from 2.0s to 1.0s - Reduced heartbeat_timeout from 30s to 5s - Worker reports healthy immediately after spawn - Removed blocking _wait_for_heartbeat call - On spawn failure, app enters DEGRADED mode instead of CRITICAL_FAILURE - Fixes "Launch timed out, workload was not healthy after 30 min" error Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>bab142c -
Claude Code: Fix worker env injection - add ANTHROPIC_API_KEY and CLAUDE_API_KEY to env config
Claude Code +1: Claude CodeThe worker process (brain_minimal.py) was failing to initialize because ANTHROPIC_API_KEY and CLAUDE_API_KEY were not being explicitly exported to the subprocess environment. These keys are required by error_handlers.py which is imported by the worker. Co-Authored-By: Claude Code <noreply@anthropic.com>f1cd1ec -
Claude Code: Fix worker env injection - add ANTHROPIC_API_KEY and CLAUDE_API_KEY to env config
Claude Code +1: Claude Opus 4.6- Added CLAUDE_API_KEY to .env.example (was completely missing) - Uncommented ANTHROPIC_API_KEY in .env.example (was commented out) - Added both keys to utils/env_init.py _CRITICAL_DEFAULTS - Added both keys to optional critical variables verification This fixes worker initialization failures where API keys were not properly propagated to the worker subprocess environment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>740ba92 -
Claude Code: Fix worker env injection - remove empty API key defaults that interfere with HF Space secrets
Claude Coded9c8cec -
Claude Code: Fix lifespan forward reference error in app.py
Claude Code +1: Claude Code- Move lifespan function definition before FastAPI() app initialization - Remove duplicate code block that was causing confusion - This fixes the NameError that prevented worker lifecycle initialization Co-Authored-By: Claude Code <noreply@anthropic.com>ca9b351 -
Claude Code: Fix worker lifecycle initialization with lifespan context manager
Claude Code +1: Claude Opus 4.6- Replace deprecated @app.on_event with lifespan context manager - Spawn worker as background task after FastAPI is ready - Extend heartbeat timeout to 30s for HF Spaces environment - Add /health endpoint for container orchestration health checks - Use asyncio.create_task for non-blocking worker initialization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>49e4f04 -
Claude Code: Configure git identity in entrypoint.sh
Claude Code6d68f98 -
Claude Code: Fix worker initialization race condition with WorkerManager
Claude Code +1: Claude Code- Create WorkerManager class to handle process lifecycle - Block startup until worker heartbeat is confirmed - Use asyncio.create_subprocess_exec for async worker spawn - Add retry logic (3 attempts, 2s delays) with logging - Set state=RUNNING only after successful spawn and PID confirmation - Startup now fails if worker never spawns This prevents Cain from reporting "healthy" until the worker subsystem is actually running. Co-Authored-By: Claude Code <noreply@anthropic.com>d548c24