Skip to content

Comments

Add debug logging for LLM query and response pipeline#1040

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-accessing-choices-array
Draft

Add debug logging for LLM query and response pipeline#1040
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-accessing-choices-array

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

LLM responses received from API but not displaying in UI. Unclear if issue is in request construction, response parsing, or choices array access.

Changes

  • Query logging: Log full query including topic context and neighboring topics

    console.debug('[LLM] Query with context:', { topicContext, userMessage, fullMessage })
  • Response logging: Log complete API responses from OpenAI and Gemini before parsing

    console.debug('[LLM] OpenAI API response:', response.data)
    // Enables verification of response.data.choices[0].message.content structure
  • Extraction logging: Log the actual message extracted from API response

    console.debug('[LLM] Extracted assistant message:', assistantMessage)
  • Error context: Log full response object when choices/candidates array missing

Debugging

Logs trace the full pipeline: query construction → API call → response parsing → message extraction. Opens DevTools console and filter for [LLM] to identify failure point.

Updated LLM_INTEGRATION.md with debugging workflow and expected log format.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 29, 2026 06:55
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
…fy production safety

Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix accessing choices array in response object Add debug logging for LLM query and response pipeline Jan 29, 2026
Copilot AI requested a review from thomasnordquist January 29, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants