Re-review fixes: unblind errorMessage log sites, log tool-loop originals

↗ view on GitHub · sloth-ninja · 2026-08-04 · 2eca1c36

- user.ts: all 11 sites that passed errorMessage(err) to console.error now
  log safeErrorLog(err) - wave 2 had made plain-object errors log the
  literal generic sentence, strictly worse than main on the log side.
  errorMessage(err) remains only for the client detail at the seven split
  sites.
- errorMessage(): drop the "(code)" suffix entirely - it duplicated the
  sibling code field in user-visible copy on the oauth_required 401, and
  no other caller needs it.
- chatTools.ts tool-loop catch: console.error the ORIGINAL error via
  safeErrorLog before the AssistantStreamError rethrow, so Postgrest
  objects thrown by tools are visible in production logs.
- Tests: new route-level test (GET /user/api-keys) asserting the log
  receives extracted Postgrest diagnostics while the client gets the
  fixed detail; errorMessage suffix expectation updated. 624 total.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Repository Sloth-ninja/JessicaOSS
Author sloth-ninja <ezanahaddis@gmail.com>
Authored
Parents 5047ffb7
Stats 5 files changed , +101 , -45
Part of Error visibility hardening without raw-detail leaks

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-2eca1c36.md from inside the repo you want the change in.

⬇ Download capture-commit-2eca1c36.md