Skip to content

Commit

Permalink
git retry and settings update fixes, reduce number of fix retries a l…
Browse files Browse the repository at this point in the history
…ittle.

also readme and release notes updates, plus a prompt written collaboritively with chatgpt that helped me to implement the git retry logic.
  • Loading branch information
danenania committed May 16, 2024
1 parent 6736db2 commit 42c8cb6
Show file tree
Hide file tree
Showing 6 changed files with 830 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@

## 📚  Overview

<p>Plandex is a <strong>reliable and developer-friendly</strong> AI coding agent in your terminal. Designed for <strong>real-world use-cases</strong>, Plandex is the <strong>best tool available</strong> for working on <strong>large, complex tasks</strong> in existing codebases with LLMs. It is the <strong>first</strong> AI coding tool to achieve reliable (working >90%) automatically applied file updates. The era of copy-and-paste AI coding is <strong>now over.</strong> You ain't gonna miss it.</p>
<p>Plandex is a <strong>reliable and developer-friendly</strong> AI coding agent in your terminal. Designed for <strong>real-world use-cases</strong>, Plandex is the <strong>best tool available</strong> for working on <strong>large, complex tasks</strong> in existing codebases with LLMs. The era of copy-and-paste AI coding is <strong>over.</strong> You ain't gonna miss it.</p>

<p>Though it focuses on <strong>robustness and reliability</strong> for large tasks and file updates, Plandex also excels at <strong>accelerating new projects</strong> and <strong>quick one-off tasks.</strong></p>

<p>Plandex can complete <strong>tasks that span many files and steps.</strong> It breaks up large tasks into smaller subtasks, then implements each one, continuing until it finishes the job. <strong>Build entire features and projects</strong> with a structured, version-controlled, team-friendly approach to AI-driven engineering.</p>
<p>Plandex can plan out and complete <strong>tasks that span many files and steps.</strong> It breaks up large tasks into smaller subtasks, then implements each one, continuing until it finishes the job. <strong>Build entire features and projects</strong> with a structured, version-controlled, team-friendly approach to AI-driven engineering.</p>

<p>Plandex helps you churn through your backlog, work with unfamiliar technologies, get unstuck, and <strong>spend less time on the boring stuff.</strong></p>

Expand Down
2 changes: 1 addition & 1 deletion app/server/db/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func retryGitOperation(operation func() error) error {
}

if exitError, ok := err.(*exec.ExitError); ok {
if exitError.ExitCode() == 128 && strings.Contains(string(exitError.Stderr), "unable to write new_index file") {
if exitError.ExitCode() == 128 && strings.Contains(string(exitError.Stderr), "new_index file") {
log.Printf("Retry attempt %d failed due to 'unable to write new_index file'. Waiting %v before retrying. Error: %v", attempt+1, retryInterval, err)
time.Sleep(retryInterval)
retryInterval *= 2
Expand Down
20 changes: 14 additions & 6 deletions app/server/handlers/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,31 +304,39 @@ func getUpdateCommitMsg(settings *shared.PlanSettings, originalSettings *shared.
func compareAny(a, b interface{}, path string, changes *[]string) {
aVal, bVal := reflect.ValueOf(a), reflect.ValueOf(b)

// Check if either value is invalid and return to prevent panic
// Check validity as before
if !aVal.IsValid() || !bVal.IsValid() {
return
}

// If both values are pointers, get the elements they point to
// Dereference pointers
if aVal.Kind() == reflect.Ptr && bVal.Kind() == reflect.Ptr {
aVal = aVal.Elem()
bVal = bVal.Elem()
}

// Check again for validity after dereferencing pointers
// Check validity after dereferencing
if !aVal.IsValid() || !bVal.IsValid() {
return
}

if reflect.DeepEqual(a, b) {
// Ensure we can safely call Interface()
if !aVal.CanInterface() || !bVal.CanInterface() {
return
}

if reflect.DeepEqual(aVal.Interface(), bVal.Interface()) {
return // No difference found
}

// Continue with the comparison
switch aVal.Kind() {
case reflect.Struct:
for i := 0; i < aVal.NumField(); i++ {
fieldName := aVal.Type().Field(i).Name
field := aVal.Type().Field(i)
if !field.IsExported() {
continue // Skip unexported fields
}
fieldName := field.Name
dasherizedName := shared.Dasherize(fieldName)

updatedPath := path
Expand Down
4 changes: 2 additions & 2 deletions app/server/model/plan/build_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

const MaxBuildStreamErrorRetries = 3 // uses semi-exponential backoff so be careful with this

const FixSyntaxRetries = 3
const FixSyntaxEpochs = 3
const FixSyntaxRetries = 2
const FixSyntaxEpochs = 2

type activeBuildStreamState struct {
clients map[string]*openai.Client
Expand Down
Loading

0 comments on commit 42c8cb6

Please sign in to comment.