-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixes for two potential server crashes
- Fix for server git repo remaining in locked state after a crash, which caused various issues - Fix for server git user and email not being set in some environments (#8) - Fix for 'replacements failed' error that was popping up in some circumstances - Fix for build issue that could cause large updates to fail, take too long, or use too many tokens in some circumstances - Clean up extraneous logging - Prompt update to prevent ouputting files at absolute paths (like '/etc/config.txt') - Prompt update to prevent sometimes using file block format for explanations, causing explanations to be outputted as files - Prompt update to prevent stopping before the the plan is really finished - Increase maximum number of auto-continuations to 50 (from 30)
- Loading branch information
Showing
15 changed files
with
111 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,9 @@ import ( | |
"bytes" | ||
"fmt" | ||
"log" | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
"strconv" | ||
"strings" | ||
"time" | ||
|
@@ -29,6 +31,14 @@ func InitGitRepo(orgId, planId string) error { | |
return fmt.Errorf("error initializing git repository with 'main' as default branch for dir: %s, err: %v, output: %s", dir, err, string(res)) | ||
} | ||
|
||
// Configure user name and email for the repository | ||
if err := setGitConfig(dir, "user.email", "[email protected]"); err != nil { | ||
return err | ||
} | ||
if err := setGitConfig(dir, "user.name", "Plandex"); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
|
@@ -314,3 +324,27 @@ func gitCommit(repoDir, commitMsg string) error { | |
|
||
return nil | ||
} | ||
|
||
func gitRemoveIndexLockFileIfExists(repoDir string) error { | ||
// Remove the lock file if it exists | ||
lockFilePath := filepath.Join(repoDir, ".git", "index.lock") | ||
_, err := os.Stat(lockFilePath) | ||
|
||
if err == nil { | ||
if err := os.Remove(lockFilePath); err != nil { | ||
return fmt.Errorf("error removing lock file: %v", err) | ||
} | ||
} else if !os.IsNotExist(err) { | ||
return fmt.Errorf("error checking lock file: %v", err) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func setGitConfig(repoDir, key, value string) error { | ||
res, err := exec.Command("git", "-C", repoDir, "config", key, value).CombinedOutput() | ||
if err != nil { | ||
return fmt.Errorf("error setting git config %s to %s for dir: %s, err: %v, output: %s", key, value, repoDir, err, string(res)) | ||
} | ||
return nil | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- Fixes for two potential server crashes | ||
- Fix for server git repo remaining in locked state after a crash, which caused various issues | ||
- Fix for server git user and email not being set in some environments (https://github.com/plandex-ai/plandex/issues/8) | ||
- Fix for 'replacements failed' error that was popping up in some circumstances | ||
- Fix for build issue that could cause large updates to fail, take too long, or use too many tokens in some circumstances | ||
- Clean up extraneous logging | ||
- Prompt update to prevent ouputting files at absolute paths (like '/etc/config.txt') | ||
- Prompt update to prevent sometimes using file block format for explanations, causing explanations to be outputted as files | ||
- Prompt update to prevent stopping before the the plan is really finished | ||
- Increase maximum number of auto-continuations to 50 (from 30) |