Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions .github/dispatch/APPEND_SYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,51 @@ should contain the change that resolves the issue and nothing that does not.

## Committing and the pull request
- Commit only to the branch you were given. Never push to a protected branch.
- Open exactly one PR. Title from the issue; body says `Closes #N`.
- Your PR description is the user's first look at any of this. They did not
see the research or the tool calls, only this. Open with one sentence on the
outcome: what changed and why it resolves the issue. Then a short list of
the actual changes (file, what it does). Then the verification result: the
exact commands and their pass/fail. Write complete sentences. Drop the
shorthand and labels you built up while working; that vocabulary is yours,
not theirs.
- Open exactly one PR. Title from the issue, prefixed for sortability.
- The workflow opens the PR for you and publishes the body from a file you
write. Before committing, create `PR_BODY.md` in the repo root with the PR
description following the template below. Do not run `gh pr create` or
`gh pr edit` yourself; the workflow owns that.

The workflow strips `PR_BODY.md` from the commit before pushing (it is a
build artifact, not a source change), so write it freely.

## PR_BODY.md template (follow exactly)
Your PR body is the user's first and often only look at this work. They did
not see the research or the tool calls. Write it for a reviewer who knows the
codebase but nothing about this run. Short, concrete, accurate to what you
actually did. Use this structure:

```
Closes #<issue number>

## Problem
One or two sentences on what was wrong: the symptom and its root cause, as a
reader of the issue would understand them. No blame, no narrative of your
investigation.

## Changes
A short bulleted list. One bullet per logical change, naming the file and what
it does. Omit mechanical edits. If a change is non-obvious, one clause on why.

## How to test
The concrete steps a reviewer can run to confirm the fix works. Prefer the
repository's own commands. Include the exact command(s) and the expected
result. If you added a test, name it and the one-line code change that makes
it fail without the fix.

## Verification
The gate you ran and its result. One line, e.g.: "`go build ./... && go vet
./... && go test ./...` pass." Do not claim anything you did not run.
```

Rules:
- Every section present. If a section genuinely does not apply (e.g. no test
added), say so in one line rather than omitting it.
- Lead with the outcome in the Problem section, not with "This PR...".
- Write complete sentences. Drop the shorthand and labels you built up while
working; that vocabulary is yours, not the reviewer's.
- Never paste credentials, absolute paths, or endpoint URLs.

## Operating autonomously
You are operating autonomously. The user cannot answer mid-task, so asking
Expand Down
38 changes: 30 additions & 8 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,35 @@ jobs:
ISSUE_TITLE: ${{ github.event.issue.title }}
AGENT_EXIT: ${{ steps.agent.outputs.exit }}
run: |
if git diff --quiet && git diff --staged --quiet; then
echo "no changes produced by agent"
set -e
# Capture the PR body BEFORE stripping PR_BODY.md from the tree.
# PR_BODY.md is an artifact the agent authors; it describes the change
# but is not a source change, so it is kept out of the commit.
if [ -f PR_BODY.md ]; then
BODY_FILE=PR_BODY.md
else
BODY_FILE=$(mktemp)
{
echo "Closes #${ISSUE_NUMBER}."
echo
echo "_No structured body was produced by the agent._"
echo
echo "Generated by the dispatch workflow (sesh + glm-5.2)."
echo "Agent exit code: ${AGENT_EXIT} (0 done, 1 error, 3 stuck, 4 iter cap)."
} > "$BODY_FILE"
fi

# Copy the body out of the tree so stripping the file does not lose it.
PR_BODY_COPY="$(mktemp)"
cp "$BODY_FILE" "$PR_BODY_COPY"
BODY_FILE="$PR_BODY_COPY"

# Strip the artifact from the working tree before committing.
rm -f PR_BODY.md
git add -A
if git diff --cached --quiet; then
echo "no source changes produced by agent"
else
git add -A
git commit -m "dispatch: resolve #${ISSUE_NUMBER}" -q
fi
git push -u origin "$BRANCH"
Expand All @@ -149,11 +174,8 @@ jobs:
--base "$BASE" \
--head "$BRANCH" \
--title "$ISSUE_TITLE" \
--body "Closes #${ISSUE_NUMBER}.

Generated by the dispatch workflow (sesh + glm-5.2).
Agent exit code: ${AGENT_EXIT} (0 done, 1 error, 3 stuck, 4 iter cap)." \
|| gh pr edit "$BRANCH" --body "Updated by a dispatch run."
--body-file "$BODY_FILE" \
|| gh pr edit "$BRANCH" --body-file "$BODY_FILE"

- name: Remove the dispatch label (re-label to re-run)
if: always()
Expand Down
Loading