Skip to content

Add 'babysitter run:halt' command for sealing divergent runs #2198

Add 'babysitter run:halt' command for sealing divergent runs

Add 'babysitter run:halt' command for sealing divergent runs #2198

# Agent Plan Dispatch — trigger babysitter planning agent from issue/PR comments or manually
#
# Usage:
# - Comment `/plan <prompt>` on any issue or PR
# - Or dispatch manually with branch, issue/PR number, and instructions
#
# The planning agent creates a process definition and inputs file for the task,
# commits them to a branch, and opens a PR — but does NOT execute the work.
name: Agent Plan Dispatch
on:
push:
branches: [main, staging, develop]
paths: ['.github/workflows/agent-plan-dispatch.yml']
issue_comment:
types: [created]
workflow_dispatch:
inputs:
branch:
description: 'Branch to work on (e.g. staging, feat/my-feature)'
required: true
type: string
issue_number:
description: 'Issue or PR number for context and reporting'
required: true
type: string
instructions:
description: 'Instructions for the planning agent'
required: true
type: string
permissions:
contents: write
pull-requests: write
issues: write
jobs:
plan:
if: >-
(github.event_name == 'workflow_dispatch') ||
startsWith(github.event.comment.body, '/plan ')
runs-on: ubuntu-latest-l
steps:
- name: Generate a5c GitHub App token
id: a5c-token
continue-on-error: true
uses: a5c-ai/generate-token-action@main
- uses: actions/checkout@v6
with:
ref: ${{ inputs.branch || github.event.repository.default_branch }}
fetch-depth: 0
token: ${{ steps.a5c-token.outputs.a5c_token || github.token }}
- uses: a5c-ai/babysitter/packages/adapters/triggers@staging
with:
harness: codex
provider: foundry
model: gpt-5.5
interaction-mode: bridged-hooks
babysitter-plugin: 'true'
max-turns: '9999'
babysitter-prompt-prefix: '$babysitter:plan '
prompt: |
You are a planning agent. Your job is ONLY to plan — do NOT implement.
Trigger: ${{ github.event_name == 'workflow_dispatch' && 'manual dispatch' || format('/plan on #{0}', github.event.issue.number) }}
Issue/PR: #${{ inputs.issue_number || github.event.issue.number }}
Branch: ${{ inputs.branch || github.event.repository.default_branch }}
CONTEXT — READ THE ISSUE/PR FIRST:
Run `gh issue view ${{ inputs.issue_number || github.event.issue.number }} --json title,body,labels,comments` to understand the full context.
Read the issue description, all comments, and labels carefully before planning.
If it's a PR, also run `gh pr view ${{ inputs.issue_number || github.event.issue.number }} --json files,title,body,comments` to see existing changes.
PLANNING INSTRUCTIONS:
1. Research the codebase to understand the relevant files, architecture, and patterns.
2. Research the process library (.a5c/process-library/) for matching methodologies and specializations.
3. Create a babysitter process definition (.mjs file) under .a5c/processes/ that encodes the plan as phases, tasks, breakpoints, and quality gates.
4. Create a matching inputs JSON file under .a5c/processes/ with the concrete inputs for this task.
5. The process file should be ready to execute via `.a5c/processes/<file>.mjs#process`.
OUTPUT — ONLY THESE ARTIFACTS:
- .a5c/processes/<descriptive-name>.mjs — the process definition
- .a5c/processes/<descriptive-name>.inputs.json — the inputs file
- Do NOT write implementation code. Do NOT modify source files. Only produce the process and inputs.
BRANCH AND PR:
- Create a new branch `plan/issue-${{ inputs.issue_number || github.event.issue.number }}`.
- Commit the process file and inputs file.
- Push and create a DRAFT PR using `gh pr create --draft` with title "feat: <brief description>" linking to #${{ inputs.issue_number || github.event.issue.number }}.
- Do NOT put "Plan:" in the PR title. Use "feat:" prefix.
- The PR body should summarize the planned phases, expected tasks, and quality gates.
- Post a comment on #${{ inputs.issue_number || github.event.issue.number }} with the plan summary and a link to the PR.
User request: ${{ inputs.instructions || github.event.comment.body }}
trigger-query: ''
env:
AZURE_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AGENT_MUX_API_BASE: https://${{ vars.AZURE_OPENAI_PROJECT_NAME }}.services.ai.azure.com
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ steps.a5c-token.outputs.a5c_token || github.token }}