feat(diagnostics): per-call timing, in-flight markers, and a diagnostics endpoint
Instrument the provider router to emit a model_call_start before every model
call and a model_call with duration_ms after, plus explicit phase events. A
hung/in-flight call is now visible (a start with no matching end) instead of
producing no log line until it returns.
Add GET /v1/sessions/{id}/diagnostics: a machine-readable summary (for human or
AI maintainers) of phase + per-call durations, slowest calls, errors, and any
in-flight call with how long it has been waiting — the key signal for "is it
hung?". e2e covers it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>