fix(routes): error handling, health endpoint, request validation, rate limiting #32
Reference in New Issue
Block a user
Delete Branch "improve/soul-routes-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Standardize error responses, improve /health diagnostics, add input validation, add basic rate limiting.
- Add per-IP in-memory rate limiter (60 req/min default, configurable via soul_rate_limit state key; /health exempt; loopback callers skipped) - Extend /health with uptime_secs (from soul_boot_ts) and live LLM probe - Add missing_param 400 guard on POST /api/chat before passing to LLM - Standardise error envelopes: add "code" field to err_404/err_405 and all missing-param returns; route_synthesize now errors clearly instead of returning the misleading {"mechanism":"did not engage"} on bad input - Document streaming gap in /api/chat (SSE not implemented, note added) - handle_request gains ip param; rate_limit_check wired at entry point