From ac6a9779d2963f582ebc934102f979f0a07949eb Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 10:26:01 -0500 Subject: [PATCH 01/13] Initial work on goose issue solver --- .github/workflows/goose-issue-solver.yml | 167 +++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 .github/workflows/goose-issue-solver.yml diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml new file mode 100644 index 000000000000..d7bcd0d90af8 --- /dev/null +++ b/.github/workflows/goose-issue-solver.yml @@ -0,0 +1,167 @@ +name: Goose Issue Solver + +on: + issue_comment: + types: [created] + workflow_dispatch: + inputs: + issue_number: + description: 'Issue number to solve' + required: true + type: string + +permissions: + contents: write + pull-requests: write + issues: read + +concurrency: + group: goose-issue-${{ github.event.issue.number || github.event.inputs.issue_number }} + cancel-in-progress: false + +jobs: + solve-issue: + if: | + github.event_name == 'workflow_dispatch' || + (!github.event.issue.pull_request && + contains(github.event.comment.body, '@goose') && + contains(fromJSON('["OWNER", "MEMBER"]'), github.event.comment.author_association)) + + runs-on: ubuntu-latest + timeout-minutes: 30 + + container: + image: ghcr.io/block/goose:latest + options: --user root + env: + GOOSE_PROVIDER: ${{ vars.GOOSE_PROVIDER || 'openai' }} + GOOSE_MODEL: ${{ vars.GOOSE_MODEL || 'gpt-5.1' }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + HOME: /tmp/goose-home + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4 + with: + fetch-depth: 0 + + - name: Install tools + run: | + apt-get update + apt-get install -y jq ripgrep build-essential + + - name: Get issue details + id: issue + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.issue_number }} + run: | + gh api /repos/${{ github.repository }}/issues/$ISSUE_NUMBER > /tmp/issue.json + + echo "number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT + + echo "title<> $GITHUB_OUTPUT + jq -r '.title' /tmp/issue.json >> $GITHUB_OUTPUT + echo "TITLE_EOF" >> $GITHUB_OUTPUT + + echo "body<> $GITHUB_OUTPUT + jq -r '.body // ""' /tmp/issue.json >> $GITHUB_OUTPUT + echo "BODY_EOF" >> $GITHUB_OUTPUT + + - name: Run goose + id: goose + env: + ISSUE_NUMBER: ${{ steps.issue.outputs.number }} + ISSUE_TITLE: ${{ steps.issue.outputs.title }} + ISSUE_BODY: ${{ steps.issue.outputs.body }} + run: | + mkdir -p $HOME/.local/share/goose/sessions + mkdir -p $HOME/.config/goose + + cat > /tmp/goose_instructions.txt << RECIPE_EOF + Solve GitHub issue #${ISSUE_NUMBER}: ${ISSUE_TITLE} + + Issue description: + ${ISSUE_BODY} + + Requirements: + 1. Changes MUST be minimal and focused on this issue only + 2. Do NOT modify more than 10 files + 3. Do NOT modify .github/, lock files, or secrets + + Process: + 0. Write these requirements to your TODO and check against them as you work + 1. Analyze the issue to understand what needs to change + 2. Explore the codebase to find relevant files + 3. Implement the fix with minimal changes + 4. Run: cargo check + 5. Run: cargo test (for affected crates) + 6. If check or tests fail, fix and retry up to 3 times + 7. Run: cargo fmt + 8. Run: ./scripts/clippy-lint.sh + 9. Save changes: git diff > /tmp/issue_changes.patch + 10. Write a one-line summary to /tmp/issue_summary.txt + 11. Only create the patch if all checks pass + + If the issue is unclear or cannot be solved: + - Write explanation to /tmp/issue_summary.txt + - Do NOT create /tmp/issue_changes.patch + RECIPE_EOF + + goose run -i /tmp/goose_instructions.txt --with-builtin developer + + if [ -f /tmp/issue_changes.patch ] && [ -s /tmp/issue_changes.patch ]; then + echo "has_changes=true" >> $GITHUB_OUTPUT + git apply /tmp/issue_changes.patch + else + echo "has_changes=false" >> $GITHUB_OUTPUT + fi + + if [ -f /tmp/issue_summary.txt ]; then + echo "summary<> $GITHUB_OUTPUT + cat /tmp/issue_summary.txt >> $GITHUB_OUTPUT + echo "SUMMARY_EOF" >> $GITHUB_OUTPUT + fi + + - name: Verify no workflow changes + if: steps.goose.outputs.has_changes == 'true' + run: | + if git diff --name-only | grep -q "^\.github/"; then + echo "::error::Changes to .github/ are not allowed" + git checkout -- .github/ + fi + + - name: Extract token metrics + id: metrics + run: | + SESSION_FILE=$(ls -t $HOME/.local/share/goose/sessions/*.jsonl 2>/dev/null | head -1) + if [ -f "$SESSION_FILE" ]; then + echo "total_tokens=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_total_tokens // 0')" >> $GITHUB_OUTPUT + echo "input_tokens=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_input_tokens // 0')" >> $GITHUB_OUTPUT + echo "output_tokens=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_output_tokens // 0')" >> $GITHUB_OUTPUT + fi + + - name: Create Pull Request + if: steps.goose.outputs.has_changes == 'true' + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # pin@v7.0.8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "fix: ${{ steps.issue.outputs.title }}" + title: "fix: ${{ steps.issue.outputs.title }}" + branch: goose/issue-${{ steps.issue.outputs.number }} + delete-branch: true + draft: true + labels: goose-generated + body: | + Closes #${{ steps.issue.outputs.number }} + + ## Summary + ${{ steps.goose.outputs.summary || 'See commits for details.' }} + + ## Token Usage + - **Total**: ${{ steps.metrics.outputs.total_tokens }} tokens + - **Input**: ${{ steps.metrics.outputs.input_tokens }} tokens + - **Output**: ${{ steps.metrics.outputs.output_tokens }} tokens + + --- + *Generated by Goose Issue Solver* From 55c2eef415b7005e0b5b9974cf68603cc0b44cbd Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 10:37:43 -0500 Subject: [PATCH 02/13] use a var for the recipe --- .github/workflows/goose-issue-solver.yml | 61 +++++++++++++----------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index d7bcd0d90af8..6b6ab84e2bda 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -10,6 +10,36 @@ on: required: true type: string +env: + GOOSE_RECIPE: | + Solve GitHub issue #${ISSUE_NUMBER}: ${ISSUE_TITLE} + + Issue description: + ${ISSUE_BODY} + + Requirements: + 1. Changes MUST be minimal and focused on this issue only + 2. Do NOT modify more than 10 files + 3. Do NOT modify .github/, lock files, or secrets + + Process: + 0. Write these requirements to your TODO and check against them as you work + 1. Analyze the issue to understand what needs to change + 2. Explore the codebase to find relevant files + 3. Implement the fix with minimal changes + 4. Run: cargo check + 5. Run: cargo test (for affected crates) + 6. If check or tests fail, fix and retry up to 3 times + 7. Run: cargo fmt + 8. Run: ./scripts/clippy-lint.sh + 9. Save changes: git diff > /tmp/issue_changes.patch + 10. Write a one-line summary to /tmp/issue_summary.txt + 11. Only create the patch if all checks pass + + If the issue is unclear or cannot be solved: + - Write explanation to /tmp/issue_summary.txt + - Do NOT create /tmp/issue_changes.patch + permissions: contents: write pull-requests: write @@ -78,35 +108,8 @@ jobs: mkdir -p $HOME/.local/share/goose/sessions mkdir -p $HOME/.config/goose - cat > /tmp/goose_instructions.txt << RECIPE_EOF - Solve GitHub issue #${ISSUE_NUMBER}: ${ISSUE_TITLE} - - Issue description: - ${ISSUE_BODY} - - Requirements: - 1. Changes MUST be minimal and focused on this issue only - 2. Do NOT modify more than 10 files - 3. Do NOT modify .github/, lock files, or secrets - - Process: - 0. Write these requirements to your TODO and check against them as you work - 1. Analyze the issue to understand what needs to change - 2. Explore the codebase to find relevant files - 3. Implement the fix with minimal changes - 4. Run: cargo check - 5. Run: cargo test (for affected crates) - 6. If check or tests fail, fix and retry up to 3 times - 7. Run: cargo fmt - 8. Run: ./scripts/clippy-lint.sh - 9. Save changes: git diff > /tmp/issue_changes.patch - 10. Write a one-line summary to /tmp/issue_summary.txt - 11. Only create the patch if all checks pass - - If the issue is unclear or cannot be solved: - - Write explanation to /tmp/issue_summary.txt - - Do NOT create /tmp/issue_changes.patch - RECIPE_EOF + export ISSUE_NUMBER ISSUE_TITLE ISSUE_BODY + echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY' > /tmp/goose_instructions.txt goose run -i /tmp/goose_instructions.txt --with-builtin developer From c067b87f6ddfdcdf4202fb516661692cdc51f855 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 10:39:21 -0500 Subject: [PATCH 03/13] no token metrcs --- .github/workflows/goose-issue-solver.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 6b6ab84e2bda..8eb9eb8eff76 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -134,16 +134,6 @@ jobs: git checkout -- .github/ fi - - name: Extract token metrics - id: metrics - run: | - SESSION_FILE=$(ls -t $HOME/.local/share/goose/sessions/*.jsonl 2>/dev/null | head -1) - if [ -f "$SESSION_FILE" ]; then - echo "total_tokens=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_total_tokens // 0')" >> $GITHUB_OUTPUT - echo "input_tokens=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_input_tokens // 0')" >> $GITHUB_OUTPUT - echo "output_tokens=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_output_tokens // 0')" >> $GITHUB_OUTPUT - fi - - name: Create Pull Request if: steps.goose.outputs.has_changes == 'true' uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # pin@v7.0.8 @@ -161,10 +151,5 @@ jobs: ## Summary ${{ steps.goose.outputs.summary || 'See commits for details.' }} - ## Token Usage - - **Total**: ${{ steps.metrics.outputs.total_tokens }} tokens - - **Input**: ${{ steps.metrics.outputs.input_tokens }} tokens - - **Output**: ${{ steps.metrics.outputs.output_tokens }} tokens - --- *Generated by Goose Issue Solver* From bcceee4d7bbddf614ff836ba757093d8d8140041 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 10:53:11 -0500 Subject: [PATCH 04/13] use real recipe --- .github/workflows/goose-issue-solver.yml | 104 +++++++++++++++-------- 1 file changed, 70 insertions(+), 34 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 8eb9eb8eff76..64bc9d029b9f 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -12,33 +12,69 @@ on: env: GOOSE_RECIPE: | - Solve GitHub issue #${ISSUE_NUMBER}: ${ISSUE_TITLE} - - Issue description: - ${ISSUE_BODY} - - Requirements: - 1. Changes MUST be minimal and focused on this issue only - 2. Do NOT modify more than 10 files - 3. Do NOT modify .github/, lock files, or secrets - - Process: - 0. Write these requirements to your TODO and check against them as you work - 1. Analyze the issue to understand what needs to change - 2. Explore the codebase to find relevant files - 3. Implement the fix with minimal changes - 4. Run: cargo check - 5. Run: cargo test (for affected crates) - 6. If check or tests fail, fix and retry up to 3 times - 7. Run: cargo fmt - 8. Run: ./scripts/clippy-lint.sh - 9. Save changes: git diff > /tmp/issue_changes.patch - 10. Write a one-line summary to /tmp/issue_summary.txt - 11. Only create the patch if all checks pass - - If the issue is unclear or cannot be solved: - - Write explanation to /tmp/issue_summary.txt - - Do NOT create /tmp/issue_changes.patch + version: "1.0.0" + title: "Solve GitHub Issue" + description: "Solve GitHub issue #${ISSUE_NUMBER}" + + extensions: + - type: builtin + name: developer + - type: platform + name: todo + + instructions: | + Principles: + - Extract all requirements before coding. Missing one means failure. + - Understand before changing. Research the code first. + - Follow existing patterns and AGENTS.md if it exists. + - Stop when requirements are met. Nothing more. + - Verify through deterministic means. + - Your context degrades. The TODO is your memory. Update it after each step. + + prompt: | + Solve GitHub issue #${ISSUE_NUMBER}: ${ISSUE_TITLE} + + The issue is saved at /tmp/issue.json + + Write this to your TODO immediately and update as you progress: + + ## Phase 1: Understand + - [ ] Read /tmp/issue.json + - [ ] Write all requirements (explicit + implicit) to /tmp/requirements.md + - [ ] Read AGENTS.md if it exists + + ## Phase 2: Research + - [ ] Explore codebase with analyze and rg + - [ ] Identify files that need to change + - [ ] Update TODO with findings + + ## Phase 3: Plan + - [ ] Decide on implementation approach + - [ ] For nontrivial issues, use subagents to evaluate architecture or implementation choices + - [ ] Update TODO with specific changes to make + + ## Phase 4: Implement + - [ ] Implement minimal fix per /tmp/requirements.md + - [ ] Before adding anything, check: is it in the requirements? If not, don't. + - [ ] Max 10 files, no .github/, no lock files, no secrets + + ## Phase 5: Verify + - [ ] cargo check + - [ ] cargo test (affected crates) + - [ ] cargo fmt + - [ ] ./scripts/clippy-lint.sh + - [ ] Fix failures, retry up to 3 times + + ## Phase 6: Confirm (MANDATORY) + - [ ] Reread /tmp/issue.json + - [ ] Reread /tmp/requirements.md + - [ ] Confirm all requirements met, nothing extra added + - [ ] git diff > /tmp/issue_changes.patch + - [ ] Write summary to /tmp/issue_summary.txt + + The Phase 6 "Reread" steps MUST appear in your updated TODO. Skipping them is failure. + + No patch if verification fails or issue is unclear. permissions: contents: write @@ -56,10 +92,10 @@ jobs: (!github.event.issue.pull_request && contains(github.event.comment.body, '@goose') && contains(fromJSON('["OWNER", "MEMBER"]'), github.event.comment.author_association)) - + runs-on: ubuntu-latest timeout-minutes: 30 - + container: image: ghcr.io/block/goose:latest options: --user root @@ -87,13 +123,13 @@ jobs: ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.issue_number }} run: | gh api /repos/${{ github.repository }}/issues/$ISSUE_NUMBER > /tmp/issue.json - + echo "number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT - + echo "title<> $GITHUB_OUTPUT jq -r '.title' /tmp/issue.json >> $GITHUB_OUTPUT echo "TITLE_EOF" >> $GITHUB_OUTPUT - + echo "body<> $GITHUB_OUTPUT jq -r '.body // ""' /tmp/issue.json >> $GITHUB_OUTPUT echo "BODY_EOF" >> $GITHUB_OUTPUT @@ -109,9 +145,9 @@ jobs: mkdir -p $HOME/.config/goose export ISSUE_NUMBER ISSUE_TITLE ISSUE_BODY - echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY' > /tmp/goose_instructions.txt + echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY' > /tmp/recipe.yaml - goose run -i /tmp/goose_instructions.txt --with-builtin developer + goose run --recipe /tmp/recipe.yaml if [ -f /tmp/issue_changes.patch ] && [ -s /tmp/issue_changes.patch ]; then echo "has_changes=true" >> $GITHUB_OUTPUT From e28374512236d3e9236e8b612aefa02d19642ab5 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 10:59:36 -0500 Subject: [PATCH 05/13] cleanup --- .github/workflows/goose-issue-solver.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 64bc9d029b9f..92af93e7bcfa 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -114,7 +114,7 @@ jobs: - name: Install tools run: | apt-get update - apt-get install -y jq ripgrep build-essential + apt-get install -y jq ripgrep build-essential gettext - name: Get issue details id: issue @@ -144,7 +144,6 @@ jobs: mkdir -p $HOME/.local/share/goose/sessions mkdir -p $HOME/.config/goose - export ISSUE_NUMBER ISSUE_TITLE ISSUE_BODY echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY' > /tmp/recipe.yaml goose run --recipe /tmp/recipe.yaml From 19b5ed09133acd924f1edcab4de250eec8404f31 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 11:00:29 -0500 Subject: [PATCH 06/13] goose lowercase --- .github/workflows/goose-issue-solver.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 92af93e7bcfa..872c51fe0cdd 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -1,4 +1,4 @@ -name: Goose Issue Solver +name: goose Issue Solver on: issue_comment: @@ -187,4 +187,4 @@ jobs: ${{ steps.goose.outputs.summary || 'See commits for details.' }} --- - *Generated by Goose Issue Solver* + *Generated by goose Issue Solver* From b11b8422563c2b79da199ed1294ab18e0618008f Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 11:19:08 -0500 Subject: [PATCH 07/13] no patch needed --- .github/workflows/goose-issue-solver.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 872c51fe0cdd..9da4baf01030 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -69,12 +69,12 @@ env: - [ ] Reread /tmp/issue.json - [ ] Reread /tmp/requirements.md - [ ] Confirm all requirements met, nothing extra added - - [ ] git diff > /tmp/issue_changes.patch - - [ ] Write summary to /tmp/issue_summary.txt + - [ ] Write a summary of changes to /tmp/issue_summary.txt The Phase 6 "Reread" steps MUST appear in your updated TODO. Skipping them is failure. - No patch if verification fails or issue is unclear. + Only write /tmp/issue_summary.txt if the fix is complete and verified. + Do not commit. Leave changes in the working directory for the workflow to handle. permissions: contents: write @@ -148,17 +148,13 @@ jobs: goose run --recipe /tmp/recipe.yaml - if [ -f /tmp/issue_changes.patch ] && [ -s /tmp/issue_changes.patch ]; then + if [ -n "$(git status --porcelain)" ] && [ -f /tmp/issue_summary.txt ]; then echo "has_changes=true" >> $GITHUB_OUTPUT - git apply /tmp/issue_changes.patch - else - echo "has_changes=false" >> $GITHUB_OUTPUT - fi - - if [ -f /tmp/issue_summary.txt ]; then echo "summary<> $GITHUB_OUTPUT cat /tmp/issue_summary.txt >> $GITHUB_OUTPUT echo "SUMMARY_EOF" >> $GITHUB_OUTPUT + else + echo "has_changes=false" >> $GITHUB_OUTPUT fi - name: Verify no workflow changes From cf3fc9bed037ad6234827be5cdde6a4ad7aa33de Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 11:22:42 -0500 Subject: [PATCH 08/13] git add instructions --- .github/workflows/goose-issue-solver.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 9da4baf01030..ab7286e09297 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -74,7 +74,8 @@ env: The Phase 6 "Reread" steps MUST appear in your updated TODO. Skipping them is failure. Only write /tmp/issue_summary.txt if the fix is complete and verified. - Do not commit. Leave changes in the working directory for the workflow to handle. + Run `git add` for any new files required for the fix. + Do NOT commit. Leave changes in the working directory for the workflow to handle. permissions: contents: write From d684efa074dd6df8f4555a84d90b88fedbf3b11b Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 13:54:25 -0500 Subject: [PATCH 09/13] trigger with /goose --- .github/workflows/goose-issue-solver.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index ab7286e09297..290ef87e7416 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -91,7 +91,7 @@ jobs: if: | github.event_name == 'workflow_dispatch' || (!github.event.issue.pull_request && - contains(github.event.comment.body, '@goose') && + startsWith(github.event.comment.body, '/goose') && contains(fromJSON('["OWNER", "MEMBER"]'), github.event.comment.author_association)) runs-on: ubuntu-latest @@ -115,7 +115,11 @@ jobs: - name: Install tools run: | apt-get update - apt-get install -y jq ripgrep build-essential gettext + apt-get install -y jq ripgrep build-essential gettext curl + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null + apt-get update + apt-get install -y gh - name: Get issue details id: issue @@ -144,6 +148,7 @@ jobs: run: | mkdir -p $HOME/.local/share/goose/sessions mkdir -p $HOME/.config/goose + git config --global --add safe.directory "$GITHUB_WORKSPACE" echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY' > /tmp/recipe.yaml From 9703c289303724bc99abcbc9f96d857a2eefb1ed Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 14:11:12 -0500 Subject: [PATCH 10/13] pass in trigger comment --- .github/workflows/goose-issue-solver.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 290ef87e7416..b090a8938814 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -36,6 +36,9 @@ env: The issue is saved at /tmp/issue.json + Trigger comment: + ${TRIGGER_COMMENT} + Write this to your TODO immediately and update as you progress: ## Phase 1: Understand @@ -145,12 +148,13 @@ jobs: ISSUE_NUMBER: ${{ steps.issue.outputs.number }} ISSUE_TITLE: ${{ steps.issue.outputs.title }} ISSUE_BODY: ${{ steps.issue.outputs.body }} + TRIGGER_COMMENT: ${{ github.event.comment.body || 'Triggered via workflow_dispatch' }} run: | mkdir -p $HOME/.local/share/goose/sessions mkdir -p $HOME/.config/goose git config --global --add safe.directory "$GITHUB_WORKSPACE" - echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY' > /tmp/recipe.yaml + echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY $TRIGGER_COMMENT' > /tmp/recipe.yaml goose run --recipe /tmp/recipe.yaml From 59a989b50ab4bd415289e3647621a299eb5345b9 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 14:27:16 -0500 Subject: [PATCH 11/13] have goose use hermit --- .github/workflows/goose-issue-solver.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index b090a8938814..8f793535ce4e 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -62,6 +62,7 @@ env: - [ ] Max 10 files, no .github/, no lock files, no secrets ## Phase 5: Verify + - [ ] source bin/activate-hermit - [ ] cargo check - [ ] cargo test (affected crates) - [ ] cargo fmt @@ -118,7 +119,7 @@ jobs: - name: Install tools run: | apt-get update - apt-get install -y jq ripgrep build-essential gettext curl + apt-get install -y jq gettext curl curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null apt-get update From 2aee90a4f0e0175f9495c1388f6e03e21bad4a03 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Thu, 11 Dec 2025 14:29:07 -0500 Subject: [PATCH 12/13] deps --- .github/workflows/goose-issue-solver.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 8f793535ce4e..165634a8736c 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -119,7 +119,7 @@ jobs: - name: Install tools run: | apt-get update - apt-get install -y jq gettext curl + apt-get install -y jq gettext curl build-essential pkg-config libssl-dev curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null apt-get update From 81bdf6f1918bf795101682a5c0a103978ae15ad9 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Fri, 12 Dec 2025 12:20:50 -0500 Subject: [PATCH 13/13] changes per review --- .github/workflows/goose-issue-solver.yml | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/goose-issue-solver.yml b/.github/workflows/goose-issue-solver.yml index 165634a8736c..ed6bf0be1d76 100644 --- a/.github/workflows/goose-issue-solver.yml +++ b/.github/workflows/goose-issue-solver.yml @@ -59,7 +59,7 @@ env: ## Phase 4: Implement - [ ] Implement minimal fix per /tmp/requirements.md - [ ] Before adding anything, check: is it in the requirements? If not, don't. - - [ ] Max 10 files, no .github/, no lock files, no secrets + - [ ] No .github/, no lock files, no secrets ## Phase 5: Verify - [ ] source bin/activate-hermit @@ -125,37 +125,39 @@ jobs: apt-get update apt-get install -y gh - - name: Get issue details - id: issue + - name: Get issue details (issue_comment) + if: github.event_name == 'issue_comment' + env: + ISSUE_JSON: ${{ toJSON(github.event.issue) }} + run: printenv ISSUE_JSON > /tmp/issue.json + + - name: Get issue details (workflow_dispatch) + if: github.event_name == 'workflow_dispatch' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.issue_number }} - run: | - gh api /repos/${{ github.repository }}/issues/$ISSUE_NUMBER > /tmp/issue.json + run: gh api /repos/${{ github.repository }}/issues/${{ github.event.inputs.issue_number }} > /tmp/issue.json - echo "number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT + - name: Set issue outputs + id: issue + run: | + echo "number=$(jq -r '.number' /tmp/issue.json)" >> $GITHUB_OUTPUT echo "title<> $GITHUB_OUTPUT jq -r '.title' /tmp/issue.json >> $GITHUB_OUTPUT echo "TITLE_EOF" >> $GITHUB_OUTPUT - echo "body<> $GITHUB_OUTPUT - jq -r '.body // ""' /tmp/issue.json >> $GITHUB_OUTPUT - echo "BODY_EOF" >> $GITHUB_OUTPUT - - name: Run goose id: goose env: ISSUE_NUMBER: ${{ steps.issue.outputs.number }} ISSUE_TITLE: ${{ steps.issue.outputs.title }} - ISSUE_BODY: ${{ steps.issue.outputs.body }} TRIGGER_COMMENT: ${{ github.event.comment.body || 'Triggered via workflow_dispatch' }} run: | mkdir -p $HOME/.local/share/goose/sessions mkdir -p $HOME/.config/goose git config --global --add safe.directory "$GITHUB_WORKSPACE" - echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $ISSUE_BODY $TRIGGER_COMMENT' > /tmp/recipe.yaml + echo "$GOOSE_RECIPE" | envsubst '$ISSUE_NUMBER $ISSUE_TITLE $TRIGGER_COMMENT' > /tmp/recipe.yaml goose run --recipe /tmp/recipe.yaml