diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index db56a37b..7ce457f0 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -178,8 +178,6 @@ jobs: echo "review_mode=$REVIEW_MODE" echo "review_scope=$REVIEW_SCOPE" echo "review_mode_reason=$REVIEW_MODE_REASON" - echo "max_turns=$MAX_TURNS" - echo "max_thinking_tokens=$MAX_THINKING_TOKENS" echo "claude_timeout_minutes=$CLAUDE_TIMEOUT_MINUTES" echo "runs_on=$RUNS_ON" } >> "$GITHUB_OUTPUT" @@ -543,8 +541,6 @@ jobs: GH_TOKEN: ${{ steps.app-token.outputs.token }} REVIEW_MARKER: >- run: | diff --git a/scripts/github/run-ai-review-direct.mjs b/scripts/github/run-ai-review-direct.mjs index 5ddbf044..4c263bda 100644 --- a/scripts/github/run-ai-review-direct.mjs +++ b/scripts/github/run-ai-review-direct.mjs @@ -271,7 +271,7 @@ export async function writeDirectReviewFromEnv(env = process.env, fetchImpl = gl attempt === 1 ? buildPrimaryPrompt({ meta, packet }) : `${buildPrimaryPrompt({ meta, packet })}\n\n${buildRepairPrompt({ validationReason: lastReason, previousCandidate })}`; - const startedAt = new Date().toISOString(); + const attemptStartedAt = new Date().toISOString(); const responseJson = await postReviewRequest({ apiUrl: cleanText(env.ANTHROPIC_BASE_URL), apiKey: cleanText(env.ANTHROPIC_AUTH_TOKEN), @@ -286,7 +286,7 @@ export async function writeDirectReviewFromEnv(env = process.env, fetchImpl = gl const validation = normalizeStructuredOutput(previousCandidate); attempts.push({ attempt, - startedAt, + startedAt: attemptStartedAt, status: validation.ok ? 'validated' : 'invalid', timeoutMs: attemptWindow.timeoutMs, validationReason: validation.ok ? null : validation.reason, diff --git a/tests/unit/scripts/github/ai-review-workflow.test.ts b/tests/unit/scripts/github/ai-review-workflow.test.ts index 1e850c4a..2ee24ac1 100644 --- a/tests/unit/scripts/github/ai-review-workflow.test.ts +++ b/tests/unit/scripts/github/ai-review-workflow.test.ts @@ -52,5 +52,11 @@ describe('ai-review workflow', () => { '${{ steps.review-packet.outputs.packet_included_files }}' ); expect(directReviewStep?.env?.AI_REVIEW_REQUEST_BUFFER_MS).toBe(45000); + + const publishStep = steps.find((step) => step.name === 'Publish review comment'); + expect(publishStep).toBeDefined(); + expect(String(publishStep?.env?.REVIEW_MARKER)).toContain('pr:${{ needs.prepare.outputs.pr_number }}'); + expect(String(publishStep?.env?.REVIEW_MARKER)).toContain('sha:${{ needs.prepare.outputs.head_sha }}'); + expect(String(publishStep?.env?.REVIEW_MARKER)).not.toContain('run:${{ github.run_id }}'); }); });