Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(copilot): filter prompt alias from custom args (#9055)
Danila Katalshovff592e4febd2
diff --git a/server/pkg/agent/copilot.go b/server/pkg/agent/copilot.goindex 261f15350d..07ec410b63 100644--- a/server/pkg/agent/copilot.go+++ b/server/pkg/agent/copilot.go@@ -739,6 +739,7 @@ type copilotCodeChanges struct {// overridden by user-configured custom_args.var copilotBlockedArgs = map[string]blockedArgMode{"-p": blockedWithValue,+ "--prompt": blockedWithValue,"--output-format": blockedWithValue,"--allow-all": blockedStandalone, // tools + paths + URLs"--allow-all-tools": blockedStandalone,diff --git a/server/pkg/agent/copilot_test.go b/server/pkg/agent/copilot_test.goindex c71ed2b220..d2d58555d8 100644--- a/server/pkg/agent/copilot_test.go+++ b/server/pkg/agent/copilot_test.go@@ -6,6 +6,7 @@ import ("log/slog""path/filepath""runtime"+ "slices""strings""testing""time"@@ -1094,6 +1095,30 @@ func TestBuildCopilotArgsFiltersBlockedCustomArgs(t *testing.T) {}}+func TestBuildCopilotArgsBlocksPromptAlias(t *testing.T) {+ t.Parallel()++ for _, tt := range []struct {+ name string+ customArgs []string+ }{+ {"separate value", []string{"--prompt", "custom prompt", "--log-level", "debug"}},+ {"inline value", []string{"--prompt=custom prompt", "--log-level", "debug"}},+ } {+ t.Run(tt.name, func(t *testing.T) {+ t.Parallel()++ args := buildCopilotArgs(ExecOptions{+ CustomArgs: tt.customArgs,+ }, slog.Default())+ want := buildCopilotArgs(ExecOptions{CustomArgs: []string{"--log-level", "debug"}}, slog.Default())+ if !slices.Equal(args, want) {+ t.Fatalf("args with prompt alias = %q, want %q", args, want)+ }+ })+ }+}+func TestBuildCopilotArgsBlocksResumeAndACP(t *testing.T) {t.Parallel()