Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Agent Host missing non-PTY shell output after completion #327555

Merged
anthonykim1 merged 1 commit into
mainmicrosoft/vscode:mainfrom
anthonykim1/noRaceNoPtymicrosoft/vscode:anthonykim1/noRaceNoPtyCopy head branch name to clipboard
Jul 27, 2026
Merged

Agent Host missing non-PTY shell output after completion #327555
anthonykim1 merged 1 commit into
mainmicrosoft/vscode:mainfrom
anthonykim1/noRaceNoPtymicrosoft/vscode:anthonykim1/noRaceNoPtyCopy head branch name to clipboard

Conversation

@anthonykim1

@anthonykim1 anthonykim1 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Resolves: #327556
(Seems like race condition) - On fast commands like ls in terminal - there is issue where output goes missing "only on UI" for completed non-pty shell output.

This PR does not change runtime preview truncation behavior.

  • Detach the live non-PTY output source before completion synchronously rebuilds the terminal subpart.
  • Render the retained completion snapshot instead of leaving the completed card attached to a retired live resource.
  • Preserve explicitly empty non-PTY snapshots so silent commands show “No output was produced by the command.”
  • Keep PTY commands and non-PTY completions without a preview on their existing lifecycle.
  • Verify that the live attachment is disposed and the retained snapshot is available at the first observable completed state, without adding another state transition.
  • Cover the production PTY shape where isPty is omitted.

Verification

  • npm run typecheck-client -- --pretty false
  • npm run test-browser-no-install -- --browser chromium --sequential --run src/vs/workbench/contrib/chat/test/browser/agentSessions/stateToProgressAdapter.test.js
  • npm run test-browser-no-install -- --browser chromium --sequential --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.js
  • Manually verified fast output, silent output, and streamed output through completion without a blank frame or collapse/re-expansion.

Inspirations from:

Copilot AI review requested due to automatic review settings July 26, 2026 23:55
@anthonykim1 anthonykim1 self-assigned this Jul 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes missing completed non-PTY shell output by handing rendering from the live source to its retained snapshot.

Changes:

  • Detaches finalized live output before completion rendering.
  • Preserves empty non-PTY snapshots.
  • Adds lifecycle, ordering, and PTY-shape coverage.
Show a summary per file
File Description
agentHostSessionHandler.ts Implements the live-to-retained output handoff.
stateToProgressAdapter.ts Preserves explicit empty non-PTY snapshots.
agentHostChatContribution.test.ts Tests attachment disposal and completion ordering.
stateToProgressAdapter.test.ts Tests empty non-PTY and omitted-isPty behavior.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Medium

@anthonykim1 anthonykim1 added this to the 1.131.0 milestone Jul 27, 2026
@anthonykim1
anthonykim1 marked this pull request as ready for review July 27, 2026 00:13
@anthonykim1
anthonykim1 enabled auto-merge (squash) July 27, 2026 00:21
@anthonykim1
anthonykim1 merged commit 55fb015 into main Jul 27, 2026
30 checks passed
@anthonykim1
anthonykim1 deleted the anthonykim1/noRaceNoPty branch July 27, 2026 00:27
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.

Agent host inline terminal preview output goes missing

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.