From 2ac4dba27a8ff86c22ee8044349fd20630ed3565 Mon Sep 17 00:00:00 2001 From: pakrym-oai Date: Fri, 3 Oct 2025 09:06:30 -0700 Subject: [PATCH 1/3] Modernize workflows --- .github/workflows/issue-deduplicator.yml | 30 +++++++++++++- .github/workflows/issue-labeler.yml | 51 ++++++++++++++++++++---- 2 files changed, 72 insertions(+), 9 deletions(-) diff --git a/.github/workflows/issue-deduplicator.yml b/.github/workflows/issue-deduplicator.yml index c207628942..f5537cf144 100644 --- a/.github/workflows/issue-deduplicator.yml +++ b/.github/workflows/issue-deduplicator.yml @@ -47,8 +47,34 @@ jobs: openai_api_key: ${{ secrets.CODEX_OPENAI_API_KEY }} prompt_file: .github/prompts/issue-deduplicator.txt require_repo_write: false - codex_version: 0.43.0-alpha.16 - codex_args: -m gpt-5 + model: gpt-5 + prompt: | + You are an assistant that triages new GitHub issues by identifying potential duplicates. + + You will receive the following JSON files located in the current working directory: + - `codex-current-issue.json`: JSON object describing the newly created issue (fields: number, title, body). + - `codex-existing-issues.json`: JSON array of recent issues (each element includes number, title, body, createdAt). + + Instructions: + - Load both files as JSON and review their contents carefully. The codex-existing-issues.json file is large, ensure you explore all of it. + - Compare the current issue against the existing issues to find up to five that appear to describe the same underlying problem or request. + - When unsure, prefer returning fewer matches. + - Include at most five numbers. + + output_schema: | + { + "type": "object", + "properties": { + "issues": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["issues"], + "additionalProperties": false + } comment-on-issue: name: Comment with potential duplicates diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml index 4b893d0c91..23b73b7b30 100644 --- a/.github/workflows/issue-labeler.yml +++ b/.github/workflows/issue-labeler.yml @@ -13,11 +13,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - env: - ISSUE_NUMBER: ${{ github.event.issue.number }} - ISSUE_TITLE: ${{ github.event.issue.title }} - ISSUE_BODY: ${{ github.event.issue.body }} - REPO_FULL_NAME: ${{ github.repository }} outputs: codex_output: ${{ steps.codex.outputs.final_message }} steps: @@ -27,9 +22,51 @@ jobs: uses: openai/codex-action@main with: openai_api_key: ${{ secrets.CODEX_OPENAI_API_KEY }} - prompt_file: .github/prompts/issue-labeler.txt require_repo_write: false - codex_version: 0.43.0-alpha.16 + prompt: | + You are an assistant that reviews GitHub issues for the repository. + + Your job is to choose the most appropriate existing labels for the issue described later in this prompt. + Follow these rules: + - Only pick labels out of the list below. + - Prefer a small set of precise labels over many broad ones. + + Labels to apply: + 1. bug — Reproducible defects in Codex products (CLI, VS Code extension, web, auth). + 2. enhancement — Feature requests or usability improvements that ask for new capabilities, better ergonomics, or quality-of-life tweaks. + 3. extension — VS Code (or other IDE) extension-specific issues. + 4. windows-os — Bugs or friction specific to Windows environments (always when PowerShell is mentioned, path handling, copy/paste, OS-specific auth or tooling failures). + 5. mcp — Topics involving Model Context Protocol servers/clients. + 6. codex-web — Issues targeting the Codex web UI/Cloud experience. + 8. azure — Problems or requests tied to Azure OpenAI deployments. + 9. documentation — Updates or corrections needed in docs/README/config references (broken links, missing examples, outdated keys, clarification requests). + 10. model-behavior — Undesirable LLM behavior: forgetting goals, refusing work, hallucinating environment details, quota misreports, or other reasoning/performance anomalies. + + Issue number: ${{ github.event.issue.number }} + + Issue title: + ${{ github.event.issue.title }} + + Issue body: + ${{ github.event.issue.body }} + + Repository full name: + ${{ github.repository }} + + output_schema: | + { + "type": "object", + "properties": { + "labels": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["labels"], + "additionalProperties": false + } apply-labels: name: Apply labels from Codex output From 765166c52298705c07a8c0ddc0f3a1d15bc6dd8b Mon Sep 17 00:00:00 2001 From: pakrym-oai Date: Fri, 3 Oct 2025 09:12:10 -0700 Subject: [PATCH 2/3] Fix Codex workflow parsing --- .github/workflows/issue-deduplicator.yml | 11 +++++++---- .github/workflows/issue-labeler.yml | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/issue-deduplicator.yml b/.github/workflows/issue-deduplicator.yml index f5537cf144..79ebe536d5 100644 --- a/.github/workflows/issue-deduplicator.yml +++ b/.github/workflows/issue-deduplicator.yml @@ -92,22 +92,25 @@ jobs: with: github-token: ${{ github.token }} script: | - let numbers; + const raw = process.env.CODEX_OUTPUT ?? ''; + let parsed; try { - numbers = JSON.parse(process.env.CODEX_OUTPUT); + parsed = JSON.parse(raw); } catch (error) { core.info(`Codex output was not valid JSON. Raw output: ${raw}`); + core.info(`Parse error: ${error.message}`); return; } - if (numbers.length === 0) { + const issues = Array.isArray(parsed?.issues) ? parsed.issues : []; + if (issues.length === 0) { core.info('Codex reported no potential duplicates.'); return; } const lines = [ 'Potential duplicates detected:', - ...numbers.map((value) => `- #${value}`), + ...issues.map((value) => `- #${String(value)}`), '', '*Powered by [Codex Action](https://github.com/openai/codex-action)*']; diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml index 23b73b7b30..279934695f 100644 --- a/.github/workflows/issue-labeler.yml +++ b/.github/workflows/issue-labeler.yml @@ -90,12 +90,12 @@ jobs: exit 0 fi - if ! printf '%s' "$json" | jq -e 'type == "array"' >/dev/null 2>&1; then - echo "Codex output was not a JSON array. Raw output: $json" + if ! printf '%s' "$json" | jq -e 'type == "object" and (.labels | type == "array")' >/dev/null 2>&1; then + echo "Codex output did not include a labels array. Raw output: $json" exit 0 fi - labels=$(printf '%s' "$json" | jq -r '.[] | tostring') + labels=$(printf '%s' "$json" | jq -r '.labels[] | tostring') if [ -z "$labels" ]; then echo "Codex returned an empty array. Nothing to do." exit 0 From 57a732cd05b110de86bb7e084d88b17df309787d Mon Sep 17 00:00:00 2001 From: pakrym-oai Date: Fri, 3 Oct 2025 09:17:29 -0700 Subject: [PATCH 3/3] github: remove prompt_file from issue-deduplicator workflow configuration --- .github/workflows/issue-deduplicator.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/issue-deduplicator.yml b/.github/workflows/issue-deduplicator.yml index 79ebe536d5..6488050bdf 100644 --- a/.github/workflows/issue-deduplicator.yml +++ b/.github/workflows/issue-deduplicator.yml @@ -45,7 +45,6 @@ jobs: uses: openai/codex-action@main with: openai_api_key: ${{ secrets.CODEX_OPENAI_API_KEY }} - prompt_file: .github/prompts/issue-deduplicator.txt require_repo_write: false model: gpt-5 prompt: |