From 902a78a7a4689e317371a9abbbdb5b85fbcf7293 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:13:05 +0000 Subject: [PATCH 1/3] Initial plan From cff7bb6166d22c899a94b7e3d942de5adbfebef3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:24:26 +0000 Subject: [PATCH 2/3] Fix campaign message updates to create new comments instead of updating existing ones Enable append-only-comments for campaign orchestrator workflows to ensure full history of campaign run updates is preserved. Previously, campaign runs were updating the activation comment, replacing the previous state. Now each run creates a new comment, providing a complete audit trail. Changes: - Add Messages config with AppendOnlyComments=true to orchestrator - Add test to verify append-only-comments is enabled for campaigns - Document behavior in code comments This matches the existing behavior in campaign generator which already has append-only-comments enabled. Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- pkg/campaign/orchestrator.go | 5 +++++ pkg/campaign/orchestrator_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/pkg/campaign/orchestrator.go b/pkg/campaign/orchestrator.go index 212223511b8..578e82e11a9 100644 --- a/pkg/campaign/orchestrator.go +++ b/pkg/campaign/orchestrator.go @@ -377,6 +377,11 @@ func BuildOrchestrator(spec *CampaignSpec, campaignFilePath string) (*workflow.W safeOutputs.AddComments = &workflow.AddCommentsConfig{BaseSafeOutputConfig: workflow.BaseSafeOutputConfig{Max: maxComments}} // Allow updating the campaign's GitHub Project dashboard. updateProjectConfig := &workflow.UpdateProjectConfig{BaseSafeOutputConfig: workflow.BaseSafeOutputConfig{Max: maxProjectUpdates}} + // Enable append-only comments for campaigns - create new comments instead of updating existing ones + // This ensures full history of campaign run updates is preserved + safeOutputs.Messages = &workflow.SafeOutputMessagesConfig{ + AppendOnlyComments: true, + } // If the campaign spec specifies a custom GitHub token for Projects v2 operations, // pass it to the update-project configuration. if strings.TrimSpace(spec.ProjectGitHubToken) != "" { diff --git a/pkg/campaign/orchestrator_test.go b/pkg/campaign/orchestrator_test.go index 87ba41979d2..6e19cb1d080 100644 --- a/pkg/campaign/orchestrator_test.go +++ b/pkg/campaign/orchestrator_test.go @@ -336,6 +336,34 @@ func TestBuildOrchestrator_GovernanceOverridesSafeOutputMaxima(t *testing.T) { }) } +func TestBuildOrchestrator_AppendOnlyCommentsEnabled(t *testing.T) { + withTempGitRepoWithInstalledCampaignPrompts(t, func(_ string) { + spec := &CampaignSpec{ + ID: "test-campaign", + Name: "Test Campaign", + ProjectURL: "https://github.com/orgs/test/projects/1", + Workflows: []string{"test-workflow"}, + } + + mdPath := ".github/workflows/test-campaign.campaign.md" + data, _ := BuildOrchestrator(spec, mdPath) + if data == nil { + t.Fatalf("expected non-nil WorkflowData") + } + + // Verify that Messages configuration is present + if data.SafeOutputs == nil || data.SafeOutputs.Messages == nil { + t.Fatalf("expected SafeOutputs.Messages to be configured") + } + + // Verify that AppendOnlyComments is enabled for campaigns + // This ensures campaign run updates create new comments instead of updating existing ones + if !data.SafeOutputs.Messages.AppendOnlyComments { + t.Errorf("expected AppendOnlyComments to be true for campaign orchestrator, got false") + } + }) +} + func TestExtractFileGlobPatterns(t *testing.T) { tests := []struct { name string From 4716e5834bfbfe6838f626c054caecafe475ba01 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:25:52 +0000 Subject: [PATCH 3/3] Refactor: Move Messages config to end of safeOutputs assignments Improve code organization by moving the Messages configuration to the end of all safeOutputs assignments, after dispatch_workflow. This makes the code flow more consistent and easier to read. Addresses code review feedback. Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- pkg/campaign/orchestrator.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/campaign/orchestrator.go b/pkg/campaign/orchestrator.go index 578e82e11a9..9504569ef4a 100644 --- a/pkg/campaign/orchestrator.go +++ b/pkg/campaign/orchestrator.go @@ -377,11 +377,6 @@ func BuildOrchestrator(spec *CampaignSpec, campaignFilePath string) (*workflow.W safeOutputs.AddComments = &workflow.AddCommentsConfig{BaseSafeOutputConfig: workflow.BaseSafeOutputConfig{Max: maxComments}} // Allow updating the campaign's GitHub Project dashboard. updateProjectConfig := &workflow.UpdateProjectConfig{BaseSafeOutputConfig: workflow.BaseSafeOutputConfig{Max: maxProjectUpdates}} - // Enable append-only comments for campaigns - create new comments instead of updating existing ones - // This ensures full history of campaign run updates is preserved - safeOutputs.Messages = &workflow.SafeOutputMessagesConfig{ - AppendOnlyComments: true, - } // If the campaign spec specifies a custom GitHub token for Projects v2 operations, // pass it to the update-project configuration. if strings.TrimSpace(spec.ProjectGitHubToken) != "" { @@ -410,6 +405,12 @@ func BuildOrchestrator(spec *CampaignSpec, campaignFilePath string) (*workflow.W orchestratorLog.Printf("Campaign orchestrator '%s' configured with dispatch_workflow for %d workflows", spec.ID, len(spec.Workflows)) } + // Enable append-only comments for campaigns - create new comments instead of updating existing ones + // This ensures full history of campaign run updates is preserved + safeOutputs.Messages = &workflow.SafeOutputMessagesConfig{ + AppendOnlyComments: true, + } + orchestratorLog.Printf("Campaign orchestrator '%s' built successfully with safe outputs enabled", spec.ID) // Extract file-glob patterns from memory-paths or metrics-glob to support