From 18685c535630b3c8e17697b386cd7b926f0d84fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 6 Jun 2026 15:46:00 +0000 Subject: [PATCH 1/2] Initial plan From c4b6f1730a874348c65d3ec75591b3393d423e1d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 6 Jun 2026 15:52:46 +0000 Subject: [PATCH 2/2] fix(ci): normalize legacy api-proxy smoke log paths --- .../ci/postprocess-smoke-workflows.test.ts | 27 +++++++++++++++++++ scripts/ci/postprocess-smoke-workflows.ts | 15 +++++++++++ 2 files changed, 42 insertions(+) diff --git a/scripts/ci/postprocess-smoke-workflows.test.ts b/scripts/ci/postprocess-smoke-workflows.test.ts index 1e6f3263a..5e9867aee 100644 --- a/scripts/ci/postprocess-smoke-workflows.test.ts +++ b/scripts/ci/postprocess-smoke-workflows.test.ts @@ -285,6 +285,8 @@ const SESSION_STATE_DIR = '/tmp/gh-aw/sandbox/agent/session-state'; const sessionStateDirInjectionRegex = /--audit-dir \/tmp\/gh-aw\/sandbox\/firewall\/audit(?! --session-state-dir)/g; +const legacyApiProxyLogsDirRegex = + /\/tmp\/gh-aw\/sandbox\/firewall\/logs\/api-proxy(?!-logs)/g; const copySessionStateStepRegex = /^(\s+)- name: Copy Copilot session state files to logs\n\1 if: always\(\)\n\1 continue-on-error: true\n\1 run: bash "\$\{RUNNER_TEMP\}\/gh-aw\/actions\/copy_copilot_session_state\.sh"\n/m; @@ -357,6 +359,31 @@ describe('sessionStateDirInjectionRegex', () => { }); }); +describe('legacyApiProxyLogsDirRegex', () => { + beforeEach(() => { + legacyApiProxyLogsDirRegex.lastIndex = 0; + }); + + it('should match legacy api-proxy log directory path', () => { + const input = 'LOG_DIR="/tmp/gh-aw/sandbox/firewall/logs/api-proxy"'; + expect(legacyApiProxyLogsDirRegex.test(input)).toBe(true); + }); + + it('should replace legacy path with api-proxy-logs path', () => { + const input = 'LOG_DIR="/tmp/gh-aw/sandbox/firewall/logs/api-proxy"'; + const result = input.replace( + legacyApiProxyLogsDirRegex, + '/tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs' + ); + expect(result).toContain('/tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs'); + }); + + it('should not match already-updated api-proxy-logs path', () => { + const input = 'LOG_DIR="/tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs"'; + expect(legacyApiProxyLogsDirRegex.test(input)).toBe(false); + }); +}); + describe('copySessionStateStepRegex', () => { const ORIGINAL_STEP = ' - name: Copy Copilot session state files to logs\n' + diff --git a/scripts/ci/postprocess-smoke-workflows.ts b/scripts/ci/postprocess-smoke-workflows.ts index 8189230ee..2e8a2b246 100644 --- a/scripts/ci/postprocess-smoke-workflows.ts +++ b/scripts/ci/postprocess-smoke-workflows.ts @@ -98,6 +98,8 @@ const standaloneSkipPullRegex = /--skip-pull(?!\s+--build-local)/g; const sessionStateDirInjectionRegex = /--audit-dir \/tmp\/gh-aw\/sandbox\/firewall\/audit(?! --session-state-dir)/g; const SESSION_STATE_DIR = '/tmp/gh-aw/sandbox/agent/session-state'; +const legacyApiProxyLogsDirRegex = + /\/tmp\/gh-aw\/sandbox\/firewall\/logs\/api-proxy(?!-logs)/g; // NOTE: Claude Code is intentionally NOT given --ignore-scripts because its // postinstall script downloads the platform-specific native binary. Without it, @@ -443,6 +445,19 @@ for (const workflowPath of workflowPaths) { console.log(` --session-state-dir already present (or no awf invocation found)`); } + // Normalize legacy api-proxy log directory paths to the current logs folder. + const legacyApiProxyLogDirMatches = content.match(legacyApiProxyLogsDirRegex); + if (legacyApiProxyLogDirMatches) { + content = content.replace( + legacyApiProxyLogsDirRegex, + '/tmp/gh-aw/sandbox/firewall/logs/api-proxy-logs' + ); + modified = true; + console.log( + ` Updated ${legacyApiProxyLogDirMatches.length} legacy api-proxy log path reference(s)` + ); + } + // Claude Code: no --ignore-scripts injection (needs postinstall for native binary) // Replace the "Copy Copilot session state files to logs" step with an inline