Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
make sure stack traces are included in error messages on panic. better error messages in a few other spots as well
Dane Schneider7d96539346dd
diff --git a/app/server/db/queue.go b/app/server/db/queue.goindex 233eecb0..7162b48b 100644--- a/app/server/db/queue.go+++ b/app/server/db/queue.go@@ -249,7 +249,7 @@ func (q *repoQueue) runQueue() {if panicErr != nil {log.Printf("[Queue] Panic in operation %s (%s): %v", op.id, op.reason, panicErr)log.Printf("[Queue] Stack trace: %s", string(debug.Stack()))- opErr = fmt.Errorf("panic in operation: %v", panicErr)+ opErr = fmt.Errorf("panic in operation: %v\n%s", panicErr, string(debug.Stack()))}if opErr != nil && op.scope == LockScopeWrite && op.clearRepoOnErr {diff --git a/app/server/db/transactions.go b/app/server/db/transactions.goindex 97115740..784cdeae 100644--- a/app/server/db/transactions.go+++ b/app/server/db/transactions.go@@ -32,7 +32,7 @@ func withTx(ctx context.Context, opts *sql.TxOptions, reason string, fn func(txdefer func() {panicErr := recover()if panicErr != nil {- log.Printf("panic in WithTx (%s): %v", reason, panicErr)+ log.Printf("panic in WithTx (%s): %v\n%s", reason, panicErr, debug.Stack())log.Printf("stack trace (panic - %s):\n%s", reason, debug.Stack())}diff --git a/app/server/model/plan/tell_build_pending.go b/app/server/model/plan/tell_build_pending.goindex 32123387..dce0e7dd 100644--- a/app/server/model/plan/tell_build_pending.go+++ b/app/server/model/plan/tell_build_pending.go@@ -33,7 +33,7 @@ func (state *activeTellStreamState) queuePendingBuilds() {active.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: fmt.Sprintf("Error getting pending builds by path: %v", r),+ Msg: fmt.Sprintf("Error getting pending builds by path: %v\n%s", r, debug.Stack()),}}}()@@ -47,7 +47,7 @@ func (state *activeTellStreamState) queuePendingBuilds() {active.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Error getting pending builds by path",+ Msg: fmt.Sprintf("Error getting pending builds by path: %v", err),}return}diff --git a/app/server/model/plan/tell_exec.go b/app/server/model/plan/tell_exec.goindex f757b234..96b72147 100644--- a/app/server/model/plan/tell_exec.go+++ b/app/server/model/plan/tell_exec.go@@ -116,7 +116,7 @@ func execTellPlan(params execTellPlanParams) {active.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Panic in execTellPlan",+ Msg: fmt.Sprintf("Panic in execTellPlan: %v\n%s", r, string(debug.Stack())),}}}()@@ -145,7 +145,7 @@ func execTellPlan(params execTellPlanParams) {active.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Error setting plan status to replying",+ Msg: fmt.Sprintf("Error setting plan status to replying: %v", err),}log.Printf("execTellPlan: execTellPlan operation completed for plan ID %s on branch %s, iteration %d\n", plan.Id, branch, iteration)@@ -292,7 +292,7 @@ func execTellPlan(params execTellPlanParams) {active.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: err.Error(),+ Msg: fmt.Sprintf("Error getting tell sys prompt: %v", err),}return}diff --git a/app/server/model/plan/tell_load.go b/app/server/model/plan/tell_load.goindex 0d75cd86..34fcc8b9 100644--- a/app/server/model/plan/tell_load.go+++ b/app/server/model/plan/tell_load.go@@ -334,7 +334,7 @@ func (state *activeTellStreamState) loadTellPlan() error {active.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Error loading tell plan",+ Msg: fmt.Sprintf("Error loading tell plan: %v", err),}return err}diff --git a/app/server/model/plan/tell_stream_finish.go b/app/server/model/plan/tell_stream_finish.goindex 617e0ecd..a7d1a167 100644--- a/app/server/model/plan/tell_stream_finish.go+++ b/app/server/model/plan/tell_stream_finish.go@@ -255,7 +255,7 @@ func (state *activeTellStreamState) handleStreamFinished() handleStreamFinishedRactive.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Error setting plan status to building",+ Msg: fmt.Sprintf("Error setting plan status to building: %v", err),}return handleStreamFinishedResult{diff --git a/app/server/model/plan/tell_stream_processor.go b/app/server/model/plan/tell_stream_processor.goindex ef15c63c..cbdc8a8d 100644--- a/app/server/model/plan/tell_stream_processor.go+++ b/app/server/model/plan/tell_stream_processor.go@@ -50,7 +50,7 @@ func (state *activeTellStreamState) processChunk(choice types.ExtendedChatCompleactive.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Panic in processChunk",+ Msg: fmt.Sprintf("Panic in processChunk: %v\n%s", r, string(debug.Stack())),}}}()@@ -622,7 +622,7 @@ func (state *activeTellStreamState) handleMissingFile(content, currentFile, blocactive.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Error setting plan status to prompting",+ Msg: fmt.Sprintf("Error setting plan status to prompting: %v", err),}return processChunkResult{}}diff --git a/app/server/model/plan/tell_stream_store.go b/app/server/model/plan/tell_stream_store.goindex 850ef406..c12f4b23 100644--- a/app/server/model/plan/tell_stream_store.go+++ b/app/server/model/plan/tell_stream_store.go@@ -219,7 +219,7 @@ func (state *activeTellStreamState) storeOnFinished(params storeOnFinishedParamsactive.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Error storing on finished",+ Msg: fmt.Sprintf("Error storing on finished: %v", err),}return storeOnFinishedResult{handleStreamFinishedResult: handleStreamFinishedResult{diff --git a/app/server/model/plan/tell_summary.go b/app/server/model/plan/tell_summary.goindex 95dde4a6..6bf0edbf 100644--- a/app/server/model/plan/tell_summary.go+++ b/app/server/model/plan/tell_summary.go@@ -130,7 +130,7 @@ func (state *activeTellStreamState) addConversationMessages() bool {active.StreamDoneCh <- &shared.ApiError{Type: shared.ApiErrorTypeOther,Status: http.StatusInternalServerError,- Msg: "Exceeded token limit",+ Msg: "Couldn't get under token limit with conversation summary",}return false}