Skip to content

[Bounty: 10 BTC] Rewrite goose value-related code in OCaml #1101

[Bounty: 10 BTC] Rewrite goose value-related code in OCaml

[Bounty: 10 BTC] Rewrite goose value-related code in OCaml #1101

Workflow file for this run

name: Chatterbox — Reply to Every Issue and Comment
# Whenever an issue is opened or a comment is created, a chain of self-prompting
# local-model calls (generator ↔ judge) dreams up a reply, and we post it with
# the GitHub Actions token. See .github/scripts/chatter.py for the chain itself.
on:
issues:
types: [opened]
issue_comment:
types: [created]
# Only needs to talk: read context, write a comment. (No `workflows` permission,
# in keeping with the other automations here.)
permissions:
contents: read
issues: write
pull-requests: write
# One conversation at a time per issue, so volleys don't trample each other.
concurrency:
group: chatter-${{ github.event.issue.number }}
cancel-in-progress: false
jobs:
chatter:
# Don't reply to our own comments — that would be an endless monologue.
# github-actions[bot] events don't re-trigger workflows, but the company
# town's clerk (agentpipe-clerk[bot]) comments via a GitHub App token, which
# DOES re-trigger — so skip the clerk to avoid chattering at its paystubs.
if: ${{ github.event.comment.user.login != 'github-actions[bot]' && github.event.comment.user.login != 'agentpipe-clerk[bot]' && !contains(github.event.comment.body, '/review') }}
runs-on: ubuntu-latest
timeout-minutes: 20
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHATTER_MODEL: "qwen3.5:0.8b"
steps:
- name: Decide whether to comment
if: ${{ !contains(github.event.comment.body, '/reply')}}
run: |
if ! [ $(( $RANDOM % 10 )) == 0 ]; then
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install and start Ollama
run: |
curl -fsSL https://ollama.com/install.sh | sh
nohup ollama serve >/tmp/ollama.log 2>&1 &
# Wait for the server to accept connections.
for i in $(seq 1 30); do
if curl -fsS http://127.0.0.1:11434/api/version >/dev/null 2>&1; then
echo "ollama is up"; break
fi
sleep 2
done
- name: Pull model
run: ollama pull "$CHATTER_MODEL"
- name: Run the chatter chain
# User-controlled issue/comment text is passed via env (never interpolated
# into the shell), so there is nothing here to inject into.
env:
EVENT_NAME: ${{ github.event_name }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
COMMENT_BODY: ${{ github.event.comment.body }}
CHATTER_REPLY_FILE: ${{ runner.temp }}/chatter_reply.md
# So the script can pull the prior comment history via the GitHub API.
# GITHUB_REPOSITORY and GITHUB_API_URL are provided automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/scripts/chatter.py
- name: Post the reply
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
CHATTER_REPLY_FILE: ${{ runner.temp }}/chatter_reply.md
run: |
set -euo pipefail
if [ -s "$CHATTER_REPLY_FILE" ]; then
gh issue comment "$ISSUE_NUMBER" --body-file "$CHATTER_REPLY_FILE"
echo "Chattered at issue #$ISSUE_NUMBER. 🗣️"
else
echo "No reply was produced; staying quiet this once."
fi
review:
if: ${{ contains(github.event.comment.body, '/review')}}
runs-on: ubuntu-latest
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BODY_TEXT: ${{ github.event.comment.body }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Review the code
run: |
if [ $(( $RANDOM % 2 )) == 0 ] || [[ $BODY_TEXT == *"approve"* ]] ; then
gh issue comment "$ISSUE_NUMBER" --body "lgtm 👍"
else
gh issue comment "$ISSUE_NUMBER" --body "bad, do not 🖕"
fi