Skip to content

consider server commands finished vs requesting user input when appropriate#284127

Merged
meganrogge merged 2 commits intomainfrom
rational-ox
Dec 17, 2025
Merged

consider server commands finished vs requesting user input when appropriate#284127
meganrogge merged 2 commits intomainfrom
rational-ox

Conversation

@meganrogge
Copy link
Collaborator

@meganrogge meganrogge commented Dec 17, 2025

fixes #283902

Note this only works when isBackground is true as we only await command finished in that case. cc @Tyriar

Before, hanging or requesting input when we don't need it:

Screenshot 2025-12-17 at 1 07 20 PM Screenshot 2025-12-18 at 2 45 20 PM

After:

Screenshot 2025-12-17 at 1 00 56 PM

Copilot AI review requested due to automatic review settings December 17, 2025 19:07
@meganrogge meganrogge self-assigned this Dec 17, 2025
@meganrogge meganrogge added this to the December / January 2026 milestone Dec 17, 2025
@meganrogge meganrogge enabled auto-merge (squash) December 17, 2025 19:07
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

This PR fixes an issue where the terminal command monitor would hang on non-interactive help prompts that don't actually require user input. The fix introduces a new pattern detection function to identify help prompts like "press h + enter to show help" and treats them as command completion rather than requesting user input.

Key changes:

  • Added detectsNonInteractiveHelpPattern function to identify non-interactive help messages
  • Integrated early checks in the monitoring pipeline to avoid unnecessary LLM consultations for help prompts
  • Improved error handling when hiding prompt UI elements

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.ts Implements the new detectsNonInteractiveHelpPattern function with regex patterns to detect help prompts, integrates checks in _waitForIdle, _handleIdleState, and _determineUserInputOptions to short-circuit on help messages, improves error handling for prompt hiding, and fixes output fallback logic
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/outputMonitor.test.ts Adds test case verifying help prompts complete without LLM consultation, adds comprehensive regex pattern tests for the new detection function, and exports the new function for testing

@meganrogge meganrogge merged commit 8e9aaaf into main Dec 17, 2025
28 checks passed
@meganrogge meganrogge deleted the rational-ox branch December 17, 2025 21:09
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

using new workspace flow, terminal can hang

3 participants