Operational procedures for diagnosing and troubleshooting webchat issues.
This guide focuses on operational debugging for the current sessionstream-backed HTTP chat setup:
POST /api/chat/sessions to create a sessionPOST /api/chat/sessions/:sessionId/messages to submit a promptGET /api/chat/sessions/:sessionId for snapshot hydrationGET /api/chat/ws for protobuf JSON websocket framesGET /api/debug/conversations for current runtime pointer inspection when debug APIs are enabledGET /api/debug/turns for turn inspection when a turn store is enabledGET /api/chat/profiles and schema endpoints for profile API health checksEnable frontend websocket debug logs:
?ws_debug=1window.__WS_DEBUG__ = truelocalStorage.setItem('__WS_DEBUG__', 'true')Look for lifecycle logs:
connect:beginsocket:openmessage:forwardsessionId.GET /api/chat/sessions/:sessionId output.snapshotOrdinal, entity createdOrdinal / lastEventOrdinal, and live eventOrdinal values.POST /api/chat/sessions/:sessionId/messages.prompt, profile, registry, and idempotencyKey.GET /api/debug/turns returns 404 when turn store is disabled.--turns-db or --turns-dsn.resolved_runtime_key (latest pointer only),runtime_key and inference_id,/api/debug/turns, not only /api/debug/conversations/:id.--timeline-js-script, check script path and syntax first.js timeline handler threw; continuingjs timeline reducer threw; continuingjs timeline reducer upsert failed; continuingconst p = require("pinocchio") (alias: require("pnocchio"))p.timeline.onUIEvent(eventName, fn)p.timeline.upsertEntity(entity)llm.delta), verify your reducer is not returning consume: true.consume: false and only emit upserts.p.timeline.onUIEvent("*", fn) and run for all UI event types.Backend checks:
/api/chat/sessions, /api/chat/sessions/:sessionId/messages, /api/chat/sessions/:sessionId, /api/chat/ws, and profile routes.chatapp.RegisterSchemas(reg, plugins...) runs with NewReasoningPlugin() and NewToolCallPlugin() when reasoning/tool rows are expected.--timeline-db or --timeline-dsn) when durability is expected./api/chat/profiles, /api/chat/schemas/middlewares, and /api/chat/schemas/extensions.--timeline-js-script and inspect startup log for script list.Frontend checks:
/api/chat/sessions/:sessionId, not /api/timeline./api/chat/ws under the current base prefix.snapshotOrdinal, eventOrdinal) or explicitly supports compatibility aliases.session_id=$(curl -s -X POST http://localhost:8080/api/chat/sessions \
-H 'content-type: application/json' \
-d '{}' | jq -r '.sessionId')
curl -i -X POST "http://localhost:8080/api/chat/sessions/${session_id}/messages" \
-H 'content-type: application/json' \
-d '{"prompt":"hello"}'
curl -i "http://localhost:8080/api/chat/sessions/${session_id}"
curl -i "http://localhost:8080/api/debug/conversations/${session_id}"
curl -i "http://localhost:8080/api/debug/turns?conv_id=${session_id}&limit=5"
curl -i 'http://localhost:8080/api/chat/profiles'
curl -i 'http://localhost:8080/api/chat/schemas/middlewares'
Example runtime history query:
curl -s "http://localhost:8080/api/debug/turns?conv_id=${session_id}&limit=50" \
| jq '.items[] | {turn_id, phase, runtime_key, inference_id, created_at_ms}'
If operational runbooks still mention these, update them:
/timeline/turns/hydrate