-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix shell integration race condition (and other minor fixup/cleanup) #1660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
@ellipsis-dev try again |
|
Tested, rebased, and ready to pull |
* Update README.md * Create neat-apricots-search.md --------- Co-authored-by: Saoud Rizwan <[email protected]>
|
@cte , this pr contains a critical fix. there are the race conditions that may break some versions of vscode with terminal integration. I have fixed those in 94822a313d0f0fc90391187cfe1bfc18b9081d07 |
The command completion detection approach in PowerShell requires an output string to allow duplicate commands to execute in some versions of code. Update the string to explicitly indicate it is a Roo PowerShell workaround, making it clear in terminal output that this is intentional behavior rather than a side effect. Signed-off-by: Eric Wheeler <[email protected]>
No functional changes - purely improves error handling and logging clarity. Terminal.ts: - Handle undefined process state in setActiveStream without throwing - Add terminal IDs to all log messages for better traceability - Improve error message clarity in shell integration timeout TerminalRegistry.ts: - Reorganize shell execution event handlers for better flow - Log shell execution events before processing for reliable debugging - Add detailed context to terminal not found scenarios - Include command and execution state in error messages Signed-off-by: Eric Wheeler <[email protected]>
Users with long shell startup times were encountering "Shell Integration Unavailable" errors due to the hard-coded 4s timeout. The timeout is now configurable through Advanced Settings (1-60s). Thanks @FILTHY for troubleshooting and @kiwina for suggesting making the timeout configurable. Fixes #1654 Signed-off-by: Eric Wheeler <[email protected]>
Terminal running state is now managed in TerminalRegistry instead of Terminal to prevent race between stream close and shell completion. While this race may not trigger on current VSCode versions, newer releases with additional terminal fixes may expose the issue. This proactively prevents "Shell execution end event received, but process is not running" errors. Signed-off-by: Eric Wheeler <[email protected]>
Enhance clarity of command execution context and error reporting: - Check to see if the directory changed because of the command - Clarify execution path message - Add explicit message when command exits with non-zero code Signed-off-by: Eric Wheeler <[email protected]>
Clear guidance for the AI system on: - Working directory constraints - Path handling requirements - Tool vs terminal directory behavior Signed-off-by: Eric Wheeler <[email protected]>
|
@hannesrudolph see minor changes to clarify directory issues. |
Signed-off-by: Eric Wheeler <[email protected]>
|
@KJ7LNW - Thanks for this. I'm not 100% sure about adding a new setting though. What do you think about just making the default timeout higher? |
I have given this a lot of thought, there are two bounding problems:
Having this configurable gives us an additional troubleshooting tool when someone has an issue: We can have them turn it up and see if it fixes the issue, and if it does, it very easily confirms that it is their configuration issue. Note that the config slider will close #1654. |
Description
Made the terminal shell integration timeout configurable to resolve issues with long shell startup times. Previously, users would encounter "Shell Integration Unavailable" errors due to a hard-coded 4-second timeout. The timeout is now adjustable through Advanced Settings, allowing values from 1 to 60 seconds.
This change:
Test Procedure
Verified timeout persistence:
Tested with slow shell startup:
Verified UI functionality:
Type of Change
Pre-flight Checklist
npm test) and code is formatted and lintednpm run changesetScreenshots
Additional Notes
Thanks to:
Important
Add configurable terminal shell integration timeout to VSCode extension, adjustable via Advanced Settings UI.
terminalShellIntegrationTimeouttoTerminalclass, defaulting to 4000ms, adjustable via Advanced Settings.ClineProvider.tsto initializeTerminalwith persisted timeout value from global state.AdvancedSettings.tsxandSettingsView.tsx.AdvancedSettings.tsxforterminalShellIntegrationTimeout, range 1000-60000ms.SettingsView.tsx.terminalShellIntegrationTimeouttoExtensionStateandglobalState.ts.ExtensionStateContext.tsxto manage new setting.This description was created by
for 185e396765560052ca7c1b35647393b374428748. It will automatically update as commits are pushed.