Chronicle: fix sessions.summary storing raw JSON instead of human-readable text#312298
Draft
Chronicle: fix sessions.summary storing raw JSON instead of human-readable text#312298
Conversation
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/e8e69d52-3a68-4673-81f9-01b6db45bf0b Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix sessions.summary containing raw JSON instead of human-readable text
Chronicle: fix sessions.summary storing raw JSON instead of human-readable text
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sessions.summarywas being populated verbatim fromUSER_REQUESTspan attributes or first user message events, which can be structured JSON (e.g.[{"type":"tool_result","content":"..."}]). This brokeLIKE-based queries and confused the Chronicle intent LLM.Changes
New helper
extractPlainTextFromContent(sessionStoreTracking.ts): detects JSON content (starts with[or{) and extracts human-readable text from known message structures:{"type":"text","text":"..."}— multi-modal text parts{"role":"...","content":"..."}— chat messages with string contentundefinedfor unrecognized JSON (tool results, images, etc.), skipping the summary entirely_backfillFromSpanAttributesand_handleAgentSpannow route through the helper before settingsummary, and skip the write whenundefinedis returned13 new tests in
sessionStoreTracking.spec.tscovering plain text pass-through, text part/chat message extraction, tool result skipping, empty/invalid JSON, and whitespace handling