WeKnora/frontend/src
wizardchen 55caeefc3d feat(observability): log end-to-end TTFB on both ends of chat stream
To diagnose where latency lives between "user hits send" and "first
token appears" we need a single number that can be matched across
the browser console and the server log. Add correlated TTFB markers
keyed by X-Request-ID:

Frontend (streame.ts)

* Generate the X-Request-ID once and reuse it for logging.
* Log request:start when fetchEventSource is invoked, response:headers
  when onopen fires, and response:first_answer the first time an SSE
  payload with response_type === 'answer' arrives. Filtering by event
  type avoids treating session_title / references / tool_call as the
  "first token".

Backend (session handler)

* parseQARequest records the wall-clock entry time and logs TTFB:start
  with the same X-Request-ID.
* qaRequestContext carries receivedAt through to the stream handler.
* AgentStreamHandler emits a one-shot TTFB:first_answer_chunk log the
  first time it observes an AgentFinalAnswerData chunk, so the delta
  against TTFB:start is the server's request-in → first-token-out
  budget.

The frontend delta minus the backend delta is then attributable to
network + gin middleware, which were previously invisible.
2026-05-12 21:16:37 +08:00
..
api feat(observability): log end-to-end TTFB on both ends of chat stream 2026-05-12 21:16:37 +08:00
assets fix(frontend): polish model settings UI and fix disabled brand color 2026-05-07 21:51:22 +08:00
components fix(agent): relax rerank model requirement for custom agents 2026-05-12 16:57:24 +08:00
composables fix(frontend): make general-settings font picker actually work 2026-05-07 15:07:24 +08:00
hooks feat(knowledge-base): document list filters and explicit batch-management UX 2026-05-12 18:29:47 +08:00
i18n feat(agent): support dedicated model for query understanding step 2026-05-12 20:27:20 +08:00
router feat(frontend): replace standalone search page with global command palette 2026-05-06 16:26:22 +08:00
stores feat(frontend): replace standalone search page with global command palette 2026-05-06 16:26:22 +08:00
types feat(frontend): chunking debug panel with live preview 2026-05-06 17:17:07 +08:00
utils fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode 2026-05-12 16:27:28 +08:00
views feat(agent): support dedicated model for query understanding step 2026-05-12 20:27:20 +08:00
wailsjs feat: implement automatic update checking and downloading functionality in the desktop app, enhancing user experience with seamless updates and corresponding UI settings 2026-04-11 18:51:16 +08:00
App.vue fix(frontend): make general-settings font picker actually work 2026-05-07 15:07:24 +08:00
main.ts perf(wiki): lazy-load sidebar page list with virtual-scroll tabs 2026-05-08 15:07:59 +08:00