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
Add session ID parameter to interface definitions and ActivePlan type
Dane Schneiderf3fe11dccc24
diff --git a/app/cli/types/api.go b/app/cli/types/api.goindex 4b895ba6..c0507006 100644--- a/app/cli/types/api.go+++ b/app/cli/types/api.go@@ -109,7 +109,9 @@ type ApiClient interface {ListModelPacks() ([]*shared.ModelPack, *shared.ApiError)DeleteModelPack(setId string) *shared.ApiError- GetCreditsTransactions(pageSize, pageNum int) (*shared.CreditsLogResponse, *shared.ApiError)+ GetCreditsTransactions(pageSize, pageNum int, req shared.CreditsLogRequest) (*shared.CreditsLogResponse, *shared.ApiError)+ GetCreditsSummary(req shared.CreditsLogRequest) (*shared.CreditsSummaryResponse, *shared.ApiError)+GetFileMap(req shared.GetFileMapRequest) (*shared.GetFileMapResponse, *shared.ApiError)GetContextBody(planId, branch, contextId string) (*shared.GetContextBodyResponse, *shared.ApiError)AutoLoadContext(ctx context.Context, planId, branch string, req shared.LoadContextRequest) (*shared.LoadContextResponse, *shared.ApiError)diff --git a/app/cli/types/types.go b/app/cli/types/types.goindex 3bbfc2ed..34b7774a 100644--- a/app/cli/types/types.go+++ b/app/cli/types/types.go@@ -15,6 +15,7 @@ type LoadContextParams struct {DefsOnly boolSkipIgnoreWarning boolAutoLoaded bool+ SessionId string}type ContextOutdatedResult struct {diff --git a/app/server/types/active_plan.go b/app/server/types/active_plan.goindex d85d8f5a..8629e4bb 100644--- a/app/server/types/active_plan.go+++ b/app/server/types/active_plan.go@@ -79,6 +79,7 @@ type ActivePlan struct {SkippedPaths map[string]boolStoredReplyIds []stringDidEditFiles bool+ SessionId stringsubscriptions map[string]*subscriptionsubscriptionMu sync.Mutex@@ -89,7 +90,7 @@ type ActivePlan struct {streamMessageBuffer []shared.StreamMessage}-func NewActivePlan(orgId, userId, planId, branch, prompt string, buildOnly, autoContext bool) *ActivePlan {+func NewActivePlan(orgId, userId, planId, branch, prompt string, buildOnly, autoContext bool, sessionId string) *ActivePlan {ctx, cancel := context.WithTimeout(shutdown.ShutdownCtx, ActivePlanTimeout)// child context for model stream so we can cancel it separately if neededmodelStreamCtx, cancelModelStream := context.WithCancel(ctx)@@ -122,6 +123,7 @@ func NewActivePlan(orgId, userId, planId, branch, prompt string, buildOnly, autoAutoLoadContextCh: make(chan struct{}),AllowOverwritePaths: map[string]bool{},SkippedPaths: map[string]bool{},+ SessionId: sessionId,streamCh: make(chan string),subscriptions: map[string]*subscription{},subscriptionMu: sync.Mutex{},