Skip to content

Commit 7e614dc

Browse files
idoubiclaude
andcommitted
fix: apply enhanced system prompt to pipe mode too
Both TUI and pipe modes now use the enhanced system prompt with tool guidelines, code quality rules, and permission context. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c481b3a commit 7e614dc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

internal/pipe/pipe.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88

99
"github.com/codeany-ai/codeany/internal/config"
10+
sysprompt "github.com/codeany-ai/codeany/internal/prompt"
1011
"github.com/codeany-ai/open-agent-sdk-go/agent"
1112
"github.com/codeany-ai/open-agent-sdk-go/types"
1213
)
@@ -15,6 +16,12 @@ import (
1516
func Run(ctx context.Context, cfg *config.Config, prompt string, outputFmt string) error {
1617
cwd, _ := os.Getwd()
1718

19+
// Build system prompt
20+
sysPrompt := cfg.SystemPrompt
21+
if sysPrompt == "" {
22+
sysPrompt = sysprompt.BuildSystemPrompt(cfg.Model, cwd, cfg.PermissionMode, false)
23+
}
24+
1825
opts := agent.Options{
1926
Model: cfg.Model,
2027
APIKey: cfg.APIKey,
@@ -25,7 +32,7 @@ func Run(ctx context.Context, cfg *config.Config, prompt string, outputFmt strin
2532
MaxBudgetUSD: cfg.MaxBudgetUSD,
2633
PermissionMode: cfg.GetPermissionMode(),
2734
MCPServers: cfg.MCPServers,
28-
SystemPrompt: cfg.SystemPrompt,
35+
SystemPrompt: sysPrompt,
2936
AppendSystemPrompt: cfg.AppendSystemPrompt,
3037
CustomHeaders: cfg.CustomHeaders,
3138
ProxyURL: cfg.ProxyURL,

0 commit comments

Comments
 (0)