External hallucination-probe service wired in, with heat-strip UI and mock endpoint
mglynnhenley forked Mike to add post-hoc hallucination scoring: after each Claude or Gemini turn, the completed assistant text is sent to a Modal-hosted probe service which returns per-token confidence scores. Those scores stream back over the same SSE channel and light up inline tints over the assistant text.
The integration is behind PROBE_API_URL in .env. Leave it unset and the scorer returns null without touching the request path. Set it and the backend replays the completed assistant message as a prefilled turn to an OpenAI-chat-completions-compatible endpoint, reading back a { probeName: number[] } payload. Scores persist on tabular_cells.probe_scores and chat_messages.probe_scores (both jsonb) so they survive page reloads.
Text appears immediately. Probe tints arrive asynchronously, keeping perceived latency tied to the model rather than the scoring service. A content_done SSE event signals the frontend to drop the typing indicator; probe score events can keep arriving after that. The UI renders background tints inline over assistant text, and a threshold slider stored in localStorage (default 0.3) lets users suppress low-confidence highlights.
For local development there is a regex-based mock endpoint at /mock-probe/v1/chat/completions, enabled with ENABLE_PROBE_MOCK=true. The live scorer has a circuit breaker - an unreachable probe degrades to unhighlighted output rather than breaking the chat response.
A separate "Think" toggle was added to the chat input to make adaptive thinking opt-in per turn. The commit notes that Sonnet 4.6 rejects the thinking flag when sent unconditionally, so the default is off.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?