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
Fix potential race condition/goroutine explosion in context update
Dane Schneiderf90c1f69ec0d
diff --git a/app/cli/lib/context_update.go b/app/cli/lib/context_update.goindex 7d59c106..fffa7e91 100644--- a/app/cli/lib/context_update.go+++ b/app/cli/lib/context_update.go@@ -684,9 +684,9 @@ func checkOutdatedAndMaybeUpdateContext(doUpdate bool, maybeContexts []*shared.CmapFileInfoByPath[path] = fileInfo}mu.Unlock()-- innerExistenceErrCh <- nil}++ innerExistenceErrCh <- nil}(path)}@@ -753,7 +753,6 @@ func checkOutdatedAndMaybeUpdateContext(doUpdate bool, maybeContexts []*shared.C}mu.Lock()- defer mu.Unlock()totalMapPaths++@@ -767,6 +766,8 @@ func checkOutdatedAndMaybeUpdateContext(doUpdate bool, maybeContexts []*shared.Creturn}+ defer mu.Unlock()+if state.currentMapInputBatch.NumFiles()+1 > shared.ContextMapMaxBatchSize || state.totalMapSize+res.size > shared.ContextMapMaxBatchBytes {state.currentMapInputBatch = shared.FileMapInputs{}state.mapInputBatches = append(state.mapInputBatches, state.currentMapInputBatch)diff --git a/releases/cli/versions/2.0.3.md b/releases/cli/versions/2.0.3.mdnew file mode 100644index 00000000..d49196f4--- /dev/null+++ b/releases/cli/versions/2.0.3.md@@ -0,0 +1,2 @@+- Fix potential race condition/goroutine explosion/crash in context update.+- Prevent crash with negative viewport height in stream tui.