Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves reliability of run_in_terminal output capture in the terminal chat agent tools by reducing timing races at command completion and by ensuring onCommandFinished events are correlated to the intended command via command IDs.
Changes:
- Filter
onCommandFinishedevents by requestedcommandIdin rich/basic execute strategies to ignore unrelated finish events. - Add a short “output flush” wait before placing the end marker to reduce last-line truncation races.
- Add unit tests for the new command-id matching helper.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.ts | Adds shared helpers for command-id matching and brief output-flush waiting. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.ts | Filters command-finished events by id and waits briefly before registering end marker. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.ts | Filters command-finished events by id and waits briefly before registering end marker. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.ts | Waits briefly before registering end marker to reduce truncation races. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/executeStrategy.test.ts | Adds tests for commandMatchesRequestedId. |
...bench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.ts
Show resolved
Hide resolved
.../workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
fix #297109
NOTE I COULD NOT REPRO THIS ON MAC, need to test on Windows
This fixes non-deterministic output truncation in terminal chat tool execution.
Terminal command output capture is more reliable, especially for the final lines of command output, and less susceptible to event timing races.