Fix get_task_output empty results for background tasks while preserving single-run reused terminal behavior#304097
Merged
meganrogge merged 2 commits intomainfrom Mar 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes get_task_output returning empty output for background/watch tasks by controlling the start marker behavior used when collecting terminal buffer contents.
Changes:
- For background tasks, passes a
startMarkersByTerminalInstanceIdmap tocollectTerminalResultswith per-terminal entries set toundefinedso output reads from the current terminal buffer (instead of from a newly created end-of-buffer marker). - Preserves existing marker behavior for non-background (single-run) tasks to avoid pulling in unrelated old buffer content when terminals are reused.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.ts
Outdated
Show resolved
Hide resolved
Collaborator
Author
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Contributor
|
@meganrogge I've opened a new pull request, #304124, to work on those changes. Once the pull request is ready, I'll request review from you. |
…ng single-run reused terminal behavior (#304124)
roblourens
approved these changes
Mar 23, 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.
Fixes #304057.
get_task_outputcould return empty output even when the task terminal had content because output collection could start from a fresh marker created at read time, which for completed/background tasks can point to the end of the buffer.Now, in
getTaskOutputTool, pass a start-marker map only for background tasks. For those background/watch tasks, set each terminal entry to undefined so collection reads the current terminal buffer instead of from a newly created marker.Keep existing behavior for single-run tasks, so reused-terminal protection remains and old buffer content is not pulled in.