Skip to content
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

DeepCody: Enhance error handling for disallowed shell commands #5818

Conversation

PriNova
Copy link
Collaborator

@PriNova PriNova commented Oct 5, 2024

If DeepCody tries to execute a disallowed shell command, it will remain in the `thinking' state.

This PR fixes and improves the error handling mechanism for disallowed shell commands in the getContextFileFromShell function.

Changes:

  • Relocated the disallowed command check inside the try block for better error management
  • Implemented a user-facing error message using vscode.window.showErrorMessage
  • Retained the existing error throw for maintaining consistency with error handling patterns

Test plan

  • Verified that disallowed commands trigger the new error message and DeepCody does not hang.
  • Ensured that allowed commands continue to function as expected
  • Checked that the error throw still occurs for proper error propagation

Changelog

- Move disallowed command check inside try block
- Add user-facing error message using vscode.window.showErrorMessage
- Maintain existing error throw for consistency
Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

Yeeee

@PriNova
Copy link
Collaborator Author

PriNova commented Oct 5, 2024

@abeatrix forgot biome formatting. meh

@abeatrix abeatrix enabled auto-merge (squash) October 5, 2024 01:52
@abeatrix abeatrix mentioned this pull request Oct 5, 2024
@abeatrix
Copy link
Contributor

abeatrix commented Oct 5, 2024

finally got it to run. sorry about the mess 😢

@abeatrix abeatrix merged commit 037f3e9 into sourcegraph:main Oct 5, 2024
33 of 37 checks passed
@PriNova PriNova deleted the PriNova/DeepCody_fix_disallowed_command_hangover branch October 5, 2024 09:25
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.

2 participants