From 495da901d41f3e7bc36809e271d22a4516c8720d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 23:53:15 +0000 Subject: [PATCH 1/2] Initial plan From 76ea54e6f098b49746e65f0b30de4d261daaef5a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Apr 2026 01:00:08 +0000 Subject: [PATCH 2/2] fix step name inconsistencies for engine config and cache-memory Agent-Logs-Url: https://github.com/github/gh-aw/sessions/dbd8ecf0-a650-4e78-be3e-d0bff476ec86 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/ai-moderator.lock.yml | 2 +- .github/workflows/smoke-crush.lock.yml | 4 ++-- .github/workflows/smoke-gemini.lock.yml | 4 ++-- pkg/workflow/awf_helpers_test.go | 2 +- pkg/workflow/cache.go | 7 +------ pkg/workflow/cache_memory_integration_test.go | 6 +++--- pkg/workflow/cache_memory_restore_only_test.go | 4 ++-- pkg/workflow/cache_memory_threat_detection_test.go | 8 ++++---- pkg/workflow/crush_engine.go | 2 +- pkg/workflow/crush_engine_test.go | 2 +- pkg/workflow/enable_api_proxy_test.go | 2 +- pkg/workflow/gemini_engine_test.go | 6 +++--- pkg/workflow/gemini_tools.go | 2 +- 13 files changed, 23 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ai-moderator.lock.yml b/.github/workflows/ai-moderator.lock.yml index cea637232e6..d20af74f257 100644 --- a/.github/workflows/ai-moderator.lock.yml +++ b/.github/workflows/ai-moderator.lock.yml @@ -401,7 +401,7 @@ jobs: # Cache memory file share configuration from frontmatter processed below - name: Create cache-memory directory run: bash "${RUNNER_TEMP}/gh-aw/actions/create_cache_memory_dir.sh" - - name: Cache cache-memory file share data + - name: Restore cache-memory file share data uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: key: memory-none-9f0b69b3-spam-tracking-${{ github.repository_owner }}-${{ github.run_id }} diff --git a/.github/workflows/smoke-crush.lock.yml b/.github/workflows/smoke-crush.lock.yml index fab2d9d1911..92be7ffe253 100644 --- a/.github/workflows/smoke-crush.lock.yml +++ b/.github/workflows/smoke-crush.lock.yml @@ -866,7 +866,7 @@ jobs: - name: Clean git credentials continue-on-error: true run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" - - name: Write Crush configuration + - name: Write Crush Config run: | umask 077 mkdir -p "$GITHUB_WORKSPACE" @@ -1306,7 +1306,7 @@ jobs: run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.23 - name: Install Crush CLI run: npm install --ignore-scripts -g @charmland/crush@0.59.0 - - name: Write Crush configuration + - name: Write Crush Config if: always() && steps.detection_guard.outputs.run_detection == 'true' run: | umask 077 diff --git a/.github/workflows/smoke-gemini.lock.yml b/.github/workflows/smoke-gemini.lock.yml index ebb3acdab60..deabdb27665 100644 --- a/.github/workflows/smoke-gemini.lock.yml +++ b/.github/workflows/smoke-gemini.lock.yml @@ -915,7 +915,7 @@ jobs: - name: Clean git credentials continue-on-error: true run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" - - name: Write Gemini Settings + - name: Write Gemini Config run: | mkdir -p "$GITHUB_WORKSPACE/.gemini" SETTINGS="$GITHUB_WORKSPACE/.gemini/settings.json" @@ -1402,7 +1402,7 @@ jobs: run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.23 - name: Install Gemini CLI run: npm install --ignore-scripts -g @google/gemini-cli@0.37.2 - - name: Write Gemini Settings + - name: Write Gemini Config if: always() && steps.detection_guard.outputs.run_detection == 'true' run: | mkdir -p "$GITHUB_WORKSPACE/.gemini" diff --git a/pkg/workflow/awf_helpers_test.go b/pkg/workflow/awf_helpers_test.go index 8bc39938632..628c681e569 100644 --- a/pkg/workflow/awf_helpers_test.go +++ b/pkg/workflow/awf_helpers_test.go @@ -1199,7 +1199,7 @@ func TestGeminiEngineIncludesGeminiAPITarget(t *testing.T) { t.Fatal("Expected at least two execution steps (settings + execution)") } - // steps[0] = Write Gemini Settings, steps[1] = Execute Gemini CLI + // steps[0] = Write Gemini Config, steps[1] = Execute Gemini CLI stepContent := strings.Join(steps[1], "\n") assert.Contains(t, stepContent, "--gemini-api-target", "Should include --gemini-api-target flag") diff --git a/pkg/workflow/cache.go b/pkg/workflow/cache.go index 2198a68a6cd..d85f5da6081 100644 --- a/pkg/workflow/cache.go +++ b/pkg/workflow/cache.go @@ -494,12 +494,7 @@ func generateCacheMemorySteps(builder *strings.Builder, data *WorkflowData) { threatDetectionEnabled := IsDetectionJobEnabled(data.SafeOutputs) useRestoreOnly := cache.RestoreOnly || threatDetectionEnabled - var actionName string - if useRestoreOnly { - actionName = "Restore cache-memory file share data" - } else { - actionName = "Cache cache-memory file share data" - } + actionName := "Restore cache-memory file share data" if useBackwardCompatiblePaths { fmt.Fprintf(builder, " - name: %s\n", actionName) diff --git a/pkg/workflow/cache_memory_integration_test.go b/pkg/workflow/cache_memory_integration_test.go index fd2c87188bf..4bcf2471881 100644 --- a/pkg/workflow/cache_memory_integration_test.go +++ b/pkg/workflow/cache_memory_integration_test.go @@ -38,7 +38,7 @@ tools: expectedInLock: []string{ "# Cache memory file share configuration from frontmatter processed below", "- name: Create cache-memory directory", - "- name: Cache cache-memory file share data", + "- name: Restore cache-memory file share data", "uses: actions/cache@", "key: memory-none-nopolicy-${{ env.GH_AW_WORKFLOW_ID_SANITIZED }}-${{ github.run_id }}", "path: /tmp/gh-aw/cache-memory", @@ -77,12 +77,12 @@ tools: "# Cache memory file share configuration from frontmatter processed below", "- name: Create cache-memory directory (default)", "mkdir -p /tmp/gh-aw/cache-memory", - "- name: Cache cache-memory file share data (default)", + "- name: Restore cache-memory file share data (default)", "key: memory-none-nopolicy-memory-default-${{ github.run_id }}", "path: /tmp/gh-aw/cache-memory", "- name: Create cache-memory directory (session)", "mkdir -p /tmp/gh-aw/cache-memory-session", - "- name: Cache cache-memory file share data (session)", + "- name: Restore cache-memory file share data (session)", "key: memory-none-nopolicy-memory-session-${{ github.run_id }}", "path: /tmp/gh-aw/cache-memory-session", "cache_memory_prompt_multi.md", // Template file reference for multiple caches diff --git a/pkg/workflow/cache_memory_restore_only_test.go b/pkg/workflow/cache_memory_restore_only_test.go index 49a67a04c4a..aa7c40c8b4e 100644 --- a/pkg/workflow/cache_memory_restore_only_test.go +++ b/pkg/workflow/cache_memory_restore_only_test.go @@ -65,7 +65,7 @@ tools: ---`, expectedInLock: []string{ "# Cache memory file share configuration from frontmatter processed below", - "- name: Cache cache-memory file share data (default)", + "- name: Restore cache-memory file share data (default)", "uses: actions/cache@", // SHA varies "key: memory-none-nopolicy-memory-default-${{ github.run_id }}", "- name: Restore cache-memory file share data (readonly)", @@ -103,7 +103,7 @@ tools: restore-only: true ---`, expectedInLock: []string{ - "- name: Cache cache-memory file share data (writeable)", + "- name: Restore cache-memory file share data (writeable)", "uses: actions/cache@", // SHA varies "- name: Restore cache-memory file share data (readonly1)", "uses: actions/cache/restore@", // SHA varies diff --git a/pkg/workflow/cache_memory_threat_detection_test.go b/pkg/workflow/cache_memory_threat_detection_test.go index 03c4978fa54..34af56c9f26 100644 --- a/pkg/workflow/cache_memory_threat_detection_test.go +++ b/pkg/workflow/cache_memory_threat_detection_test.go @@ -62,7 +62,7 @@ Test workflow with cache-memory and threat detection enabled.`, }, notExpectedInLock: []string{ // Should NOT use regular actions/cache in agent job - "- name: Cache cache-memory file share data\n uses: actions/cache@", + "- name: Restore cache-memory file share data\n uses: actions/cache@", }, }, { @@ -83,8 +83,8 @@ tools: Test workflow with cache-memory but no threat detection.`, expectedInLock: []string{ - // Without threat detection, should use regular actions/cache - "- name: Cache cache-memory file share data", + // Without threat detection, should still restore from cache before execution + "- name: Restore cache-memory file share data", "uses: actions/cache@", "key: memory-none-nopolicy-${{ env.GH_AW_WORKFLOW_ID_SANITIZED }}-${{ github.run_id }}", }, @@ -143,7 +143,7 @@ Test workflow with multiple cache-memory and threat detection enabled.`, }, notExpectedInLock: []string{ // Should NOT use regular actions/cache - "- name: Cache cache-memory file share data (default)", + "- name: Restore cache-memory file share data (default)\n uses: actions/cache@", }, }, { diff --git a/pkg/workflow/crush_engine.go b/pkg/workflow/crush_engine.go index d3bfb4bc1cd..3bcd551e3c3 100644 --- a/pkg/workflow/crush_engine.go +++ b/pkg/workflow/crush_engine.go @@ -290,7 +290,7 @@ else fi chmod 600 "$CONFIG"`, configJSON) - stepLines := []string{" - name: Write Crush configuration"} + stepLines := []string{" - name: Write Crush Config"} stepLines = FormatStepWithCommandAndEnv(stepLines, command, nil) return GitHubActionStep(stepLines) } diff --git a/pkg/workflow/crush_engine_test.go b/pkg/workflow/crush_engine_test.go index 741764e220a..f9d0f819fcd 100644 --- a/pkg/workflow/crush_engine_test.go +++ b/pkg/workflow/crush_engine_test.go @@ -330,7 +330,7 @@ func TestCrushEngineExecution(t *testing.T) { configContent := strings.Join(steps[0], "\n") execContent := strings.Join(steps[1], "\n") - assert.Contains(t, configContent, "Write Crush configuration", "First step should be Write Crush configuration") + assert.Contains(t, configContent, "Write Crush Config", "First step should be Write Crush Config") assert.Contains(t, configContent, ".crush.json", "Config step should reference .crush.json") assert.Contains(t, configContent, "permissions", "Config step should set permissions") assert.Contains(t, execContent, "Execute Crush CLI", "Second step should be Execute Crush CLI") diff --git a/pkg/workflow/enable_api_proxy_test.go b/pkg/workflow/enable_api_proxy_test.go index a63cab22d0a..8c069bd5ebc 100644 --- a/pkg/workflow/enable_api_proxy_test.go +++ b/pkg/workflow/enable_api_proxy_test.go @@ -123,7 +123,7 @@ func TestEngineAWFEnableApiProxy(t *testing.T) { t.Fatal("Expected at least two execution steps (settings + execution)") } - // steps[0] = Write Gemini Settings, steps[1] = Execute Gemini CLI + // steps[0] = Write Gemini Config, steps[1] = Execute Gemini CLI stepContent := strings.Join(steps[1], "\n") if !strings.Contains(stepContent, "--enable-api-proxy") { diff --git a/pkg/workflow/gemini_engine_test.go b/pkg/workflow/gemini_engine_test.go index 30dce4c488a..d22c191be5a 100644 --- a/pkg/workflow/gemini_engine_test.go +++ b/pkg/workflow/gemini_engine_test.go @@ -149,7 +149,7 @@ func TestGeminiEngineExecution(t *testing.T) { steps := engine.GetExecutionSteps(workflowData, "/tmp/test.log") require.Len(t, steps, 2, "Should generate settings step and execution step") - // steps[0] = Write Gemini Settings, steps[1] = Execute Gemini CLI + // steps[0] = Write Gemini Config, steps[1] = Execute Gemini CLI stepContent := strings.Join(steps[1], "\n") assert.Contains(t, stepContent, "name: Execute Gemini CLI", "Should have correct step name") @@ -310,7 +310,7 @@ func TestGeminiEngineExecution(t *testing.T) { settingsContent := strings.Join(steps[0], "\n") execContent := strings.Join(steps[1], "\n") - assert.Contains(t, settingsContent, "Write Gemini Settings", "First step should be Write Gemini Settings") + assert.Contains(t, settingsContent, "Write Gemini Config", "First step should be Write Gemini Config") assert.Contains(t, settingsContent, "includeDirectories", "Settings step should set includeDirectories") assert.Contains(t, settingsContent, "/tmp/", "Settings step should include /tmp/ in include directories") assert.Contains(t, execContent, "Execute Gemini CLI", "Second step should be Execute Gemini CLI") @@ -464,7 +464,7 @@ func TestGenerateGeminiSettingsStep(t *testing.T) { step := engine.generateGeminiSettingsStep(workflowData) content := strings.Join(step, "\n") - assert.Contains(t, content, "Write Gemini Settings", "Should have correct step name") + assert.Contains(t, content, "Write Gemini Config", "Should have correct step name") assert.Contains(t, content, "/tmp/", "Should include /tmp/ in include directories") assert.Contains(t, content, "includeDirectories", "Should set includeDirectories") assert.Contains(t, content, ".gemini", "Should reference .gemini directory") diff --git a/pkg/workflow/gemini_tools.go b/pkg/workflow/gemini_tools.go index 2da447c6559..8ec87f55d70 100644 --- a/pkg/workflow/gemini_tools.go +++ b/pkg/workflow/gemini_tools.go @@ -168,7 +168,7 @@ else fi` stepLines := []string{ - " - name: Write Gemini Settings", + " - name: Write Gemini Config", } env := map[string]string{ "GH_AW_GEMINI_BASE_CONFIG": string(configJSON),