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
feat: add AutoLoaded flag to context loading system
Dane Schneiderbbebf887a987
diff --git a/app/cli/types/types.go b/app/cli/types/types.goindex 314ed094..3fadcbca 100644--- a/app/cli/types/types.go+++ b/app/cli/types/types.go@@ -14,6 +14,7 @@ type LoadContextParams struct {ImageDetail openai.ImageURLDetailDefsOnly boolSkipIgnoreWarning bool+ AutoLoaded bool}type ContextOutdatedResult struct {diff --git a/app/server/db/context_helpers.go b/app/server/db/context_helpers.goindex 1f180089..e393a66c 100644--- a/app/server/db/context_helpers.go+++ b/app/server/db/context_helpers.go@@ -555,6 +555,10 @@ func LoadContexts(ctx Ctx, params LoadContextsParams) (*shared.LoadContextResponcombinedBody := mappedFiles.CombinedMap()numTokens = shared.GetNumTokensEstimate(combinedBody)+ autoLoaded = autoLoaded || context.AutoLoaded++ log.Println("LoadContexts - map - autoLoaded", autoLoaded)+newContext := Context{// Id generated by db layerOrgId: orgId,@@ -570,7 +574,7 @@ func LoadContexts(ctx Ctx, params LoadContextsParams) (*shared.LoadContextResponMapParts: mappedFiles,MapShas: mapShas,MapTokens: mapTokens,- AutoLoaded: autoLoaded,+ AutoLoaded: autoLoaded || context.AutoLoaded,}mapContextsByFilePath[context.FilePath] = newContext@@ -666,7 +670,7 @@ func LoadContexts(ctx Ctx, params LoadContextsParams) (*shared.LoadContextResponBody: loadParams.Body,ForceSkipIgnore: loadParams.ForceSkipIgnore,ImageDetail: loadParams.ImageDetail,- AutoLoaded: autoLoaded,+ AutoLoaded: autoLoaded || loadParams.AutoLoaded,}}diff --git a/app/server/handlers/plans_exec.go b/app/server/handlers/plans_exec.goindex b2243c0c..537b862e 100644--- a/app/server/handlers/plans_exec.go+++ b/app/server/handlers/plans_exec.go@@ -444,6 +444,8 @@ func AutoLoadContextHandler(w http.ResponseWriter, r *http.Request) {}})+ log.Println("AutoLoadContextHandler - updated active plan")+var apiContexts []*shared.Contextfor _, dbContext := range dbContexts {apiContexts = append(apiContexts, dbContext.ToApi())