Skip to content

nes: log tree: fix: XtabProvider debug log tree nesting#4701

Merged
ulugbekna merged 1 commit intomainfrom
ulugbekna/fix-xtab-nesting
Mar 26, 2026
Merged

nes: log tree: fix: XtabProvider debug log tree nesting#4701
ulugbekna merged 1 commit intomainfrom
ulugbekna/fix-xtab-nesting

Conversation

@ulugbekna
Copy link
Contributor

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

  • `CapturingToken`: Removed `flattenSingleChild` and `promoteMainEntry` constructor params
  • `requestLogTree.ts`: Rewrote `getChildren()` grouping — main entries are associated directly with the parent via `setMainEntry()`, never added as children. Removed post-processing loop. `withFilteredChildren()` sets `collapsibleState` based on children count.
  • 12 caller files + 2 test files: Updated `CapturingToken` constructor args

Copilot AI review requested due to automatic review settings March 25, 2026 22:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / promoteMainEntry from CapturingToken so it’s purely a correlation token.
  • Rewrite request-log tree grouping so “main” MarkdownContentRequest entries are wired to the parent via setMainEntry() instead of being added as children and post-processed.
  • Update CapturingToken construction 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.children is incrementally appended to but never pruned. When a MarkdownContentRequest child was previously added while visible and later flips to hidden (isVisible() becomes false), the continue here prevents adding it again but does not remove the existing child, so it may remain visible in the tree. If isVisible is intended to dynamically hide entries, consider removing any existing child with the same id when skipping, or rebuilding children from 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
DonJayamanne previously approved these changes Mar 26, 2026
@ulugbekna ulugbekna added this pull request to the merge queue Mar 26, 2026
@ulugbekna ulugbekna removed this pull request from the merge queue due to a manual request Mar 26, 2026
@ulugbekna ulugbekna enabled auto-merge March 26, 2026 09:08
bpasero
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.
@ulugbekna ulugbekna force-pushed the ulugbekna/fix-xtab-nesting branch from 1c76827 to 868fb00 Compare March 26, 2026 11:41
@ulugbekna ulugbekna changed the title fix: fix XtabProvider debug log tree nesting nes: log tree: fix: XtabProvider debug log tree nesting Mar 26, 2026
@ulugbekna ulugbekna closed this Mar 26, 2026
auto-merge was automatically disabled March 26, 2026 12:43

Pull request was closed

@ulugbekna ulugbekna reopened this Mar 26, 2026
@rzhao271 rzhao271 added this pull request to the merge queue Mar 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 26, 2026
@ulugbekna ulugbekna added this pull request to the merge queue Mar 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 26, 2026
@ulugbekna ulugbekna added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 8c8400a Mar 26, 2026
26 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/fix-xtab-nesting branch March 26, 2026 18:11
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.

4 participants