From c34aec060f2abb78486857b0e0d678cac52e2fab Mon Sep 17 00:00:00 2001 From: Dax Date: Thu, 7 Aug 2025 16:32:12 -0400 Subject: Merge agent and mode into one (#1689) The concept of mode has been deprecated, there is now only the agent field in the config. An agent can be cycled through as your primary agent with or you can spawn a subagent by @ mentioning it. if you include a description of when to use it, the primary agent will try to automatically use it Full docs here: https://opencode.ai/docs/agents/ --- packages/tui/cmd/opencode/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/tui/cmd') diff --git a/packages/tui/cmd/opencode/main.go b/packages/tui/cmd/opencode/main.go index 5532289fd..654eb0adc 100644 --- a/packages/tui/cmd/opencode/main.go +++ b/packages/tui/cmd/opencode/main.go @@ -31,7 +31,7 @@ func main() { var model *string = flag.String("model", "", "model to begin with") var prompt *string = flag.String("prompt", "", "prompt to begin with") - var mode *string = flag.String("mode", "", "mode to begin with") + var agent *string = flag.String("agent", "", "agent to begin with") flag.Parse() url := os.Getenv("OPENCODE_SERVER") @@ -44,9 +44,9 @@ func main() { os.Exit(1) } - modesStr := os.Getenv("OPENCODE_MODES") - var modes []opencode.Mode - err = json.Unmarshal([]byte(modesStr), &modes) + agentsStr := os.Getenv("OPENCODE_AGENTS") + var agents []opencode.Agent + err = json.Unmarshal([]byte(agentsStr), &agents) if err != nil { slog.Error("Failed to unmarshal modes", "error", err) os.Exit(1) @@ -86,7 +86,7 @@ func main() { logger := slog.New(apiHandler) slog.SetDefault(logger) - slog.Debug("TUI launched", "app", appInfoStr, "modes", modesStr, "url", url) + slog.Debug("TUI launched", "app", appInfoStr, "modes", agentsStr, "url", url) go func() { err = clipboard.Init() @@ -96,7 +96,7 @@ func main() { }() // Create main context for the application - app_, err := app.New(ctx, version, appInfo, modes, httpClient, model, prompt, mode) + app_, err := app.New(ctx, version, appInfo, agents, httpClient, model, prompt, agent) if err != nil { panic(err) } -- cgit v1.2.3