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
working on xml output option, reworking model options a bit, adding some additional roles, pass generationId to hook
Dane Schneiderc42d7e5ece94
diff --git a/app/cli/cmd/model_packs.go b/app/cli/cmd/model_packs.goindex 28f05734..9769d7a3 100644--- a/app/cli/cmd/model_packs.go+++ b/app/cli/cmd/model_packs.go@@ -202,13 +202,23 @@ func createModelPack(cmd *cobra.Command, args []string) {// Selecting models for each rolemp.Planner = getPlannerRoleConfig(customModels)- mp.PlanSummary = getModelRoleConfig(customModels, shared.ModelRolePlanSummary)++ contextLoader := getModelRoleConfig(customModels, shared.ModelRoleContextLoader)+ mp.ContextLoader = &contextLoader++ coder := getModelRoleConfig(customModels, shared.ModelRoleCoder)+ mp.Coder = &coder+mp.Builder = getModelRoleConfig(customModels, shared.ModelRoleBuilder)++ wholeFileBuilder := getModelRoleConfig(customModels, shared.ModelRoleWholeFileBuilder)+ mp.WholeFileBuilder = &wholeFileBuilder+mp.Namer = getModelRoleConfig(customModels, shared.ModelRoleName)mp.CommitMsg = getModelRoleConfig(customModels, shared.ModelRoleCommitMsg)++ mp.PlanSummary = getModelRoleConfig(customModels, shared.ModelRolePlanSummary)mp.ExecStatus = getModelRoleConfig(customModels, shared.ModelRoleExecStatus)- wholeFileBuilder := getModelRoleConfig(customModels, shared.ModelRoleWholeFileBuilder)- mp.WholeFileBuilder = &wholeFileBuilderterm.StartSpinner("")apiErr = api.Client.CreateModelPack(mp)diff --git a/app/cli/cmd/models.go b/app/cli/cmd/models.goindex a94de8cb..c6e1f889 100644--- a/app/cli/cmd/models.go+++ b/app/cli/cmd/models.go@@ -67,9 +67,7 @@ func createCustomModel(cmd *cobra.Command, args []string) {model := &shared.AvailableModel{BaseModelConfig: shared.BaseModelConfig{- ModelCompatibility: shared.ModelCompatibility{- IsOpenAICompatible: true,- },+ ModelCompatibility: shared.ModelCompatibility{},},}@@ -91,7 +89,7 @@ func createCustomModel(cmd *cobra.Command, args []string) {model.CustomProvider = &customProvider}- fmt.Println("For model name, be sure to enter the exact, case-sensitive name of the model as it appears in the provider's API docs. Ex: 'gpt-4-turbo', 'meta-llama/Llama-3-70b-chat-hf'")+ fmt.Println("For model name, be sure to enter the exact, case-sensitive name of the model as it appears in the provider's API docs. Ex: 'gpt-4o', 'deepseek/deepseek-chat'")modelName, err := term.GetRequiredUserStringInput("Model name:")if err != nil {term.OutputErrorAndExit("Error reading model name: %v", err)@@ -149,7 +147,7 @@ func createCustomModel(cmd *cobra.Command, args []string) {}model.MaxTokens = maxTokens- fmt.Println("'Default Max Convo Tokens' is the default maximum size a conversation can reach in the 'planner' role before it is shortened by summarization. For models with 8k context, ~2500 is recommended. For 128k context, ~10000 is recommended.")+ fmt.Println("'Default Max Convo Tokens' is the default maximum size a conversation can reach in the 'planner' role before it is shortened by summarization. For 128k context, ~10000 is recommended. For 200k context, ~15000 is recommended.")maxConvoTokensStr, err := term.GetRequiredUserStringInput("Default Max Convo Tokens:")if err != nil {term.OutputErrorAndExit("Error reading max convo tokens: %v", err)@@ -162,8 +160,8 @@ func createCustomModel(cmd *cobra.Command, args []string) {}model.DefaultMaxConvoTokens = maxConvoTokens- fmt.Println("'Default Reserved Output Tokens' is the default number of tokens reserved for model output in the 'planner', 'builder', and 'whole file builder' roles. This ensures the model has enough tokens to generate a response. For models with 8k context, ~1000 is recommended. For 128k context, ~4000 is recommended.")- reservedOutputTokensStr, err := term.GetRequiredUserStringInput("Default Reserved Output Tokens:")+ fmt.Println("'Default Reserved Output Tokens' is the default number of tokens reserved for model output in the 'planner', 'builder', and 'whole-file-builder' roles. This ensures the model has enough tokens to generate a response. Check with the model provider for the recommended value. 8k is a reasonable default for the latest models if it's not documented.")+ reservedOutputTokensStr, err := term.GetRequiredUserStringInputWithDefault("Default Reserved Output Tokens:", "8192")if err != nil {term.OutputErrorAndExit("Error reading reserved output tokens: %v", err)return@@ -175,28 +173,29 @@ func createCustomModel(cmd *cobra.Command, args []string) {}model.DefaultReservedOutputTokens = reservedOutputTokens- model.ModelCompatibility.HasStreaming, err = term.ConfirmYesNo("Is streaming supported?")- if err != nil {- term.OutputErrorAndExit("Error confirming streaming support: %v", err)- return- }- model.ModelCompatibility.HasJsonResponseMode, err = term.ConfirmYesNo("Is JSON mode supported?")- if err != nil {- term.OutputErrorAndExit("Error confirming JSON mode support: %v", err)- return+ fmt.Println("'Preferred Output Format' is the format for roles needing structured output. Currently, OpenAI models do best with 'Tool Call JSON' and other models generally do better with 'XML'. Choose 'XML' if you're unsure as it offers the widest compatibility. 'Tool Call JSON' requires tool call support and reliable JSON generation.")++ outputFormatLabels := map[string]string{+ string(shared.ModelOutputFormatXml): "XML",+ string(shared.ModelOutputFormatToolCallJson): "Tool Call JSON",}- model.ModelCompatibility.HasFunctionCalling, err = term.ConfirmYesNo("Is function calling supported?")++ res, err := term.SelectFromList("Preferred Output Format:", []string{+ outputFormatLabels[string(shared.ModelOutputFormatXml)],+ outputFormatLabels[string(shared.ModelOutputFormatToolCallJson)],+ })if err != nil {- term.OutputErrorAndExit("Error confirming function calling support: %v", err)+ term.OutputErrorAndExit("Error selecting output format: %v", err)return}- model.ModelCompatibility.HasStreamingFunctionCalls, err = term.ConfirmYesNo("Are streaming function calls supported?")- if err != nil {- term.OutputErrorAndExit("Error confirming streaming function calls support: %v", err)- return+ for key, label := range outputFormatLabels {+ if label == res {+ model.PreferredModelOutputFormat = shared.ModelOutputFormat(key)+ break+ }}- model.ModelCompatibility.HasImageSupport, err = term.ConfirmYesNo("Is multi-modal image support enabled?")+ model.HasImageSupport, err = term.ConfirmYesNo("Is multi-modal image support enabled?")if err != nil {term.OutputErrorAndExit("Error confirming image support: %v", err)return@@ -451,8 +450,11 @@ func renderSettings(settings *shared.PlanSettings) {}addModelRow(string(shared.ModelRolePlanner), modelPack.Planner.ModelRoleConfig)+ addModelRow(string(shared.ModelRoleCoder), modelPack.GetCoder())+ addModelRow(string(shared.ModelRoleContextLoader), modelPack.GetContextLoader())addModelRow(string(shared.ModelRolePlanSummary), modelPack.PlanSummary)addModelRow(string(shared.ModelRoleBuilder), modelPack.Builder)+ addModelRow(string(shared.ModelRoleWholeFileBuilder), modelPack.GetWholeFileBuilder())addModelRow(string(shared.ModelRoleName), modelPack.Namer)addModelRow(string(shared.ModelRoleCommitMsg), modelPack.CommitMsg)addModelRow(string(shared.ModelRoleExecStatus), modelPack.ExecStatus)diff --git a/app/cli/cmd/set_model.go b/app/cli/cmd/set_model.goindex 5162418c..77747a99 100644--- a/app/cli/cmd/set_model.go+++ b/app/cli/cmd/set_model.go@@ -459,6 +459,24 @@ func updateModelSettings(args []string, originalSettings *shared.PlanSettings) *settings.ModelPack.Planner.ReservedOutputTokens = *reservedOutputTokens}+ case shared.ModelRoleContextLoader:+ if selectedModel != nil {+ settings.ModelPack.ContextLoader.BaseModelConfig = selectedModel.BaseModelConfig+ } else if temperature != nil {+ settings.ModelPack.ContextLoader.Temperature = float32(*temperature)+ } else if topP != nil {+ settings.ModelPack.ContextLoader.TopP = float32(*topP)+ }++ case shared.ModelRoleCoder:+ if selectedModel != nil {+ settings.ModelPack.Coder.BaseModelConfig = selectedModel.BaseModelConfig+ } else if temperature != nil {+ settings.ModelPack.Coder.Temperature = float32(*temperature)+ } else if topP != nil {+ settings.ModelPack.Coder.TopP = float32(*topP)+ }+case shared.ModelRolePlanSummary:if selectedModel != nil {settings.ModelPack.PlanSummary.BaseModelConfig = selectedModel.BaseModelConfigdiff --git a/app/cli/term/prompt.go b/app/cli/term/prompt.goindex f94f6bec..65a44500 100644--- a/app/cli/term/prompt.go+++ b/app/cli/term/prompt.go@@ -38,6 +38,20 @@ func GetUserStringInputWithDefault(msg, def string) (string, error) {return res, err}+func GetRequiredUserStringInputWithDefault(msg, def string) (string, error) {+ res, err := GetUserStringInputWithDefault(msg, def)+ if err != nil {+ return "", fmt.Errorf("failed to get user input: %s", err)+ }++ if res == "" {+ color.New(color.Bold, ColorHiRed).Println("🚨 This input is required")+ return GetRequiredUserStringInputWithDefault(msg, def)+ }++ return res, nil+}+func GetUserPasswordInput(msg string) (string, error) {res, err := prompt.New().Ask(msg).Input("", input.WithEchoMode(input.EchoPassword))diff --git a/app/plans/json-prompts-to-xml.md b/app/plans/json-prompts-to-xml.mdindex 08a101fe..dd2c99e5 100644--- a/app/plans/json-prompts-to-xml.md+++ b/app/plans/json-prompts-to-xml.md@@ -1,4 +1,6 @@-I want to update a number of LLM calls to use XML for output instead of JSON. Here are the calls I want to update:+I want to update a number of LLM calls to potentially use XML instead of JSON-based tool calls based on their configuration in `AvailableModels` in `shared/ai_models.go`.++Here are the calls I want to update:- commit message ('genPlanDescription' call)- exec status ('execStatusShouldContinue' call)@@ -8,12 +10,14 @@ Look at 'build_exec.go' for an example of how to extract XML from a response.For each of the LLM calls:-- update the corresponding prompt - get rid of the json schema and instead update the prompts to output the same data using xml tags instead of a JSON function call. do not use XML attributes, just simple tags. if there are multiple results in the json schema for the function call, update the prompt to output multiple tags. keep the rest of the prompts exactly the same.+- Before the call, you'll need to check the model config to see if the 'PreferredModelOutputFormat' field is set to xml/tool call json. We'll need to branch all the logic and prompts based on this.++- Add new prompting to output the same data using xml tags instead of a JSON function call if the model's 'PreferredModelOutputFormat' field is set to 'Xml'. do not use XML attributes, just simple tags. if there are multiple results in the json schema for the function call, update the prompt to output multiple tags. keep the rest of the prompts exactly the same. You can refactor shared aspects of the prompts between the xml version and the tool call json version.-- look at the corresponding prompts for the build (in prompt/build.go) and use similar language for outputting xml tags.+- Look at the corresponding prompts for the build (in prompt/build.go) and use similar language for outputting xml tags in the xml versions of prompts.-- update the post LLM call handling to extract the appropriate data using xml tags instead of json.+- Update the post LLM call handling to extract the appropriate data using xml tags instead of json.-- apart from the updated prompts, do not change other parameters in the LLM calls (like model, temperature, etc.)+- Apart from the updated prompts, do not change other parameters in the LLM calls (like model, temperature, etc.)-- I don't want to have any nesting in the xml. the response should just contain multiple tags at the top level if multiple tags are needed. also, it must be clear in all cases that the output should be the content of the tag and not an attribute... brief examples must be included in every prompt as well.\ No newline at end of file+- I don't want to have any nesting in the xml. the response should just contain multiple tags at the top level if multiple tags are needed. also, it must be clear in all cases that the output should be the content of the tag and not an attribute... brief examples must be included in every prompt as well for the xml versions.\ No newline at end of filediff --git a/app/server/db/data_models.go b/app/server/db/data_models.goindex 4f8621c3..31ccb0e0 100644--- a/app/server/db/data_models.go+++ b/app/server/db/data_models.go@@ -295,52 +295,53 @@ type repoLock struct {}type ModelPack struct {- Id string `db:"id"`- OrgId string `db:"org_id"`- Name string `db:"name"`- Description string `db:"description"`- Planner shared.PlannerRoleConfig `db:"planner"`- PlanSummary shared.ModelRoleConfig `db:"plan_summary"`- Builder shared.ModelRoleConfig `db:"builder"`- Namer shared.ModelRoleConfig `db:"namer"`- CommitMsg shared.ModelRoleConfig `db:"commit_msg"`- ExecStatus shared.ModelRoleConfig `db:"exec_status"`- CreatedAt time.Time `db:"created_at"`+ Id string `db:"id"`+ OrgId string `db:"org_id"`+ Name string `db:"name"`+ Description string `db:"description"`+ Planner shared.PlannerRoleConfig `db:"planner"`+ Coder *shared.ModelRoleConfig `db:"coder"`+ PlanSummary shared.ModelRoleConfig `db:"plan_summary"`+ Builder shared.ModelRoleConfig `db:"builder"`+ Namer shared.ModelRoleConfig `db:"namer"`+ CommitMsg shared.ModelRoleConfig `db:"commit_msg"`+ ExecStatus shared.ModelRoleConfig `db:"exec_status"`+ ContextLoader *shared.ModelRoleConfig `db:"context_loader"`+ CreatedAt time.Time `db:"created_at"`}func (modelPack *ModelPack) ToApi() *shared.ModelPack {return &shared.ModelPack{- Id: modelPack.Id,- Name: modelPack.Name,- Description: modelPack.Description,- Planner: modelPack.Planner,- PlanSummary: modelPack.PlanSummary,- Builder: modelPack.Builder,- Namer: modelPack.Namer,- CommitMsg: modelPack.CommitMsg,- ExecStatus: modelPack.ExecStatus,+ Id: modelPack.Id,+ Name: modelPack.Name,+ Description: modelPack.Description,+ Planner: modelPack.Planner,+ ContextLoader: modelPack.ContextLoader,+ Coder: modelPack.Coder,+ PlanSummary: modelPack.PlanSummary,+ Builder: modelPack.Builder,+ Namer: modelPack.Namer,+ CommitMsg: modelPack.CommitMsg,+ ExecStatus: modelPack.ExecStatus,}}type AvailableModel struct {- Id string `db:"id"`- OrgId string `db:"org_id"`- Provider shared.ModelProvider `db:"provider"`- CustomProvider *string `db:"custom_provider"`- BaseUrl string `db:"base_url"`- ModelName string `db:"model_name"`- Description string `db:"description"`- MaxTokens int `db:"max_tokens"`- ApiKeyEnvVar string `db:"api_key_env_var"`- IsOpenAICompatible bool `db:"is_openai_compatible"`- HasJsonResponseMode bool `db:"has_json_mode"`- HasStreaming bool `db:"has_streaming"`- HasFunctionCalling bool `db:"has_function_calling"`- HasStreamingFunctionCalls bool `db:"has_streaming_function_calls"`- DefaultMaxConvoTokens int `db:"default_max_convo_tokens"`- DefaultReservedOutputTokens int `db:"default_reserved_output_tokens"`- CreatedAt time.Time `db:"created_at"`- UpdatedAt time.Time `db:"updated_at"`+ Id string `db:"id"`+ OrgId string `db:"org_id"`+ Provider shared.ModelProvider `db:"provider"`+ CustomProvider *string `db:"custom_provider"`+ BaseUrl string `db:"base_url"`+ ModelName string `db:"model_name"`+ Description string `db:"description"`+ MaxTokens int `db:"max_tokens"`+ ApiKeyEnvVar string `db:"api_key_env_var"`+ DefaultMaxConvoTokens int `db:"default_max_convo_tokens"`+ DefaultReservedOutputTokens int `db:"default_reserved_output_tokens"`+ HasImageSupport bool `db:"has_image_support"`+ PreferredOutputFormat shared.ModelOutputFormat `db:"preferred_output_format"`+ CreatedAt time.Time `db:"created_at"`+ UpdatedAt time.Time `db:"updated_at"`}func (model *AvailableModel) ToApi() *shared.AvailableModel {@@ -354,12 +355,9 @@ func (model *AvailableModel) ToApi() *shared.AvailableModel {MaxTokens: model.MaxTokens,ApiKeyEnvVar: model.ApiKeyEnvVar,ModelCompatibility: shared.ModelCompatibility{- IsOpenAICompatible: model.IsOpenAICompatible,- HasJsonResponseMode: model.HasJsonResponseMode,- HasStreaming: model.HasStreaming,- HasFunctionCalling: model.HasFunctionCalling,- HasStreamingFunctionCalls: model.HasStreamingFunctionCalls,- }},+ HasImageSupport: model.HasImageSupport,+ },+ },Description: model.Description,DefaultMaxConvoTokens: model.DefaultMaxConvoTokens,DefaultReservedOutputTokens: model.DefaultReservedOutputTokens,diff --git a/app/server/db/db.go b/app/server/db/db.goindex 93185b6f..bd0f48f8 100644--- a/app/server/db/db.go+++ b/app/server/db/db.go@@ -103,7 +103,7 @@ func migrationsUp(dir string) error {// Uncomment below (and update migration version) to reset migration state to a specific version after a failure// if os.Getenv("GOENV") == "development" {- // migrateVersion := 2024102200+ // migrateVersion := 2025012600// if err := m.Force(migrateVersion); err != nil {// return fmt.Errorf("error forcing migration version: %v", err)// }diff --git a/app/server/db/models.go b/app/server/db/models.goindex 4921138b..965a6a81 100644--- a/app/server/db/models.go+++ b/app/server/db/models.go@@ -5,10 +5,10 @@ import ()func CreateCustomModel(model *AvailableModel) error {- query := `INSERT INTO custom_models (org_id, provider, custom_provider, base_url, model_name, description, max_tokens, api_key_env_var, is_openai_compatible, has_json_mode, has_streaming, has_function_calling, has_streaming_function_calls, default_max_convo_tokens, default_reserved_output_tokens) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)+ query := `INSERT INTO custom_models (org_id, provider, custom_provider, base_url, model_name, description, max_tokens, api_key_env_var, default_max_convo_tokens, default_reserved_output_tokens, preferred_output_format, has_image_support) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)RETURNING id, created_at, updated_at`- err := Conn.QueryRow(query, model.OrgId, model.Provider, model.CustomProvider, model.BaseUrl, model.ModelName, model.Description, model.MaxTokens, model.ApiKeyEnvVar, model.IsOpenAICompatible, model.HasJsonResponseMode, model.HasStreaming, model.HasFunctionCalling, model.HasStreamingFunctionCalls, model.DefaultMaxConvoTokens, model.DefaultReservedOutputTokens).Scan(&model.Id, &model.CreatedAt, &model.UpdatedAt)+ err := Conn.QueryRow(query, model.OrgId, model.Provider, model.CustomProvider, model.BaseUrl, model.ModelName, model.Description, model.MaxTokens, model.ApiKeyEnvVar, model.DefaultMaxConvoTokens, model.DefaultReservedOutputTokens, model.PreferredOutputFormat, model.HasImageSupport).Scan(&model.Id, &model.CreatedAt, &model.UpdatedAt)if err != nil {return fmt.Errorf("error inserting new custom model: %v", err)@@ -43,10 +43,10 @@ func DeleteAvailableModel(modelId string) error {}func CreateModelPack(ms *ModelPack) error {- query := `INSERT INTO model_sets (org_id, name, description, planner, plan_summary, builder, namer, commit_msg, exec_status) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)+ query := `INSERT INTO model_sets (org_id, name, description, planner, plan_summary, builder, namer, commit_msg, exec_status, context_loader, coder) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)RETURNING id, created_at`- err := Conn.QueryRow(query, ms.OrgId, ms.Name, ms.Description, ms.Planner, ms.PlanSummary, ms.Builder, ms.Namer, ms.CommitMsg, ms.ExecStatus).Scan(&ms.Id, &ms.CreatedAt)+ err := Conn.QueryRow(query, ms.OrgId, ms.Name, ms.Description, ms.Planner, ms.PlanSummary, ms.Builder, ms.Namer, ms.CommitMsg, ms.ExecStatus, ms.ContextLoader, ms.Coder).Scan(&ms.Id, &ms.CreatedAt)if err != nil {return fmt.Errorf("error inserting new model pack: %v", err)diff --git a/app/server/handlers/client_helper.go b/app/server/handlers/client_helper.goindex a90d67a8..e0f57f13 100644--- a/app/server/handlers/client_helper.go+++ b/app/server/handlers/client_helper.go@@ -69,6 +69,11 @@ func initClients(params initClientsParams) map[string]*openai.Client {continue}+ if planSettings.ModelPack.GetCoder().BaseModelConfig.ApiKeyEnvVar == envVar {+ endpointsByApiKeyEnvVar[envVar] = planSettings.ModelPack.GetCoder().BaseModelConfig.BaseUrl+ continue+ }+if planSettings.ModelPack.PlanSummary.BaseModelConfig.ApiKeyEnvVar == envVar {endpointsByApiKeyEnvVar[envVar] = planSettings.ModelPack.PlanSummary.BaseModelConfig.BaseUrlcontinue@@ -98,6 +103,16 @@ func initClients(params initClientsParams) map[string]*openai.Client {endpointsByApiKeyEnvVar[envVar] = planSettings.ModelPack.GetWholeFileBuilder().BaseModelConfig.BaseUrlcontinue}++ if planSettings.ModelPack.GetContextLoader().BaseModelConfig.ApiKeyEnvVar == envVar {+ endpointsByApiKeyEnvVar[envVar] = planSettings.ModelPack.GetContextLoader().BaseModelConfig.BaseUrl+ continue+ }++ if planSettings.ModelPack.GetCoder().BaseModelConfig.ApiKeyEnvVar == envVar {+ endpointsByApiKeyEnvVar[envVar] = planSettings.ModelPack.GetCoder().BaseModelConfig.BaseUrl+ continue+ }}if len(apiKeys) == 0 {diff --git a/app/server/handlers/context_helper.go b/app/server/handlers/context_helper.goindex c2713f40..3cdf1618 100644--- a/app/server/handlers/context_helper.go+++ b/app/server/handlers/context_helper.go@@ -42,11 +42,13 @@ func loadContexts(}var err error+var settings *shared.PlanSettings- var client *openai.Client+ var clients map[string]*openai.Clientfor _, context := range *loadReq {if context.ContextType == shared.ContextPipedDataType || context.ContextType == shared.ContextNoteType || context.ContextType == shared.ContextImageType {+settings, err = db.GetPlanSettings(plan, true)if err != nil {@@ -55,7 +57,7 @@ func loadContexts(return nil, nil}- clients := initClients(+ clients = initClients(initClientsParams{w: w,auth: auth,@@ -66,9 +68,6 @@ func loadContexts(},)- envVar := settings.ModelPack.Namer.BaseModelConfig.ApiKeyEnvVar- client = clients[envVar]-break}}@@ -92,7 +91,7 @@ func loadContexts(num++go func(context *shared.LoadContextParams) {- name, err := model.GenPipedDataName(auth, plan, settings, client, context.Body)+ name, err := model.GenPipedDataName(auth, plan, settings, clients, context.Body)if err != nil {errCh <- fmt.Errorf("error generating name for piped data: %v", err)@@ -105,7 +104,7 @@ func loadContexts(num++go func(context *shared.LoadContextParams) {- name, err := model.GenNoteName(auth, plan, settings, client, context.Body)+ name, err := model.GenNoteName(auth, plan, settings, clients, context.Body)if err != nil {errCh <- fmt.Errorf("error generating name for note: %v", err)diff --git a/app/server/handlers/models.go b/app/server/handlers/models.goindex 69439645..a902d3a2 100644--- a/app/server/handlers/models.go+++ b/app/server/handlers/models.go@@ -33,11 +33,7 @@ func CreateCustomModelHandler(w http.ResponseWriter, r *http.Request) {ModelName: model.ModelName,MaxTokens: model.MaxTokens,ApiKeyEnvVar: model.ApiKeyEnvVar,- IsOpenAICompatible: model.IsOpenAICompatible,- HasJsonResponseMode: model.HasJsonResponseMode,- HasStreaming: model.HasStreaming,- HasFunctionCalling: model.HasFunctionCalling,- HasStreamingFunctionCalls: model.HasStreamingFunctionCalls,+ HasImageSupport: model.HasImageSupport,DefaultMaxConvoTokens: model.DefaultMaxConvoTokens,DefaultReservedOutputTokens: model.DefaultReservedOutputTokens,}@@ -108,15 +104,16 @@ func CreateModelPackHandler(w http.ResponseWriter, r *http.Request) {}dbMs := &db.ModelPack{- OrgId: auth.OrgId,- Name: ms.Name,- Description: ms.Description,- Planner: ms.Planner,- PlanSummary: ms.PlanSummary,- Builder: ms.Builder,- Namer: ms.Namer,- CommitMsg: ms.CommitMsg,- ExecStatus: ms.ExecStatus,+ OrgId: auth.OrgId,+ Name: ms.Name,+ Description: ms.Description,+ PlanSummary: ms.PlanSummary,+ Builder: ms.Builder,+ Namer: ms.Namer,+ CommitMsg: ms.CommitMsg,+ ExecStatus: ms.ExecStatus,+ ContextLoader: ms.ContextLoader,+ Coder: ms.Coder,}if err := db.CreateModelPack(dbMs); err != nil {diff --git a/app/server/handlers/plans_changes.go b/app/server/handlers/plans_changes.goindex 4d14bbee..8a97dc97 100644--- a/app/server/handlers/plans_changes.go+++ b/app/server/handlers/plans_changes.go@@ -146,10 +146,7 @@ func ApplyPlanHandler(w http.ResponseWriter, r *http.Request) {},)- envVar := settings.ModelPack.CommitMsg.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]-- s, err := modelPlan.GenCommitMsgForPendingResults(auth, plan, client, settings, currentPlan, r.Context())+ s, err := modelPlan.GenCommitMsgForPendingResults(auth, plan, clients, settings, currentPlan, r.Context())if err != nil {log.Printf("Error generating commit message: %v\n", err)diff --git a/app/server/hooks/hooks.go b/app/server/hooks/hooks.goindex c78341cf..bbcbe531 100644--- a/app/server/hooks/hooks.go+++ b/app/server/hooks/hooks.go@@ -38,6 +38,7 @@ type DidSendModelRequestParams struct {ModelRole shared.ModelRoleModelPackName stringPurpose string+ GenerationId string}type CreateOrgHookRequestParams struct {diff --git a/app/server/migrations/2025012600_update_custom_models.down.sql b/app/server/migrations/2025012600_update_custom_models.down.sqlnew file mode 100644index 00000000..aeb400b1--- /dev/null+++ b/app/server/migrations/2025012600_update_custom_models.down.sql@@ -0,0 +1,9 @@+ALTER TABLE custom_models DROP COLUMN preferred_output_format;++ALTER TABLE custom_models ADD COLUMN has_streaming BOOLEAN NOT NULL DEFAULT FALSE;+ALTER TABLE custom_models ADD COLUMN has_function_calling BOOLEAN NOT NULL DEFAULT FALSE;+ALTER TABLE custom_models ADD COLUMN has_streaming_function_calls BOOLEAN NOT NULL DEFAULT FALSE;+ALTER TABLE custom_models ADD COLUMN has_json_mode BOOLEAN NOT NULL DEFAULT FALSE;+ALTER TABLE custom_models ADD COLUMN is_openai_compatible BOOLEAN NOT NULL DEFAULT FALSE;++ALTER TABLE custom_models DROP COLUMN has_image_support;diff --git a/app/server/migrations/2025012600_update_custom_models.up.sql b/app/server/migrations/2025012600_update_custom_models.up.sqlnew file mode 100644index 00000000..2da54831--- /dev/null+++ b/app/server/migrations/2025012600_update_custom_models.up.sql@@ -0,0 +1,9 @@+ALTER TABLE custom_models ADD COLUMN preferred_output_format VARCHAR(32) NOT NULL DEFAULT 'xml';++ALTER TABLE custom_models DROP COLUMN has_streaming_function_calls;+ALTER TABLE custom_models DROP COLUMN has_json_mode;+ALTER TABLE custom_models DROP COLUMN has_streaming;+ALTER TABLE custom_models DROP COLUMN has_function_calling;+ALTER TABLE custom_models DROP COLUMN is_openai_compatible;++ALTER TABLE custom_models ADD COLUMN has_image_support BOOLEAN NOT NULL DEFAULT FALSE;\ No newline at end of filediff --git a/app/server/model/client.go b/app/server/model/client.goindex 661f339f..d2d99670 100644--- a/app/server/model/client.go+++ b/app/server/model/client.go@@ -8,6 +8,7 @@ import ("strings""time"+ "github.com/plandex/plandex/shared""github.com/sashabaranov/go-openai")@@ -43,10 +44,23 @@ func newClient(apiKey, endpoint, orgId string) *openai.Client {}func CreateChatCompletionStreamWithRetries(- client *openai.Client,+ clients map[string]*openai.Client,+ modelConfig *shared.ModelRoleConfig,ctx context.Context,req openai.ChatCompletionRequest,) (*openai.ChatCompletionStream, error) {+ client := clients[modelConfig.BaseModelConfig.ApiKeyEnvVar]++ if client == nil {+ return nil, fmt.Errorf("client not found for api key env var: %s", modelConfig.BaseModelConfig.ApiKeyEnvVar)+ }++ resolveReq(&req, modelConfig)++ for _, msg := range req.Messages {+ log.Println("Message role:", msg.Role)+ }+return createChatCompletionStream(client, ctx, req, 0)}@@ -60,6 +74,8 @@ func createChatCompletionStream(return nil, ctx.Err()}+ log.Println("Creating chat completion stream")+stream, err := client.CreateChatCompletionStream(ctx, req)if err != nil {@@ -98,10 +114,19 @@ func createChatCompletionStream(}func CreateChatCompletionWithRetries(- client *openai.Client,+ clients map[string]*openai.Client,+ modelConfig *shared.ModelRoleConfig,ctx context.Context,req openai.ChatCompletionRequest,) (openai.ChatCompletionResponse, error) {+ client := clients[modelConfig.BaseModelConfig.ApiKeyEnvVar]++ if client == nil {+ return openai.ChatCompletionResponse{}, fmt.Errorf("client not found for api key env var: %s", modelConfig.BaseModelConfig.ApiKeyEnvVar)+ }++ resolveReq(&req, modelConfig)+return createChatCompletion(client, ctx, req, 0)}@@ -206,3 +231,30 @@ func parseRetryAfter(errorMessage string) *time.Duration {}return nil}++func resolveReq(req *openai.ChatCompletionRequest, modelConfig *shared.ModelRoleConfig) {+ log.Println("Resolving request")+ // if system prompt is disabled, change the role of the system message to user+ if modelConfig.BaseModelConfig.SystemPromptDisabled {+ log.Println("System prompt disabled - changing role of system message to user")+ for i, msg := range req.Messages {+ log.Println("Message role:", msg.Role)+ if msg.Role == openai.ChatMessageRoleSystem {+ log.Println("Changing role of system message to user")+ req.Messages[i].Role = openai.ChatMessageRoleUser+ }+ }++ for _, msg := range req.Messages {+ log.Println("Final message role:", msg.Role)+ }+ }++ if modelConfig.BaseModelConfig.RoleParamsDisabled {+ log.Println("Role params disabled - setting temperature and top p to 1")+ req.Temperature = 1+ req.TopP = 1+ }++ log.Println("Resolved request")+}diff --git a/app/server/model/name.go b/app/server/model/name.goindex e6c18be9..9c1fd1ee 100644--- a/app/server/model/name.go+++ b/app/server/model/name.go@@ -18,7 +18,7 @@ func GenPlanName(auth *types.ServerAuth,plan *db.Plan,settings *shared.PlanSettings,- client *openai.Client,+ clients map[string]*openai.Client,planContent string,ctx context.Context,) (string, error) {@@ -34,11 +34,6 @@ func GenPlanName(numTokens := shared.GetMessagesTokenEstimate(messages...) + shared.TokensPerRequest- var responseFormat *openai.ChatCompletionResponseFormat- if config.BaseModelConfig.HasJsonResponseMode {- responseFormat = &openai.ChatCompletionResponseFormat{Type: "json_object"}- }-_, apiErr := hooks.ExecHook(hooks.WillSendModelRequest, hooks.HookParams{Auth: auth,Plan: plan,@@ -53,7 +48,8 @@ func GenPlanName(}resp, err := CreateChatCompletionWithRetries(- client,+ clients,+ &config,ctx,openai.ChatCompletionRequest{Model: config.BaseModelConfig.ModelName,@@ -69,10 +65,9 @@ func GenPlanName(Name: prompts.PlanNameFn.Name,},},- Temperature: config.Temperature,- TopP: config.TopP,- Messages: messages,- ResponseFormat: responseFormat,+ Temperature: config.Temperature,+ TopP: config.TopP,+ Messages: messages,},)@@ -103,19 +98,26 @@ func GenPlanName(outputTokens = shared.GetNumTokensEstimate(res)}- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: inputTokens,- OutputTokens: outputTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: settings.ModelPack.Name,- ModelRole: shared.ModelRolePlanSummary,- Purpose: "Generated plan name",- },- })+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: inputTokens,+ OutputTokens: outputTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: settings.ModelPack.Name,+ ModelRole: shared.ModelRolePlanSummary,+ Purpose: "Generated plan name",+ GenerationId: resp.ID,+ },+ })++ if apiErr != nil {+ log.Printf("GenPlanName - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if res == "" {fmt.Println("no namePlan function call found in response")@@ -138,7 +140,7 @@ func GenPipedDataName(auth *types.ServerAuth,plan *db.Plan,settings *shared.PlanSettings,- client *openai.Client,+ clients map[string]*openai.Client,pipedContent string,) (string, error) {config := settings.ModelPack.Namer@@ -154,11 +156,6 @@ func GenPipedDataName(numTokens := shared.GetMessagesTokenEstimate(messages...) + shared.TokensPerRequest- var responseFormat *openai.ChatCompletionResponseFormat- if config.BaseModelConfig.HasJsonResponseMode {- responseFormat = &openai.ChatCompletionResponseFormat{Type: "json_object"}- }-_, apiErr := hooks.ExecHook(hooks.WillSendModelRequest, hooks.HookParams{Auth: auth,Plan: plan,@@ -181,7 +178,8 @@ func GenPipedDataName(// log.Println(spew.Sdump(messages))resp, err := CreateChatCompletionWithRetries(- client,+ clients,+ &config,context.Background(),openai.ChatCompletionRequest{Model: config.BaseModelConfig.ModelName,@@ -197,10 +195,9 @@ func GenPipedDataName(Name: prompts.PipedDataNameFn.Name,},},- Temperature: config.Temperature,- TopP: config.TopP,- Messages: messages,- ResponseFormat: responseFormat,+ Temperature: config.Temperature,+ TopP: config.TopP,+ Messages: messages,},)@@ -231,23 +228,26 @@ func GenPipedDataName(outputTokens = shared.GetNumTokensEstimate(res)}- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: inputTokens,- OutputTokens: outputTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: settings.ModelPack.Name,- ModelRole: shared.ModelRolePlanSummary,- Purpose: "Generated name for data piped into context",- },- })+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: inputTokens,+ OutputTokens: outputTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: settings.ModelPack.Name,+ ModelRole: shared.ModelRolePlanSummary,+ Purpose: "Generated name for data piped into context",+ GenerationId: resp.ID,+ },+ })- if apiErr != nil {- return "", fmt.Errorf("error executing hook: %v", apiErr)- }+ if apiErr != nil {+ log.Printf("GenPipedDataName - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if res == "" {fmt.Println("no namePipedData function call found in response")@@ -270,7 +270,7 @@ func GenNoteName(auth *types.ServerAuth,plan *db.Plan,settings *shared.PlanSettings,- client *openai.Client,+ clients map[string]*openai.Client,note string,) (string, error) {config := settings.ModelPack.Namer@@ -286,11 +286,6 @@ func GenNoteName(numTokens := shared.GetMessagesTokenEstimate(messages...) + shared.TokensPerRequest- var responseFormat *openai.ChatCompletionResponseFormat- if config.BaseModelConfig.HasJsonResponseMode {- responseFormat = &openai.ChatCompletionResponseFormat{Type: "json_object"}- }-_, apiErr := hooks.ExecHook(hooks.WillSendModelRequest, hooks.HookParams{Auth: auth,Plan: plan,@@ -313,7 +308,8 @@ func GenNoteName(// log.Println(spew.Sdump(messages))resp, err := CreateChatCompletionWithRetries(- client,+ clients,+ &config,context.Background(),openai.ChatCompletionRequest{Model: config.BaseModelConfig.ModelName,@@ -329,10 +325,9 @@ func GenNoteName(Name: prompts.NoteNameFn.Name,},},- Temperature: config.Temperature,- TopP: config.TopP,- Messages: messages,- ResponseFormat: responseFormat,+ Temperature: config.Temperature,+ TopP: config.TopP,+ Messages: messages,},)@@ -363,23 +358,26 @@ func GenNoteName(outputTokens = shared.GetNumTokensEstimate(res)}- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: inputTokens,- OutputTokens: outputTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: settings.ModelPack.Name,- ModelRole: shared.ModelRolePlanSummary,- Purpose: "Generated name for note added to context",- },- })+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: inputTokens,+ OutputTokens: outputTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: settings.ModelPack.Name,+ ModelRole: shared.ModelRolePlanSummary,+ Purpose: "Generated name for note added to context",+ GenerationId: resp.ID,+ },+ })- if apiErr != nil {- return "", fmt.Errorf("error executing hook: %v", apiErr)- }+ if apiErr != nil {+ log.Printf("GenNoteName - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if res == "" {fmt.Println("no nameNote function call found in response")diff --git a/app/server/model/plan/build_structured_edits.go b/app/server/model/plan/build_structured_edits.goindex b4945829..12dcefa8 100644--- a/app/server/model/plan/build_structured_edits.go+++ b/app/server/model/plan/build_structured_edits.go@@ -167,10 +167,7 @@ func (fileState *activeBuildStreamFileState) buildStructuredEdits() {Stop: []string{"<PlandexFinish/>"},}- envVar := config.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]-- resp, err := model.CreateChatCompletionWithRetries(client, activePlan.Ctx, modelReq)+ resp, err := model.CreateChatCompletionWithRetries(clients, &config, activePlan.Ctx, modelReq)if err != nil {log.Printf("buildStructuredEdits - error calling model: %v\n", err)@@ -181,24 +178,26 @@ func (fileState *activeBuildStreamFileState) buildStructuredEdits() {log.Println("buildStructuredEdits - usage:")log.Println(spew.Sdump(resp.Usage))- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: fileState.plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: resp.Usage.PromptTokens,- OutputTokens: resp.Usage.CompletionTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: fileState.settings.ModelPack.Name,- ModelRole: shared.ModelRoleBuilder,- Purpose: "File edit (structured edits)",- },- })-- if apiErr != nil {- activePlan.StreamDoneCh <- apiErr- return- }+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: fileState.plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: resp.Usage.PromptTokens,+ OutputTokens: resp.Usage.CompletionTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: fileState.settings.ModelPack.Name,+ ModelRole: shared.ModelRoleBuilder,+ Purpose: "File edit (structured edits)",+ GenerationId: resp.ID,+ },+ })++ if apiErr != nil {+ log.Printf("buildStructuredEdits - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if len(resp.Choices) == 0 {log.Printf("buildStructuredEdits - no choices in response\n")@@ -219,24 +218,27 @@ func (fileState *activeBuildStreamFileState) buildStructuredEdits() {break}- fixedDesc := GetXMLContent(content, "PlandexProposedUpdatesExplanation")+ log.Printf("buildStructuredEdits - %s incorrect diffs\n", filePath)+ log.Println(diff)++ // fixedDesc := GetXMLContent(content, "PlandexProposedUpdatesExplanation")// log.Println("buildStructuredEdits - fixed desc xml string:")// log.Println(fixedDescString)- if fixedDesc != "" {- desc = fixedDesc- }+ // if fixedDesc != "" {+ // desc = fixedDesc+ // }replacement := GetXMLContent(content, "PlandexReplacement")if replacement == "" {log.Printf("buildStructuredEdits - no PlandexReplacement tag found in content\n")- if fixedDesc != "" {- fileState.structuredEditRetryOrError(fmt.Errorf("no PlandexReplacement tag found in content"))- return- }+ // if fixedDesc != "" {+ // fileState.structuredEditRetryOrError(fmt.Errorf("no PlandexReplacement tag found in content"))+ // return+ // }isValid = truebreak@@ -267,6 +269,8 @@ func (fileState *activeBuildStreamFileState) buildStructuredEdits() {// handle replacementupdatedFile = strings.Replace(updatedFile, replaceOld, replaceNew, 1)+ log.Printf("buildStructuredEdits - %s - executed replacement - updatedFile:\n%s\n", filePath, updatedFile)+// validate updated file syntaxvalidateSyntax()diff --git a/app/server/model/plan/build_whole_file.go b/app/server/model/plan/build_whole_file.goindex afef2748..e37694a3 100644--- a/app/server/model/plan/build_whole_file.go+++ b/app/server/model/plan/build_whole_file.go@@ -68,10 +68,7 @@ func (fileState *activeBuildStreamFileState) buildWholeFileFallback(proposedContTopP: config.TopP,}- envVar := config.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]-- resp, err := model.CreateChatCompletionWithRetries(client, activePlan.Ctx, modelReq)+ resp, err := model.CreateChatCompletionWithRetries(clients, &config, activePlan.Ctx, modelReq)if err != nil {log.Printf("buildWholeFile - error calling model: %v\n", err)@@ -82,24 +79,26 @@ func (fileState *activeBuildStreamFileState) buildWholeFileFallback(proposedContlog.Println("buildWholeFile - usage:")log.Println(spew.Sdump(resp.Usage))- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: fileState.plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: resp.Usage.PromptTokens,- OutputTokens: resp.Usage.CompletionTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: fileState.settings.ModelPack.Name,- ModelRole: shared.ModelRoleBuilder,- Purpose: "File edit (whole file)",- },- })-- if apiErr != nil {- activePlan.StreamDoneCh <- apiErr- return- }+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: fileState.plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: resp.Usage.PromptTokens,+ OutputTokens: resp.Usage.CompletionTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: fileState.settings.ModelPack.Name,+ ModelRole: shared.ModelRoleBuilder,+ Purpose: "File edit (whole file)",+ GenerationId: resp.ID,+ },+ })++ if apiErr != nil {+ log.Printf("buildWholeFile - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if len(resp.Choices) == 0 {log.Printf("buildWholeFile - no choices in response\n")diff --git a/app/server/model/plan/commit_msg.go b/app/server/model/plan/commit_msg.goindex bbc20363..bff747ed 100644--- a/app/server/model/plan/commit_msg.go+++ b/app/server/model/plan/commit_msg.go@@ -12,6 +12,7 @@ import ("plandex-server/model/prompts""plandex-server/types"+ "github.com/davecgh/go-spew/spew""github.com/plandex/plandex/shared""github.com/sashabaranov/go-openai")@@ -24,19 +25,12 @@ func (state *activeTellStreamState) genPlanDescription() (*db.ConvoMessageDescrisettings := state.settingsclients := state.clientsconfig := settings.ModelPack.CommitMsg- envVar := config.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]activePlan := GetActivePlan(planId, branch)if activePlan == nil {return nil, fmt.Errorf("active plan not found")}- var responseFormat *openai.ChatCompletionResponseFormat- if config.BaseModelConfig.HasJsonResponseMode {- responseFormat = &openai.ChatCompletionResponseFormat{Type: "json_object"}- }-messages := []openai.ChatCompletionMessage{{Role: openai.ChatMessageRoleSystem,@@ -66,7 +60,8 @@ func (state *activeTellStreamState) genPlanDescription() (*db.ConvoMessageDescrilog.Println("Sending plan description model request")descResp, err := model.CreateChatCompletionWithRetries(- client,+ clients,+ &config,activePlan.Ctx,openai.ChatCompletionRequest{Model: config.BaseModelConfig.ModelName,@@ -82,10 +77,9 @@ func (state *activeTellStreamState) genPlanDescription() (*db.ConvoMessageDescriName: prompts.DescribePlanFn.Name,},},- Messages: messages,- Temperature: config.Temperature,- TopP: config.TopP,- ResponseFormat: responseFormat,+ Messages: messages,+ Temperature: config.Temperature,+ TopP: config.TopP,},)@@ -120,28 +114,32 @@ func (state *activeTellStreamState) genPlanDescription() (*db.ConvoMessageDescrilog.Println("Sending DidSendModelRequest hook")- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: inputTokens,- OutputTokens: outputTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: settings.ModelPack.Name,- ModelRole: shared.ModelRoleCommitMsg,- Purpose: "Generated commit message for suggested changes",- },- })-- if apiErr != nil {- return nil, errors.New(apiErr.Msg)- }+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: inputTokens,+ OutputTokens: outputTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: settings.ModelPack.Name,+ ModelRole: shared.ModelRoleCommitMsg,+ Purpose: "Generated commit message for suggested changes",+ GenerationId: descResp.ID,+ },+ })- log.Println("DidSendModelRequest hook complete")+ if apiErr != nil {+ log.Printf("genPlanDescription - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if descStrRes == "" {fmt.Println("no describePlan function call found in response")++ spew.Dump(descResp)+return nil, fmt.Errorf("No describePlan function call found in response. This usually means the model failed to generate a valid response.")}@@ -159,7 +157,7 @@ func (state *activeTellStreamState) genPlanDescription() (*db.ConvoMessageDescri}, nil}-func GenCommitMsgForPendingResults(auth *types.ServerAuth, plan *db.Plan, client *openai.Client, settings *shared.PlanSettings, current *shared.CurrentPlanState, ctx context.Context) (string, error) {+func GenCommitMsgForPendingResults(auth *types.ServerAuth, plan *db.Plan, clients map[string]*openai.Client, settings *shared.PlanSettings, current *shared.CurrentPlanState, ctx context.Context) (string, error) {config := settings.ModelPack.CommitMsgs := ""@@ -205,7 +203,8 @@ func GenCommitMsgForPendingResults(auth *types.ServerAuth, plan *db.Plan, client}resp, err := model.CreateChatCompletionWithRetries(- client,+ clients,+ &config,ctx,openai.ChatCompletionRequest{Model: config.BaseModelConfig.ModelName,@@ -248,6 +247,7 @@ func GenCommitMsgForPendingResults(auth *types.ServerAuth, plan *db.Plan, clientModelPackName: settings.ModelPack.Name,ModelRole: shared.ModelRoleCommitMsg,Purpose: "Generated commit message for pending changes",+ GenerationId: resp.ID,},})diff --git a/app/server/model/plan/exec_status.go b/app/server/model/plan/exec_status.goindex a89ba2be..34c29d52 100644--- a/app/server/model/plan/exec_status.go+++ b/app/server/model/plan/exec_status.go@@ -23,9 +23,6 @@ func (state *activeTellStreamState) execStatusShouldContinue(message string, ctxclients := state.clientsconfig := settings.ModelPack.ExecStatus- envVar := config.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]-log.Println("Checking if plan should continue based on response text")if state.currentSubtask != nil {@@ -73,13 +70,9 @@ func (state *activeTellStreamState) execStatusShouldContinue(message string, ctx// log.Println("messages:")// log.Println(spew.Sdump(messages))- var responseFormat *openai.ChatCompletionResponseFormat- if config.BaseModelConfig.HasJsonResponseMode {- responseFormat = &openai.ChatCompletionResponseFormat{Type: "json_object"}- }-resp, err := model.CreateChatCompletionWithRetries(- client,+ clients,+ &config,ctx,openai.ChatCompletionRequest{Model: config.BaseModelConfig.ModelName,@@ -95,10 +88,9 @@ func (state *activeTellStreamState) execStatusShouldContinue(message string, ctxName: prompts.ShouldAutoContinueFn.Name,},},- Messages: messages,- ResponseFormat: responseFormat,- Temperature: config.Temperature,- TopP: config.TopP,+ Messages: messages,+ Temperature: config.Temperature,+ TopP: config.TopP,},)@@ -132,23 +124,26 @@ func (state *activeTellStreamState) execStatusShouldContinue(message string, ctxoutputTokens = shared.GetNumTokensEstimate(strRes)}- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: inputTokens,- OutputTokens: outputTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: settings.ModelPack.Name,- ModelRole: shared.ModelRolePlanSummary,- Purpose: "Evaluate if plan should auto-continue",- },- })+ go func() {+ _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: inputTokens,+ OutputTokens: outputTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: settings.ModelPack.Name,+ ModelRole: shared.ModelRolePlanSummary,+ Purpose: "Evaluate if plan should auto-continue",+ GenerationId: resp.ID,+ },+ })- if apiErr != nil {- return false, false, fmt.Errorf("error executing hook: %v", apiErr)- }+ if apiErr != nil {+ log.Printf("execStatusShouldContinue - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if strRes == "" {log.Println("No shouldAutoContinue function call found in response")diff --git a/app/server/model/plan/tell_context.go b/app/server/model/plan/tell_context.goindex f02dfdcc..f2aa46f0 100644--- a/app/server/model/plan/tell_context.go+++ b/app/server/model/plan/tell_context.go@@ -25,10 +25,9 @@ func (state *activeTellStreamState) formatModelContext(includeMaps, includeTreesfor _, path := range state.currentSubtask.UsesFiles {uses[path] = true}+ log.Printf("Tell plan - formatModelContext - uses: %v\n", uses)}- log.Printf("Tell plan - formatModelContext - implementation stage - smart context enabled for current subtask - uses: %v\n", uses)-for _, part := range state.modelContext {if isImplementationStage && smartContextEnabled && state.currentSubtask != nil && part.ContextType == shared.ContextFileType && !uses[part.FilePath] {continuediff --git a/app/server/model/plan/tell_exec.go b/app/server/model/plan/tell_exec.goindex c7df5cd0..391128e0 100644--- a/app/server/model/plan/tell_exec.go+++ b/app/server/model/plan/tell_exec.go@@ -12,6 +12,7 @@ import ("plandex-server/model/prompts""plandex-server/types"+ "github.com/davecgh/go-spew/spew""github.com/google/uuid""github.com/plandex/plandex/shared""github.com/sashabaranov/go-openai"@@ -279,27 +280,36 @@ func execTellPlan(params execTellPlanParams) {}var stop []string+ var modelConfig shared.ModelRoleConfigif isPlanningStage {stop = []string{"<EndPlandexTasks/>"}+ modelConfig = state.settings.ModelPack.Planner.ModelRoleConfigif isFollowUp {+ log.Println("Tell plan - isFollowUp - setting stop to <PlandexDecideContext/>")stop = append(stop, "<PlandexDecideContext/>")+ } else if isContextStage {+ log.Println("Tell plan - isContextStage - setting modelConfig to context loader")+ modelConfig = state.settings.ModelPack.GetContextLoader()}} else if isImplementationStage {stop = []string{"<PlandexSubtaskDone/>"}+ modelConfig = state.settings.ModelPack.GetCoder()}- log.Println("Stop:", stop)+ // log.Println("Stop:", stop)// spew.Dump(state.messages)+ log.Println("modelConfig:", spew.Sdump(modelConfig))+modelReq := openai.ChatCompletionRequest{- Model: state.settings.ModelPack.Planner.BaseModelConfig.ModelName,+ Model: modelConfig.BaseModelConfig.ModelName,Messages: state.messages,Stream: true,StreamOptions: &openai.StreamOptions{IncludeUsage: true,},- Temperature: state.settings.ModelPack.Planner.Temperature,- TopP: state.settings.ModelPack.Planner.TopP,+ Temperature: modelConfig.Temperature,+ TopP: modelConfig.TopP,Stop: stop,}@@ -314,10 +324,7 @@ func execTellPlan(params execTellPlanParams) {// log.Printf("Error marshaling model request to JSON: %v\n", err)// }- envVar := state.settings.ModelPack.Planner.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]-- stream, err := model.CreateChatCompletionStreamWithRetries(client, active.ModelStreamCtx, modelReq)+ stream, err := model.CreateChatCompletionStreamWithRetries(clients, &modelConfig, active.ModelStreamCtx, modelReq)if err != nil {log.Printf("Error starting reply stream: %v\n", err)diff --git a/app/server/model/plan/tell_load.go b/app/server/model/plan/tell_load.goindex 9b2506ed..ca3d8b34 100644--- a/app/server/model/plan/tell_load.go+++ b/app/server/model/plan/tell_load.go@@ -77,14 +77,11 @@ func (state *activeTellStreamState) loadTellPlan() error {settings = resif plan.Name == "draft" {- envVar := settings.ModelPack.Namer.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]-name, err := model.GenPlanName(auth,plan,settings,- client,+ clients,req.Prompt,active.Ctx,)diff --git a/app/server/model/plan/tell_state.go b/app/server/model/plan/tell_state.goindex aa70b23b..d859d84d 100644--- a/app/server/model/plan/tell_state.go+++ b/app/server/model/plan/tell_state.go@@ -49,6 +49,8 @@ type activeTellStreamState struct {isFollowUp boolchunkProcessor *chunkProcessor++ generationId string}type chunkProcessor struct {diff --git a/app/server/model/plan/tell_stream_finish.go b/app/server/model/plan/tell_stream_finish.goindex 2bace61a..3a8033ba 100644--- a/app/server/model/plan/tell_stream_finish.go+++ b/app/server/model/plan/tell_stream_finish.go@@ -89,12 +89,9 @@ func (state *activeTellStreamState) handleStreamFinished() handleStreamFinishedR// summarize convo needs to come *after* the reply is stored in order to correctly summarize the latest messagelog.Println("summarize convo")- envVar := settings.ModelPack.PlanSummary.BaseModelConfig.ApiKeyEnvVar- client := clients[envVar]-// summarize in the backgroundgo func() {- err := summarizeConvo(client, settings.ModelPack.PlanSummary, summarizeConvoParams{+ err := summarizeConvo(clients, settings.ModelPack.PlanSummary, summarizeConvoParams{auth: auth,plan: plan,branch: branch,diff --git a/app/server/model/plan/tell_stream_main.go b/app/server/model/plan/tell_stream_main.goindex f3c840db..db4eae86 100644--- a/app/server/model/plan/tell_stream_main.go+++ b/app/server/model/plan/tell_stream_main.go@@ -82,6 +82,10 @@ mainLoop:return}+ if response.ID != "" && state.generationId == "" {+ state.generationId = response.ID+ }+if response.Usage != nil {state.handleUsageChunk(response.Usage)returndiff --git a/app/server/model/plan/tell_stream_usage.go b/app/server/model/plan/tell_stream_usage.goindex b0b5d46b..7e00d21f 100644--- a/app/server/model/plan/tell_stream_usage.go+++ b/app/server/model/plan/tell_stream_usage.go@@ -10,44 +10,37 @@ import ()func (state *activeTellStreamState) handleUsageChunk(usage *openai.Usage) {- planId := state.plan.Id- branch := state.branchauth := state.authplan := state.plan+ generationId := state.generationIdlog.Println("Tell stream usage:")log.Println(spew.Sdump(usage))- _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: usage.PromptTokens,- OutputTokens: usage.CompletionTokens,- ModelName: state.settings.ModelPack.Planner.BaseModelConfig.ModelName,- ModelProvider: state.settings.ModelPack.Planner.BaseModelConfig.Provider,- ModelPackName: state.settings.ModelPack.Name,- ModelRole: shared.ModelRolePlanner,- Purpose: "Generated plan reply",- },- })-- if apiErr != nil {- log.Printf("Tell stream: error executing did send model request hook: %v\n", apiErr)-- // ensure the active plan is still available- activePlan := GetActivePlan(planId, branch)-- if activePlan == nil {- log.Printf(" Active plan not found for plan ID %s on branch %s\n", planId, branch)- return+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: usage.PromptTokens,+ OutputTokens: usage.CompletionTokens,+ ModelName: state.settings.ModelPack.Planner.BaseModelConfig.ModelName,+ ModelProvider: state.settings.ModelPack.Planner.BaseModelConfig.Provider,+ ModelPackName: state.settings.ModelPack.Name,+ ModelRole: shared.ModelRolePlanner,+ Purpose: "Generated plan reply",+ GenerationId: generationId,+ },+ })++ if apiErr != nil {+ log.Printf("handleUsageChunk - error executing DidSendModelRequest hook: %v", apiErr)}-- activePlan.StreamDoneCh <- apiErr- }+ }()}func (state *activeTellStreamState) execHookOnStop(sendStreamErr bool) {+ generationId := state.generationIdlog.Printf("execHookOnStop - sendStreamErr: %t\n", sendStreamErr)@@ -62,32 +55,25 @@ func (state *activeTellStreamState) execHookOnStop(sendStreamErr bool) {return}- _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: auth,- Plan: plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: state.totalRequestTokens,- OutputTokens: active.NumTokens,- ModelName: state.settings.ModelPack.Planner.BaseModelConfig.ModelName,- ModelProvider: state.settings.ModelPack.Planner.BaseModelConfig.Provider,- ModelPackName: state.settings.ModelPack.Name,- ModelRole: shared.ModelRolePlanner,- Purpose: "Generated plan reply",- },- })-- if apiErr != nil {- log.Printf("Error executing did send model request hook after cancel or error: %v\n", apiErr)-- if sendStreamErr {- activePlan := GetActivePlan(planId, branch)-- if activePlan == nil {- log.Printf(" Active plan not found for plan ID %s on branch %s\n", planId, branch)- return- }-- activePlan.StreamDoneCh <- apiErr+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: auth,+ Plan: plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: state.totalRequestTokens,+ OutputTokens: active.NumTokens,+ ModelName: state.settings.ModelPack.Planner.BaseModelConfig.ModelName,+ ModelProvider: state.settings.ModelPack.Planner.BaseModelConfig.Provider,+ ModelPackName: state.settings.ModelPack.Name,+ ModelRole: shared.ModelRolePlanner,+ Purpose: "Generated plan reply (stopped)",+ GenerationId: generationId,+ },+ })++ if apiErr != nil {+ log.Printf("execHookOnStop - error executing DidSendModelRequest hook: %v", apiErr)}- }+ }()+}diff --git a/app/server/model/plan/tell_summary.go b/app/server/model/plan/tell_summary.goindex fb02b603..8a0813c0 100644--- a/app/server/model/plan/tell_summary.go+++ b/app/server/model/plan/tell_summary.go@@ -197,7 +197,7 @@ type summarizeConvoParams struct {modelPackName string}-func summarizeConvo(client *openai.Client, config shared.ModelRoleConfig, params summarizeConvoParams, ctx context.Context) error {+func summarizeConvo(clients map[string]*openai.Client, config shared.ModelRoleConfig, params summarizeConvoParams, ctx context.Context) error {plan := params.planplanId := plan.Idlog.Printf("summarizeConvo: Called for plan ID %s on branch %s\n", planId, params.branch)@@ -316,7 +316,7 @@ func summarizeConvo(client *openai.Client, config shared.ModelRoleConfig, params// latestSummaryCh := make(chan *db.ConvoSummary, 1)// active.LatestSummaryCh = latestSummaryCh- summary, err := model.PlanSummary(client, config, model.PlanSummaryParams{+ summary, err := model.PlanSummary(clients, config, model.PlanSummaryParams{Conversation: summaryMessages,ConversationNumTokens: numTokens,LatestConvoMessageId: latestMessageId,diff --git a/app/server/model/prompts/context_load.go b/app/server/model/prompts/context_load.goindex 124e0404..1987d1a3 100644--- a/app/server/model/prompts/context_load.go+++ b/app/server/model/prompts/context_load.go@@ -15,7 +15,7 @@ In response to the user's latest prompt, do the following:- In a section titled '### Context Categories', list one or more categories of context that are relevant to the user's task, question, or message. For example, if the user is asking you to implement an API endpoint, you might list 'API endpoints', 'database operations', 'frontend code', 'utilities', and so on. Make sure any and all relevant categories are included, but don't include more categories than necessary—if only a single category is relevant, then only list that one. Do not include file paths, symbols, or explanations—only the categories.- - Using the map and file tree in context, output a '### Relevant Symbols' list of potentially relevant *symbols* (like functions, methods, types, variables, etc.) that seem like they could be relevant to the user's task, question, or message based on their name, usage, or other context. Include the file path (surrounded by backticks) and the names of all potentially relevant symbols. File paths *absolutely must* be surrounded by backticks like this: ` + "`" + "path/to/file.go" + "`" + `. Any symbols that are referred to in the user's prompt must be included. You MUST organize the list by category using the categories from the '### Context Categories' section—ensure each category is represented in the list. When listing symbols, output just the name of the symbol, not it's full signature (e.g. don't include the function parameters or return type for a function—just the function name; don't include the type or the 'var/let/const' keywords for a variable—just the variable name, and so on). Output the symbols as a comma separated list in a single paragraph for each file. You MUST include relevant symbols (and associated file paths) for each category from the '### Context Categories' section.+ - Using the map and file tree in context, output a '### Files' list of potentially relevant *symbols* (like functions, methods, types, variables, etc.) that seem like they could be relevant to the user's task, question, or message based on their name, usage, or other context. Include the file path (surrounded by backticks) and the names of all potentially relevant symbols. File paths *absolutely must* be surrounded by backticks like this: ` + "`" + "path/to/file.go" + "`" + `. Any symbols that are referred to in the user's prompt must be included. You MUST organize the list by category using the categories from the '### Context Categories' section—ensure each category is represented in the list. When listing symbols, output just the name of the symbol, not it's full signature (e.g. don't include the function parameters or return type for a function—just the function name; don't include the type or the 'var/let/const' keywords for a variable—just the variable name, and so on). Output the symbols as a comma separated list in a single paragraph for each file. You MUST include relevant symbols (and associated file paths) for each category from the '### Context Categories' section. Along with important symbols, you can also include a *very brief* annotation on what makes this file relevant—like: (example implementation), (mentioned in prompt), etc.` + ContextLoadingRules + `@@ -23,7 +23,7 @@ In response to the user's latest prompt, do the following:` + ContextCompletionCriteria + `-After outputting the '### Relevant Symbols' section, end your response. Do not output any additional text after that section.+After outputting the '### Files' section, end your response. Do not output any additional text after that section.IMPORTANT: During this context loading phase, you must NOT implement any code or create any code blocks. This phase is ONLY for identifying relevant context.@@ -63,7 +63,7 @@ const ContextLoadingRules = `When assessing relevant context, you MUST follow thRemember: It's better to load more context than you need than to miss an important file. If you're not sure whether a file will be helpful, include it.`-const FileMapScanningRules = `When considering relevant categories in the '### Context Categories' and relevant symbols in the '### Relevant Symbols' sections:+const FileMapScanningRules = `When considering relevant categories in the '### Context Categories' and relevant symbols in the '### Files' sections:1. Look for naming patterns:- Files with similar prefixes or suffixes@@ -83,7 +83,7 @@ const FileMapScanningRules = `When considering relevant categories in the '### C* Related type definitionsExample: For 'api/methods.go', look for 'types/api.go', 'api/methods_test.go'`-const ContextCompletionCriteria = `When considering relevant categories in the '### Context Categories' and relevant symbols in the '### Relevant Symbols' sections, make sure to include:+const ContextCompletionCriteria = `When considering relevant categories in the '### Context Categories' and relevant symbols in the '### Files' sections, make sure to include:1. ALL interface files for any implementations2. ALL type definitions related to the task or promptdiff --git a/app/server/model/summarize.go b/app/server/model/summarize.goindex f8fb5423..8f50dc18 100644--- a/app/server/model/summarize.go+++ b/app/server/model/summarize.go@@ -4,6 +4,7 @@ import ("context""errors""fmt"+ "log""plandex-server/db""plandex-server/hooks""plandex-server/model/prompts"@@ -27,7 +28,7 @@ type PlanSummaryParams struct {NumMessages int}-func PlanSummary(client *openai.Client, config shared.ModelRoleConfig, params PlanSummaryParams, ctx context.Context) (*db.ConvoSummary, error) {+func PlanSummary(clients map[string]*openai.Client, config shared.ModelRoleConfig, params PlanSummaryParams, ctx context.Context) (*db.ConvoSummary, error) {messages := []openai.ChatCompletionMessage{{Role: openai.ChatMessageRoleSystem,@@ -63,7 +64,8 @@ func PlanSummary(client *openai.Client, config shared.ModelRoleConfig, params Pl// spew.Dump(messages)resp, err := CreateChatCompletionWithRetries(- client,+ clients,+ &config,ctx,openai.ChatCompletionRequest{Model: config.BaseModelConfig.ModelName,@@ -95,19 +97,26 @@ func PlanSummary(client *openai.Client, config shared.ModelRoleConfig, params PloutputTokens = shared.GetNumTokensEstimate(content)}- _, apiErr = hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{- Auth: params.Auth,- Plan: params.Plan,- DidSendModelRequestParams: &hooks.DidSendModelRequestParams{- InputTokens: inputTokens,- OutputTokens: outputTokens,- ModelName: config.BaseModelConfig.ModelName,- ModelProvider: config.BaseModelConfig.Provider,- ModelPackName: params.ModelPackName,- ModelRole: shared.ModelRolePlanSummary,- Purpose: "Generated plan summary",- },- })+ go func() {+ _, apiErr := hooks.ExecHook(hooks.DidSendModelRequest, hooks.HookParams{+ Auth: params.Auth,+ Plan: params.Plan,+ DidSendModelRequestParams: &hooks.DidSendModelRequestParams{+ InputTokens: inputTokens,+ OutputTokens: outputTokens,+ ModelName: config.BaseModelConfig.ModelName,+ ModelProvider: config.BaseModelConfig.Provider,+ ModelPackName: params.ModelPackName,+ ModelRole: shared.ModelRolePlanSummary,+ Purpose: "Generated plan summary",+ GenerationId: resp.ID,+ },+ })++ if apiErr != nil {+ log.Printf("PlanSummary - error executing DidSendModelRequest hook: %v", apiErr)+ }+ }()if apiErr != nil {return nil, errors.New(apiErr.Msg)diff --git a/app/shared/ai_models.go b/app/shared/ai_models.goindex 479c830b..8ba46af2 100644--- a/app/shared/ai_models.go+++ b/app/shared/ai_models.go@@ -8,21 +8,7 @@ const OpenAIEnvVar = "OPENAI_API_KEY"const OpenAIV1BaseUrl = "https://api.openai.com/v1"var fullCompatibility = ModelCompatibility{- IsOpenAICompatible: true,- HasJsonResponseMode: true,- HasStreaming: true,- HasFunctionCalling: true,- HasStreamingFunctionCalls: true,- HasImageSupport: true,-}--var fullCompatibilityExceptImage = ModelCompatibility{- IsOpenAICompatible: true,- HasJsonResponseMode: true,- HasStreaming: true,- HasFunctionCalling: true,- HasStreamingFunctionCalls: true,- HasImageSupport: false,+ HasImageSupport: true,}var AvailableModels = []*AvailableModel{@@ -31,12 +17,13 @@ var AvailableModels = []*AvailableModel{DefaultMaxConvoTokens: 10000,DefaultReservedOutputTokens: 16384,BaseModelConfig: BaseModelConfig{- Provider: ModelProviderOpenAI,- ModelName: openai.GPT4o,- MaxTokens: 128000,- ApiKeyEnvVar: OpenAIEnvVar,- ModelCompatibility: fullCompatibility,- BaseUrl: OpenAIV1BaseUrl,+ Provider: ModelProviderOpenAI,+ ModelName: openai.GPT4o,+ MaxTokens: 128000,+ ApiKeyEnvVar: OpenAIEnvVar,+ ModelCompatibility: fullCompatibility,+ BaseUrl: OpenAIV1BaseUrl,+ PreferredModelOutputFormat: ModelOutputFormatToolCallJson,},},{@@ -44,12 +31,45 @@ var AvailableModels = []*AvailableModel{DefaultMaxConvoTokens: 10000,DefaultReservedOutputTokens: 16384,BaseModelConfig: BaseModelConfig{- Provider: ModelProviderOpenAI,- ModelName: "gpt-4o-mini",- MaxTokens: 128000,- ApiKeyEnvVar: OpenAIEnvVar,- ModelCompatibility: fullCompatibility,- BaseUrl: OpenAIV1BaseUrl,+ Provider: ModelProviderOpenAI,+ ModelName: "gpt-4o-mini",+ MaxTokens: 128000,+ ApiKeyEnvVar: OpenAIEnvVar,+ ModelCompatibility: fullCompatibility,+ BaseUrl: OpenAIV1BaseUrl,+ PreferredModelOutputFormat: ModelOutputFormatToolCallJson,+ },+ },+ {+ Description: "OpenAI's latest o1-mini model",+ DefaultMaxConvoTokens: 10000,+ DefaultReservedOutputTokens: 65536,+ BaseModelConfig: BaseModelConfig{+ Provider: ModelProviderOpenAI,+ ModelName: "o1-mini",+ MaxTokens: 128000,+ ApiKeyEnvVar: OpenAIEnvVar,+ ModelCompatibility: fullCompatibility,+ BaseUrl: OpenAIV1BaseUrl,+ PreferredModelOutputFormat: ModelOutputFormatXml,+ SystemPromptDisabled: true,+ RoleParamsDisabled: true,+ },+ },+ {+ Description: "OpenAI's latest o1 model",+ DefaultMaxConvoTokens: 15000,+ DefaultReservedOutputTokens: 100000,+ BaseModelConfig: BaseModelConfig{+ Provider: ModelProviderOpenAI,+ ModelName: "o1",+ MaxTokens: 200000,+ ApiKeyEnvVar: OpenAIEnvVar,+ ModelCompatibility: fullCompatibility,+ BaseUrl: OpenAIV1BaseUrl,+ PreferredModelOutputFormat: ModelOutputFormatXml,+ SystemPromptDisabled: true,+ RoleParamsDisabled: true,},},{@@ -57,19 +77,13 @@ var AvailableModels = []*AvailableModel{DefaultMaxConvoTokens: 15000,DefaultReservedOutputTokens: 8192,BaseModelConfig: BaseModelConfig{- Provider: ModelProviderOpenRouter,- ModelName: "anthropic/claude-3.5-sonnet",- MaxTokens: 200000,- ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],- ModelCompatibility: ModelCompatibility{- IsOpenAICompatible: true,- HasJsonResponseMode: true,- HasStreaming: true,- HasFunctionCalling: true,- HasStreamingFunctionCalls: false,- HasImageSupport: true,- },- BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ Provider: ModelProviderOpenRouter,+ ModelName: "anthropic/claude-3.5-sonnet",+ MaxTokens: 200000,+ ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],+ ModelCompatibility: fullCompatibility,+ BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ PreferredModelOutputFormat: ModelOutputFormatXml,},},{@@ -77,79 +91,89 @@ var AvailableModels = []*AvailableModel{DefaultMaxConvoTokens: 15000,DefaultReservedOutputTokens: 8192,BaseModelConfig: BaseModelConfig{- Provider: ModelProviderOpenRouter,- ModelName: "anthropic/claude-3.5-haiku",- MaxTokens: 200000,- ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],- ModelCompatibility: ModelCompatibility{- IsOpenAICompatible: true,- HasJsonResponseMode: true,- HasStreaming: true,- HasFunctionCalling: true,- HasStreamingFunctionCalls: false,- HasImageSupport: true,- },- BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ Provider: ModelProviderOpenRouter,+ ModelName: "anthropic/claude-3.5-haiku",+ MaxTokens: 200000,+ ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],+ ModelCompatibility: fullCompatibility,+ BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ PreferredModelOutputFormat: ModelOutputFormatXml,},},{Description: "Google Gemini Pro 1.5 via OpenRouter",DefaultMaxConvoTokens: 100000,- DefaultReservedOutputTokens: 32768,+ DefaultReservedOutputTokens: 8192,BaseModelConfig: BaseModelConfig{- Provider: ModelProviderOpenRouter,- ModelName: "google/gemini-pro-1.5",- MaxTokens: 4000000,- ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],- ModelCompatibility: ModelCompatibility{- IsOpenAICompatible: true,- HasJsonResponseMode: true,- HasStreaming: true,- HasFunctionCalling: true,- HasStreamingFunctionCalls: false,- HasImageSupport: true,- },- BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ Provider: ModelProviderOpenRouter,+ ModelName: "google/gemini-pro-1.5",+ MaxTokens: 2000000,+ ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],+ ModelCompatibility: fullCompatibility,+ BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ PreferredModelOutputFormat: ModelOutputFormatXml,},},{Description: "Google Gemini Flash 1.5 via OpenRouter",- DefaultMaxConvoTokens: 100000,- DefaultReservedOutputTokens: 32768,+ DefaultMaxConvoTokens: 75000,+ DefaultReservedOutputTokens: 8192,+ BaseModelConfig: BaseModelConfig{+ Provider: ModelProviderOpenRouter,+ ModelName: "google/gemini-flash-1.5",+ MaxTokens: 1000000,+ ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],+ ModelCompatibility: fullCompatibility,+ BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ PreferredModelOutputFormat: ModelOutputFormatXml,+ },+ },+ {+ Description: "Google Gemini Flash 2.0 Experimental via OpenRouter",+ DefaultMaxConvoTokens: 75000,+ DefaultReservedOutputTokens: 8192,+ BaseModelConfig: BaseModelConfig{+ Provider: ModelProviderOpenRouter,+ ModelName: "google/gemini-2.0-flash-exp:free",+ MaxTokens: 1000000,+ ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],+ ModelCompatibility: fullCompatibility,+ BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ PreferredModelOutputFormat: ModelOutputFormatXml,+ },+ },++ {+ Description: "DeepSeek V3 via OpenRouter",+ DefaultMaxConvoTokens: 7500,+ DefaultReservedOutputTokens: 8192,BaseModelConfig: BaseModelConfig{Provider: ModelProviderOpenRouter,- ModelName: "google/gemini-flash-1.5",- MaxTokens: 4000000,+ ModelName: "deepseek/deepseek-chat",+ MaxTokens: 64000,ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],ModelCompatibility: ModelCompatibility{- IsOpenAICompatible: true,- HasJsonResponseMode: true,- HasStreaming: true,- HasFunctionCalling: true,- HasStreamingFunctionCalls: false,- HasImageSupport: true,+ HasImageSupport: false,},- BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ PreferredModelOutputFormat: ModelOutputFormatXml,},},+{- Description: "DeepSeek V2.5 via OpenRouter",- DefaultMaxConvoTokens: 15000,- DefaultReservedOutputTokens: 4096,+ Description: "DeepSeek R1 via OpenRouter",+ DefaultMaxConvoTokens: 7500,+ DefaultReservedOutputTokens: 8192,BaseModelConfig: BaseModelConfig{Provider: ModelProviderOpenRouter,- ModelName: "deepseek/deepseek-chat",- MaxTokens: 128000,+ ModelName: "deepseek/deepseek-r1",+ MaxTokens: 64000,ApiKeyEnvVar: ApiKeyByProvider[ModelProviderOpenRouter],ModelCompatibility: ModelCompatibility{- IsOpenAICompatible: true,- HasJsonResponseMode: true,- HasStreaming: true,- HasFunctionCalling: true,- HasStreamingFunctionCalls: false,- HasImageSupport: false,+ HasImageSupport: false,},- BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ BaseUrl: BaseUrlByProvider[ModelProviderOpenRouter],+ PreferredModelOutputFormat: ModelOutputFormatXml,},},}@@ -181,6 +205,14 @@ var DefaultConfigByRole = map[ModelRole]ModelRoleConfig{Temperature: 0.3,TopP: 0.3,},+ ModelRoleCoder: {+ Temperature: 0.3,+ TopP: 0.3,+ },+ ModelRoleContextLoader: {+ Temperature: 0.3,+ TopP: 0.3,+ },ModelRolePlanSummary: {Temperature: 0.2,TopP: 0.2,@@ -208,28 +240,12 @@ var DefaultConfigByRole = map[ModelRole]ModelRoleConfig{}var RequiredCompatibilityByRole = map[ModelRole]ModelCompatibility{- ModelRolePlanner: {- IsOpenAICompatible: true,- HasStreaming: true,- },- ModelRolePlanSummary: {- IsOpenAICompatible: true,- HasStreaming: true,- },- ModelRoleBuilder: {- IsOpenAICompatible: true,- },- ModelRoleName: {- IsOpenAICompatible: true,- },- ModelRoleCommitMsg: {- IsOpenAICompatible: true,- HasFunctionCalling: true,- },- ModelRoleExecStatus: {- IsOpenAICompatible: true,- HasFunctionCalling: true,- },+ ModelRolePlanner: {},+ ModelRolePlanSummary: {},+ ModelRoleBuilder: {},+ ModelRoleName: {},+ ModelRoleCommitMsg: {},+ ModelRoleExecStatus: {},}func init() {@@ -283,7 +299,7 @@ func init() {OpenRouterClaude3Dot5SonnetGPT4oModelPack = ModelPack{Name: "plandex-default-pack",- Description: "Uses Anthropic's Claude 3.5 Sonnet model (via OpenRouter) for planning, summarization, diff-based edits, and auto-continue, OpenAI gpt-4o for whole-file edits, and gpt-4o-mini for lighter tasks.",+ Description: "Uses Anthropic's Claude 3.5 Sonnet model (via OpenRouter) for planning, coding, and diff-based edits, OpenAI gpt-4o for whole-file edits, and gpt-4o-mini for lighter tasks.",Planner: PlannerRoleConfig{ModelRoleConfig: ModelRoleConfig{Role: ModelRolePlanner,@@ -293,6 +309,27 @@ func init() {},PlannerModelConfig: getPlannerModelConfig("anthropic/claude-3.5-sonnet"),},+ // Planner: PlannerRoleConfig{+ // ModelRoleConfig: ModelRoleConfig{+ // Role: ModelRolePlanner,+ // BaseModelConfig: AvailableModelsByName["google/gemini-pro-1.5"].BaseModelConfig,+ // Temperature: DefaultConfigByRole[ModelRolePlanner].Temperature,+ // TopP: DefaultConfigByRole[ModelRolePlanner].TopP,+ // },+ // PlannerModelConfig: getPlannerModelConfig("google/gemini-pro-1.5"),+ // },+ Coder: &ModelRoleConfig{+ Role: ModelRoleCoder,+ BaseModelConfig: AvailableModelsByName["anthropic/claude-3.5-sonnet"].BaseModelConfig,+ Temperature: DefaultConfigByRole[ModelRoleCoder].Temperature,+ TopP: DefaultConfigByRole[ModelRoleCoder].TopP,+ },+ ContextLoader: &ModelRoleConfig{+ Role: ModelRoleContextLoader,+ BaseModelConfig: AvailableModelsByName["anthropic/claude-3.5-sonnet"].BaseModelConfig,+ Temperature: DefaultConfigByRole[ModelRoleContextLoader].Temperature,+ TopP: DefaultConfigByRole[ModelRoleContextLoader].TopP,+ },PlanSummary: ModelRoleConfig{Role: ModelRolePlanSummary,BaseModelConfig: AvailableModelsByName["gpt-4o-mini"].BaseModelConfig,@@ -375,71 +412,14 @@ func init() {},}- GoogleGeminiModelPack = ModelPack{- Name: "google-gemini",- Description: "Uses Google's Gemini Pro 1.5 model for heavy lifting and Gemini Flash 1.5 for lighter tasks.",- Planner: PlannerRoleConfig{- ModelRoleConfig: ModelRoleConfig{- Role: ModelRolePlanner,- BaseModelConfig: AvailableModelsByName["google/gemini-pro-1.5"].BaseModelConfig,- Temperature: DefaultConfigByRole[ModelRolePlanner].Temperature,- TopP: DefaultConfigByRole[ModelRolePlanner].TopP,- },- PlannerModelConfig: getPlannerModelConfig("google/gemini-pro-1.5"),- },- PlanSummary: ModelRoleConfig{- Role: ModelRolePlanSummary,- BaseModelConfig: AvailableModelsByName["google/gemini-pro-1.5"].BaseModelConfig,- Temperature: DefaultConfigByRole[ModelRolePlanSummary].Temperature,- TopP: DefaultConfigByRole[ModelRolePlanSummary].TopP,- },- Builder: ModelRoleConfig{- Role: ModelRoleBuilder,- BaseModelConfig: AvailableModelsByName["google/gemini-pro-1.5"].BaseModelConfig,- Temperature: DefaultConfigByRole[ModelRoleBuilder].Temperature,- TopP: DefaultConfigByRole[ModelRoleBuilder].TopP,- },- Namer: ModelRoleConfig{- Role: ModelRoleName,- BaseModelConfig: AvailableModelsByName["google/gemini-flash-1.5"].BaseModelConfig,- Temperature: DefaultConfigByRole[ModelRoleName].Temperature,- TopP: DefaultConfigByRole[ModelRoleName].TopP,- },- CommitMsg: ModelRoleConfig{- Role: ModelRoleCommitMsg,- BaseModelConfig: AvailableModelsByName["google/gemini-flash-1.5"].BaseModelConfig,- Temperature: DefaultConfigByRole[ModelRoleCommitMsg].Temperature,- TopP: DefaultConfigByRole[ModelRoleCommitMsg].TopP,- },- ExecStatus: ModelRoleConfig{- Role: ModelRoleExecStatus,- BaseModelConfig: AvailableModelsByName["google/gemini-pro-1.5"].BaseModelConfig,- Temperature: DefaultConfigByRole[ModelRoleExecStatus].Temperature,- TopP: DefaultConfigByRole[ModelRoleExecStatus].TopP,- },- }}func FilterCompatibleModels(models []*AvailableModel, role ModelRole) []*AvailableModel {- required := RequiredCompatibilityByRole[role]+ // required := RequiredCompatibilityByRole[role]var compatibleModels []*AvailableModelfor _, model := range models {- if required.IsOpenAICompatible && !model.ModelCompatibility.IsOpenAICompatible {- continue- }- if required.HasJsonResponseMode && !model.ModelCompatibility.HasJsonResponseMode {- continue- }- if required.HasStreaming && !model.ModelCompatibility.HasStreaming {- continue- }- if required.HasFunctionCalling && !model.ModelCompatibility.HasFunctionCalling {- continue- }- if required.HasStreamingFunctionCalls && !model.ModelCompatibility.HasStreamingFunctionCalls {- continue- }+ // no compatibility checks are needed in v2, but keeping this here in case compatibility checks are needed in the futurecompatibleModels = append(compatibleModels, model)}diff --git a/app/shared/data_models.go b/app/shared/data_models.goindex 813e7ace..9c8b45f1 100644--- a/app/shared/data_models.go+++ b/app/shared/data_models.go@@ -261,21 +261,28 @@ type OrgRole struct {}type ModelCompatibility struct {- IsOpenAICompatible bool `json:"isOpenAICompatible"`- HasJsonResponseMode bool `json:"hasJsonMode"`- HasStreaming bool `json:"hasStreaming"`- HasFunctionCalling bool `json:"hasFunctionCalling"`- HasStreamingFunctionCalls bool `json:"hasStreamingFunctionCalls"`- HasImageSupport bool `json:"hasImageSupport"`+ HasImageSupport bool `json:"hasImageSupport"`}+type ModelOutputFormat string++const (+ ModelOutputFormatToolCallJson ModelOutputFormat = "tool-call-json"+ ModelOutputFormatXml ModelOutputFormat = "xml"+)+type BaseModelConfig struct {- Provider ModelProvider `json:"provider"`- CustomProvider *string `json:"customProvider,omitempty"`- BaseUrl string `json:"baseUrl"`- ModelName string `json:"modelName"`- MaxTokens int `json:"maxTokens"`- ApiKeyEnvVar string `json:"apiKeyEnvVar"`+ Provider ModelProvider `json:"provider"`+ CustomProvider *string `json:"customProvider,omitempty"`+ BaseUrl string `json:"baseUrl"`+ ModelName string `json:"modelName"`+ MaxTokens int `json:"maxTokens"`+ ApiKeyEnvVar string `json:"apiKeyEnvVar"`+ PreferredModelOutputFormat ModelOutputFormat `json:"preferredModelOutputFormat"`++ SystemPromptDisabled bool `json:"systemPromptDisabled"`+ RoleParamsDisabled bool `json:"roleParamsDisabled"`+ModelCompatibility}@@ -350,17 +357,25 @@ func (p PlannerRoleConfig) Value() (driver.Value, error) {}type ModelPack struct {- Id string `json:"id"`- Name string `json:"name"`- Description string `json:"description"`-+ Id string `json:"id"`+ Name string `json:"name"`+ Description string `json:"description"`Planner PlannerRoleConfig `json:"planner"`+ Coder *ModelRoleConfig `json:"coder"`PlanSummary ModelRoleConfig `json:"planSummary"`Builder ModelRoleConfig `json:"builder"`WholeFileBuilder *ModelRoleConfig `json:"wholeFileBuilder"` // optional, defaults to builder model — access via GetWholeFileBuilder()Namer ModelRoleConfig `json:"namer"`CommitMsg ModelRoleConfig `json:"commitMsg"`ExecStatus ModelRoleConfig `json:"execStatus"`+ ContextLoader *ModelRoleConfig `json:"contextLoader"`+}++func (m *ModelPack) GetCoder() ModelRoleConfig {+ if m.Coder == nil {+ return m.Planner.ModelRoleConfig+ }+ return *m.Coder}func (m *ModelPack) GetWholeFileBuilder() ModelRoleConfig {@@ -370,6 +385,13 @@ func (m *ModelPack) GetWholeFileBuilder() ModelRoleConfig {return *m.WholeFileBuilder}+func (m *ModelPack) GetContextLoader() ModelRoleConfig {+ if m.ContextLoader == nil {+ return m.Planner.ModelRoleConfig+ }+ return *m.ContextLoader+}+type ModelOverrides struct {MaxConvoTokens *int `json:"maxConvoTokens"`MaxTokens *int `json:"maxContextTokens"`diff --git a/app/shared/plan_model_settings.go b/app/shared/plan_model_settings.goindex 36e1441e..3b3993c6 100644--- a/app/shared/plan_model_settings.go+++ b/app/shared/plan_model_settings.go@@ -32,24 +32,27 @@ type ModelRole stringconst (ModelRolePlanner ModelRole = "planner"+ ModelRoleCoder ModelRole = "coder"+ ModelRoleContextLoader ModelRole = "context-loader"ModelRolePlanSummary ModelRole = "summarizer"ModelRoleBuilder ModelRole = "builder"ModelRoleWholeFileBuilder ModelRole = "whole-file-builder"ModelRoleName ModelRole = "names"ModelRoleCommitMsg ModelRole = "commit-messages"ModelRoleExecStatus ModelRole = "auto-continue"- ModelRoleSearch ModelRole = "search")-var AllModelRoles = []ModelRole{ModelRolePlanner, ModelRolePlanSummary, ModelRoleBuilder, ModelRoleWholeFileBuilder, ModelRoleName, ModelRoleCommitMsg, ModelRoleExecStatus}+var AllModelRoles = []ModelRole{ModelRolePlanner, ModelRoleCoder, ModelRoleContextLoader, ModelRolePlanSummary, ModelRoleBuilder, ModelRoleWholeFileBuilder, ModelRoleName, ModelRoleCommitMsg, ModelRoleExecStatus}var ModelRoleDescriptions = map[ModelRole]string{ModelRolePlanner: "replies to prompts and makes plans",+ ModelRoleCoder: "writes code to implement a plan",ModelRolePlanSummary: "summarizes conversations exceeding max-convo-tokens",ModelRoleBuilder: "builds a plan into file diffs",ModelRoleWholeFileBuilder: "builds a plan into file diffs by writing the entire file",ModelRoleName: "names plans",ModelRoleCommitMsg: "writes commit messages",ModelRoleExecStatus: "determines whether to auto-continue",+ ModelRoleContextLoader: "decides what context to load using codebase map",}var SettingDescriptions = map[string]string{"max-convo-tokens": "max conversation 🪙 before summarization",@@ -102,6 +105,8 @@ func (ps PlanSettings) GetRequiredEnvVars() map[string]bool {envVars[ms.Namer.BaseModelConfig.ApiKeyEnvVar] = trueenvVars[ms.CommitMsg.BaseModelConfig.ApiKeyEnvVar] = trueenvVars[ms.ExecStatus.BaseModelConfig.ApiKeyEnvVar] = true+ envVars[ms.ContextLoader.BaseModelConfig.ApiKeyEnvVar] = true+ envVars[ms.Coder.BaseModelConfig.ApiKeyEnvVar] = true// for backward compatibility with <= 0.8.4 server versionsif len(envVars) == 0 {diff --git a/plandex-cursor.code-workspace b/plandex-cursor.code-workspaceindex 2c1ae9dc..7274760e 100644--- a/plandex-cursor.code-workspace+++ b/plandex-cursor.code-workspace@@ -1,33 +1,43 @@{"folders": [{+ "name": "plandex","path": "."},{- "path": "./static"+ "name": "static",+ "path": "static"},{- "path": "./infra"+ "name": "infra",+ "path": "infra"},{- "path": "./docs"+ "name": "docs",+ "path": "docs"},{- "path": "./app/cli"+ "name": "cli",+ "path": "app/cli"},{- "path": "./app/server"+ "name": "server",+ "path": "app/server"},{- "path": "./app/shared"+ "name": "shared",+ "path": "app/shared"},{- "path": "./app/server/cloud"+ "name": "cloud",+ "path": "app/server/cloud"},{- "path": "./app/server/cloud/ui/node"+ "name": "node",+ "path": "app/server/cloud/ui/node"},{+ "name": "vscode","path": "vscode"}],