summaryrefslogtreecommitdiffhomepage
path: root/internal/llm
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-12 14:32:27 -0500
committeradamdottv <[email protected]>2025-05-12 14:32:27 -0500
commit36e5ae804e4bf0c96a0ce6cca90029e88c2da9b3 (patch)
treee4dd3910956376104c2b3996c245393bf625bc32 /internal/llm
parentc9b90dd184084a2a3669db49717eb485c8861ee4 (diff)
downloadopencode-36e5ae804e4bf0c96a0ce6cca90029e88c2da9b3.tar.gz
opencode-36e5ae804e4bf0c96a0ce6cca90029e88c2da9b3.zip
chore: rename coder -> primary
Diffstat (limited to 'internal/llm')
-rw-r--r--internal/llm/agent/agent.go4
-rw-r--r--internal/llm/agent/tools.go2
-rw-r--r--internal/llm/prompt/primary.go (renamed from internal/llm/prompt/coder.go)10
-rw-r--r--internal/llm/prompt/prompt.go6
4 files changed, 11 insertions, 11 deletions
diff --git a/internal/llm/agent/agent.go b/internal/llm/agent/agent.go
index 415fce3f0..e45411df7 100644
--- a/internal/llm/agent/agent.go
+++ b/internal/llm/agent/agent.go
@@ -74,7 +74,7 @@ func NewAgent(
}
var titleProvider provider.Provider
// Only generate titles for the coder agent
- if agentName == config.AgentCoder {
+ if agentName == config.AgentPrimary {
titleProvider, err = createAgentProvider(config.AgentTitle)
if err != nil {
return nil, err
@@ -673,7 +673,7 @@ func createAgentProvider(agentName config.AgentName) (provider.Provider, error)
provider.WithReasoningEffort(agentConfig.ReasoningEffort),
),
)
- } else if model.Provider == models.ProviderAnthropic && model.CanReason && agentName == config.AgentCoder {
+ } else if model.Provider == models.ProviderAnthropic && model.CanReason && agentName == config.AgentPrimary {
opts = append(
opts,
provider.WithAnthropicOptions(
diff --git a/internal/llm/agent/tools.go b/internal/llm/agent/tools.go
index b337efb59..7a23b723b 100644
--- a/internal/llm/agent/tools.go
+++ b/internal/llm/agent/tools.go
@@ -11,7 +11,7 @@ import (
"github.com/opencode-ai/opencode/internal/session"
)
-func CoderAgentTools(
+func PrimaryAgentTools(
permissions permission.Service,
sessions session.Service,
messages message.Service,
diff --git a/internal/llm/prompt/coder.go b/internal/llm/prompt/primary.go
index 639679328..c67e6d7a3 100644
--- a/internal/llm/prompt/coder.go
+++ b/internal/llm/prompt/primary.go
@@ -13,18 +13,18 @@ import (
"github.com/opencode-ai/opencode/internal/llm/tools"
)
-func CoderPrompt(provider models.ModelProvider) string {
- basePrompt := baseAnthropicCoderPrompt
+func PrimaryPrompt(provider models.ModelProvider) string {
+ basePrompt := baseAnthropicPrimaryPrompt
switch provider {
case models.ProviderOpenAI:
- basePrompt = baseOpenAICoderPrompt
+ basePrompt = baseOpenAIPrimaryPrompt
}
envInfo := getEnvironmentInfo()
return fmt.Sprintf("%s\n\n%s\n%s", basePrompt, envInfo, lspInformation())
}
-const baseOpenAICoderPrompt = `
+const baseOpenAIPrimaryPrompt = `
You are operating as and within the OpenCode CLI, a terminal-based agentic coding assistant built by OpenAI. It wraps OpenAI models to enable natural language interaction with a local codebase. You are expected to be precise, safe, and helpful.
You can:
@@ -71,7 +71,7 @@ You MUST adhere to the following criteria when executing the task:
- Remember the user does not see the full output of tools
`
-const baseAnthropicCoderPrompt = `You are OpenCode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
+const baseAnthropicPrimaryPrompt = `You are OpenCode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure.
diff --git a/internal/llm/prompt/prompt.go b/internal/llm/prompt/prompt.go
index 769fd51ab..660142320 100644
--- a/internal/llm/prompt/prompt.go
+++ b/internal/llm/prompt/prompt.go
@@ -15,8 +15,8 @@ import (
func GetAgentPrompt(agentName config.AgentName, provider models.ModelProvider) string {
basePrompt := ""
switch agentName {
- case config.AgentCoder:
- basePrompt = CoderPrompt(provider)
+ case config.AgentPrimary:
+ basePrompt = PrimaryPrompt(provider)
case config.AgentTitle:
basePrompt = TitlePrompt(provider)
case config.AgentTask:
@@ -25,7 +25,7 @@ func GetAgentPrompt(agentName config.AgentName, provider models.ModelProvider) s
basePrompt = "You are a helpful assistant"
}
- if agentName == config.AgentCoder || agentName == config.AgentTask {
+ if agentName == config.AgentPrimary || agentName == config.AgentTask {
// Add context from project-specific instruction files if they exist
contextContent := getContextFromPaths()
slog.Debug("Context content", "Context", contextContent)