nes: log tree: fix: XtabProvider debug log tree nesting#4701
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes incorrect nesting of XtabProvider items in the Chat Debug request log tree by removing “rendering hints” from CapturingToken and changing how the request-log tree associates a group’s “main” markdown document with its parent node.
Changes:
- Remove
flattenSingleChild/promoteMainEntryfromCapturingTokenso it’s purely a correlation token. - Rewrite request-log tree grouping so “main”
MarkdownContentRequestentries are wired to the parent viasetMainEntry()instead of being added as children and post-processed. - Update
CapturingTokenconstruction across call sites and adjust affected tests.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/platform/requestLogger/common/capturingToken.ts | Removes tree-rendering hint fields from the token API. |
| src/extension/log/vscode-node/requestLogTree.ts | Reworks grouping to attach main markdown entry directly to parent; removes flatten/promote post-processing; updates collapsible state behavior. |
| src/extension/inlineEdits/vscode-node/inlineCompletionProvider.ts | Updates NES capturing token construction after token API change. |
| src/extension/inlineEdits/node/nextEditProvider.ts | Updates NES/spec capturing token construction after token API change. |
| src/extension/completions-core/vscode-node/extension/src/vscodeInlineCompletionItemProvider.ts | Updates Ghost capturing token construction after token API change. |
| src/extension/tools/node/searchSubagentTool.ts | Updates capturing token construction after token API change. |
| src/extension/tools/node/executionSubagentTool.ts | Updates capturing token construction after token API change. |
| src/extension/prompt/node/defaultIntentRequestHandler.ts | Updates capturing token construction after token API change (incl. session/parent grouping args). |
| src/extension/prompt/node/title.ts | Updates capturing token construction after token API change (child-session grouping). |
| src/extension/prompt/node/summarizer.ts | Updates capturing token construction after token API change (child-session grouping). |
| src/extension/prompt/node/promptCategorizer.ts | Updates capturing token construction after token API change (child-session grouping). |
| src/extension/chatSessions/copilotcli/node/copilotcliSession.ts | Updates capturing token construction after token API change; minor import ordering tweak. |
| src/extension/chatSessions/claude/node/claudeCodeAgent.ts | Updates capturing token construction after token API change. |
| src/extension/chatSessions/claude/vscode-node/slashCommands/terminalCommand.ts | Updates capturing token construction after token API change. |
| src/extension/chatSessions/claude/vscode-node/slashCommands/test/terminalCommand.spec.ts | Updates assertions after removal of flattenSingleChild. |
| src/extension/replay/vscode-node/test/chatReplayNotebook.spec.ts | Updates capturing token construction in tests after token API change. |
Comments suppressed due to low confidence (1)
src/extension/log/vscode-node/requestLogTree.ts:634
prompt.childrenis incrementally appended to but never pruned. When aMarkdownContentRequestchild was previously added while visible and later flips to hidden (isVisible()becomes false), thecontinuehere prevents adding it again but does not remove the existing child, so it may remain visible in the tree. IfisVisibleis intended to dynamically hide entries, consider removing any existing child with the same id when skipping, or rebuildingchildrenfrom scratch each refresh.
// Skip non-main hidden entries
if (currReq.kind === LoggedInfoKind.Request &&
currReq.entry.type === LoggedRequestKind.MarkdownContentRequest &&
currReq.entry.isVisible && !currReq.entry.isVisible()) {
continue;
}
DonJayamanne
previously approved these changes
Mar 26, 2026
bpasero
previously approved these changes
Mar 26, 2026
XtabProvider entries appeared unnested at the top level when the sibling NES MarkdownContentRequest entry was hidden (via setIsSkipped or cancellation). This happened because flattenSingleChild promoted the sole remaining child to the top level. Instead of adding the log context document as a child that gets 'promoted' into the parent, ChatPromptItem now directly owns the document via setMainEntry(). A MarkdownContentRequest whose debugName matches the token label is wired to the parent's icon and click command — never added as a tree child. Groups with no visible children render as non-expandable leaf items. This removes flattenSingleChild and promoteMainEntry from CapturingToken, making it a pure correlation token with no rendering hints. The tree view owns all rendering conventions.
1c76827 to
868fb00
Compare
bpasero
approved these changes
Mar 26, 2026
auto-merge was automatically disabled
March 26, 2026 12:43
Pull request was closed
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.
Problem
XtabProvider entries sometimes appeared unnested at the top level of the Chat Debug log tree instead of under their NES parent entry.
Root Cause
`flattenSingleChild=true` on the NES `CapturingToken` promoted the XtabProvider child to the top level when the sibling NES `MarkdownContentRequest` entry was hidden (via `setIsSkipped()` or cancellation). The hidden entry was skipped entirely in the tree's grouping loop, making XtabProvider the sole visible child, which then got flattened.
Fix
Remove `flattenSingleChild` and `promoteMainEntry` from `CapturingToken` entirely, making it a pure correlation token with no rendering hints.
Instead of adding the NES log context document as a child entry that gets "promoted" into the parent, `ChatPromptItem` now directly owns the document via `setMainEntry()`. A `MarkdownContentRequest` whose `debugName` matches the token's `label` is wired to the parent's icon and click command — never added as a tree child. This means hidden entries cannot displace XtabProvider from its parent.
Groups with no visible children render as non-expandable leaf items (no arrow). Groups with children render expanded.
Changes