test custom command, don't run shell command

This commit is contained in:
Nate Sesti 2023-07-05 01:17:58 -07:00
parent 418064ee8e
commit 461fd4df95
4 changed files with 8 additions and 9 deletions

View file

@ -71,7 +71,10 @@ class ContinueConfig(BaseModel):
allow_anonymous_telemetry: Optional[bool] = True
default_model: Literal["gpt-3.5-turbo", "gpt-3.5-turbo-16k",
"gpt-4"] = 'gpt-4'
custom_commands: Optional[List[CustomCommand]] = []
custom_commands: Optional[List[CustomCommand]] = [CustomCommand(
name="test",
prompt="Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
)]
slash_commands: Optional[List[SlashCommand]] = DEFAULT_SLASH_COMMANDS
on_traceback: Optional[List[OnTracebackSteps]] = [
OnTracebackSteps(step_name="DefaultOnTracebackStep")]

View file

@ -107,12 +107,8 @@ class RunTerminalCommandStep(Step):
description: str = "Run a terminal command."
command: str
async def describe(self, models: Models) -> Coroutine[Any, Any, Coroutine[str, None, None]]:
return f"Ran the terminal command `{self.command}`."
async def run(self, sdk: ContinueSDK):
await sdk.wait_for_user_confirmation(f"Run the following terminal command?\n\n```bash\n{self.command}\n```")
await sdk.run(self.command)
self.description = f"Copy this command and run in your terminal:\n\n```bash\n{self.command}\n```"
class ViewDirectoryTreeStep(Step):

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "0.0.108",
"version": "0.0.109",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "0.0.108",
"version": "0.0.109",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",

View file

@ -14,7 +14,7 @@
"displayName": "Continue",
"pricing": "Free",
"description": "The open-source coding autopilot",
"version": "0.0.108",
"version": "0.0.109",
"publisher": "Continue",
"engines": {
"vscode": "^1.67.0"