diff --git a/.github/workflows/cloclo.lock.yml b/.github/workflows/cloclo.lock.yml index 8562ebe509..1446742313 100644 --- a/.github/workflows/cloclo.lock.yml +++ b/.github/workflows/cloclo.lock.yml @@ -26,7 +26,7 @@ # - shared/jqschema.md # - shared/mcp/serena-go.md # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"ad111cf099d958c340ed839a8e88f5053a501ce37fb239bdc2645ee1a872d14a","strict":true} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"23a5e0db533ffc88e2014a79b7e1572f5e2652bd5e449d60f7ab9b967df38aed","strict":true} name: "/cloclo" "on": @@ -59,6 +59,12 @@ name: "/cloclo" types: - created - edited + workflow_dispatch: + inputs: + item_number: + description: The number of the issue, pull request, or discussion to process + required: true + type: string permissions: {} @@ -72,7 +78,9 @@ jobs: activation: needs: pre_activation if: > - (needs.pre_activation.outputs.activated == 'true') && (((github.event_name == 'issues') && ((startsWith(github.event.issue.body, '/cloclo ')) || + (needs.pre_activation.outputs.activated == 'true') && ((((github.event_name == 'issues' || github.event_name == 'issue_comment' || + github.event_name == 'pull_request' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || + github.event_name == 'discussion_comment') && ((github.event_name == 'issues') && ((startsWith(github.event.issue.body, '/cloclo ')) || (github.event.issue.body == '/cloclo')) || (github.event_name == 'issue_comment') && (((startsWith(github.event.comment.body, '/cloclo ')) || (github.event.comment.body == '/cloclo')) && (github.event.issue.pull_request == null)) || (github.event_name == 'issue_comment') && (((startsWith(github.event.comment.body, '/cloclo ')) || (github.event.comment.body == '/cloclo')) && @@ -82,7 +90,9 @@ jobs: ((startsWith(github.event.pull_request.body, '/cloclo ')) || (github.event.pull_request.body == '/cloclo')) || (github.event_name == 'discussion') && ((startsWith(github.event.discussion.body, '/cloclo ')) || (github.event.discussion.body == '/cloclo')) || (github.event_name == 'discussion_comment') && ((startsWith(github.event.comment.body, '/cloclo ')) || - (github.event.comment.body == '/cloclo'))) || ((github.event_name == 'issues') && (github.event.label.name == 'cloclo') || + (github.event.comment.body == '/cloclo')))) || (!(github.event_name == 'issues' || github.event_name == 'issue_comment' || + github.event_name == 'pull_request' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || + github.event_name == 'discussion_comment'))) || ((github.event_name == 'issues') && (github.event.label.name == 'cloclo') || (github.event_name == 'pull_request') && (github.event.label.name == 'cloclo') || (github.event_name == 'discussion') && (github.event.label.name == 'cloclo'))) runs-on: ubuntu-slim @@ -216,12 +226,12 @@ jobs: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GH_AW_GITHUB_ACTOR: ${{ github.actor }} GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} - GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} - GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number || inputs.item_number }} + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number || inputs.item_number }} GH_AW_GITHUB_EVENT_ISSUE_STATE: ${{ github.event.issue.state }} GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }} GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || inputs.item_number }} GH_AW_GITHUB_EVENT_PULL_REQUEST_STATE: ${{ github.event.pull_request.state }} GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} @@ -299,12 +309,12 @@ jobs: env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_GITHUB_ACTOR: ${{ github.actor }} - GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} - GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number || inputs.item_number }} + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number || inputs.item_number }} GH_AW_GITHUB_EVENT_ISSUE_STATE: ${{ github.event.issue.state }} GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }} GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || inputs.item_number }} GH_AW_GITHUB_EVENT_PULL_REQUEST_STATE: ${{ github.event.pull_request.state }} GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_STEPS_SANITIZED_OUTPUTS_TEXT: ${{ steps.sanitized.outputs.text }} @@ -323,12 +333,12 @@ jobs: GH_AW_CACHE_DIR: '/tmp/gh-aw/cache-memory/' GH_AW_GITHUB_ACTOR: ${{ github.actor }} GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} - GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} - GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number || inputs.item_number }} + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number || inputs.item_number }} GH_AW_GITHUB_EVENT_ISSUE_STATE: ${{ github.event.issue.state }} GH_AW_GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }} GH_AW_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || inputs.item_number }} GH_AW_GITHUB_EVENT_PULL_REQUEST_STATE: ${{ github.event.pull_request.state }} GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} @@ -1420,6 +1430,8 @@ jobs: pre_activation: if: > + (((github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request' || + github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment') && ((github.event_name == 'issues') && ((startsWith(github.event.issue.body, '/cloclo ')) || (github.event.issue.body == '/cloclo')) || (github.event_name == 'issue_comment') && (((startsWith(github.event.comment.body, '/cloclo ')) || (github.event.comment.body == '/cloclo')) && (github.event.issue.pull_request == null)) || (github.event_name == 'issue_comment') && (((startsWith(github.event.comment.body, '/cloclo ')) || @@ -1429,7 +1441,9 @@ jobs: ((startsWith(github.event.pull_request.body, '/cloclo ')) || (github.event.pull_request.body == '/cloclo')) || (github.event_name == 'discussion') && ((startsWith(github.event.discussion.body, '/cloclo ')) || (github.event.discussion.body == '/cloclo')) || (github.event_name == 'discussion_comment') && ((startsWith(github.event.comment.body, '/cloclo ')) || - (github.event.comment.body == '/cloclo'))) || ((github.event_name == 'issues') && (github.event.label.name == 'cloclo') || + (github.event.comment.body == '/cloclo')))) || (!(github.event_name == 'issues' || github.event_name == 'issue_comment' || + github.event_name == 'pull_request' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || + github.event_name == 'discussion_comment'))) || ((github.event_name == 'issues') && (github.event.label.name == 'cloclo') || (github.event_name == 'pull_request') && (github.event.label.name == 'cloclo') || (github.event_name == 'discussion') && (github.event.label.name == 'cloclo')) runs-on: ubuntu-slim diff --git a/.github/workflows/cloclo.md b/.github/workflows/cloclo.md index 77103bd6ab..f13a5aa217 100644 --- a/.github/workflows/cloclo.md +++ b/.github/workflows/cloclo.md @@ -1,5 +1,11 @@ --- on: + workflow_dispatch: + inputs: + item_number: + description: The number of the issue, pull request, or discussion to process + required: true + type: string slash_command: name: cloclo label_command: cloclo diff --git a/.github/workflows/issue-monster.lock.yml b/.github/workflows/issue-monster.lock.yml index 9dfefb0d1c..e17852c6fe 100644 --- a/.github/workflows/issue-monster.lock.yml +++ b/.github/workflows/issue-monster.lock.yml @@ -20,13 +20,13 @@ # # For more information: https://github.github.com/gh-aw/introduction/overview/ # -# The Cookie Monster of issues - assigns issues to Copilot coding agent one at a time +# The Cookie Monster of issues - dispatches issues to the cloclo agentic workflow one at a time # # Resolved workflow manifest: # Imports: # - shared/activation-app.md # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"a1502fd29140535ef817c99dcabf36cb3592da3e418b6ad4d660e4e629896735","strict":true} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"e0b83316e8696db608b03780ebb981116d96da3e24f978ca841c1c284bf69d5c","strict":true} name: "Issue Monster" "on": @@ -484,7 +484,7 @@ jobs: cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" cat << 'GH_AW_PROMPT_EOF' - Tools: add_comment, assign_to_agent, missing_tool, missing_data, noop + Tools: add_comment, assign_to_agent, dispatch_workflow, missing_tool, missing_data, noop The following GitHub context information is available for this workflow: @@ -689,7 +689,7 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF' - {"add_comment":{"max":3,"target":"*"},"assign_to_agent":{"allowed":["copilot"],"max":3,"target":"*"},"missing_data":{},"missing_tool":{},"noop":{"max":1}} + {"add_comment":{"max":3,"target":"*"},"assign_to_agent":{"allowed":["copilot"],"max":3,"target":"*"},"dispatch_workflow":{"max":3,"workflow_files":{"cloclo":".lock.yml"},"workflows":["cloclo"]},"missing_data":{},"missing_tool":{},"noop":{"max":1}} GH_AW_SAFE_OUTPUTS_CONFIG_EOF - name: Write Safe Outputs Tools run: | @@ -700,7 +700,26 @@ jobs: "assign_to_agent": " CONSTRAINTS: Maximum 3 issue(s) can be assigned to agent." }, "repo_params": {}, - "dynamic_tools": [] + "dynamic_tools": [ + { + "_workflow_name": "cloclo", + "description": "Dispatch the 'cloclo' workflow with workflow_dispatch trigger. This workflow must support workflow_dispatch and be in .github/workflows/ directory in the same repository.", + "inputSchema": { + "additionalProperties": false, + "properties": { + "item_number": { + "description": "The number of the issue, pull request, or discussion to process", + "type": "string" + } + }, + "required": [ + "item_number" + ], + "type": "object" + }, + "name": "cloclo" + } + ] } GH_AW_SAFE_OUTPUTS_TOOLS_META_EOF cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF' @@ -1116,7 +1135,7 @@ jobs: uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 env: WORKFLOW_NAME: "Issue Monster" - WORKFLOW_DESCRIPTION: "The Cookie Monster of issues - assigns issues to Copilot coding agent one at a time" + WORKFLOW_DESCRIPTION: "The Cookie Monster of issues - dispatches issues to the cloclo agentic workflow one at a time" HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }} with: script: | @@ -1212,6 +1231,7 @@ jobs: if: (always()) && ((needs.agent.result != 'skipped') || (needs.activation.outputs.lockdown_check_failed == 'true')) runs-on: ubuntu-slim permissions: + actions: write contents: read discussions: write issues: write @@ -1711,6 +1731,7 @@ jobs: if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (needs.agent.outputs.detection_success == 'true') runs-on: ubuntu-slim permissions: + actions: write contents: read discussions: write issues: write @@ -1776,7 +1797,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":3,\"target\":\"*\"},\"assign_to_agent\":{\"allowed\":[\"copilot\"],\"max\":3,\"target\":\"*\"},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":3,\"target\":\"*\"},\"assign_to_agent\":{\"allowed\":[\"copilot\"],\"max\":3,\"target\":\"*\"},\"dispatch_workflow\":{\"max\":3,\"workflow_files\":{\"cloclo\":\".lock.yml\"},\"workflows\":[\"cloclo\"]},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"}}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/issue-monster.md b/.github/workflows/issue-monster.md index 0c8b6bbcb3..5b1aa875e7 100644 --- a/.github/workflows/issue-monster.md +++ b/.github/workflows/issue-monster.md @@ -1,6 +1,6 @@ --- name: Issue Monster -description: The Cookie Monster of issues - assigns issues to Copilot coding agent one at a time +description: The Cookie Monster of issues - dispatches issues to the cloclo agentic workflow one at a time on: workflow_dispatch: schedule: every 30m @@ -369,6 +369,10 @@ safe-outputs: max: 3 target: "*" # Requires explicit issue_number in agent output allowed: [copilot] # Only allow copilot agent + dispatch-workflow: + workflows: + - cloclo + max: 3 add-comment: max: 3 target: "*" @@ -383,11 +387,11 @@ safe-outputs: # Issue Monster 🍪 -You are the **Issue Monster** - the Cookie Monster of issues! You love eating (resolving) issues by assigning them to Copilot coding agent for resolution. +You are the **Issue Monster** - the Cookie Monster of issues! You love eating (resolving) issues by dispatching them to the cloclo agentic workflow for resolution. ## Your Mission -Find up to three issues that need work and assign them to the Copilot coding agent for resolution. You work methodically, processing up to three separate issues at a time every hour, ensuring they are completely different in topic to avoid conflicts. +Find up to three issues that need work and dispatch them to the cloclo agentic workflow for resolution. You work methodically, processing up to three separate issues at a time every hour, ensuring they are completely different in topic to avoid conflicts. ## Current Context @@ -508,42 +512,42 @@ For each selected issue (which has already been pre-filtered to ensure no open/c - Identify the files that need to be modified - Verify it doesn't overlap with the other selected issues -### 5. Assign Issues to Copilot Agent +### 5. Dispatch Issues to Cloclo Workflow -For each selected issue, use the `assign_to_agent` tool from the `safeoutputs` MCP server to assign the Copilot coding agent: +For each selected issue, use the `cloclo` dispatch tool from the `safeoutputs` MCP server to dispatch the cloclo agentic workflow: ``` -safeoutputs/assign_to_agent(issue_number=, agent="copilot") +safeoutputs/cloclo(item_number=) ``` -Do not use GitHub tools for this assignment. The `assign_to_agent` tool will handle the actual assignment. +Do not use GitHub tools for this dispatch. The `cloclo` tool will handle the actual workflow dispatch. -The Copilot coding agent will: +The cloclo agentic workflow will: 1. Analyze the issue and related context -2. Generate the necessary code changes -3. Create a pull request with the fix -4. Follow the repository's AGENTS.md guidelines +2. Execute the requested action (code changes, analysis, web automation, etc.) +3. Create a pull request with any code changes +4. Add a glamorous comment summarizing the work done -### 6. Add Comment to Each Assigned Issue +### 6. Add Comment to Each Dispatched Issue -For each issue you assign, use the `add_comment` tool from the `safeoutputs` MCP server to add a comment: +For each issue you dispatch, use the `add_comment` tool from the `safeoutputs` MCP server to add a comment: ``` -safeoutputs/add_comment(item_number=, body="🍪 **Issue Monster has assigned this to Copilot!**\n\nI've identified this issue as a good candidate for automated resolution and assigned it to the Copilot coding agent.\n\nThe Copilot coding agent will analyze the issue and create a pull request with the fix.\n\nOm nom nom! 🍪") +safeoutputs/add_comment(item_number=, body="🍪 **Issue Monster has dispatched this to Cloclo!**\n\nI've identified this issue as a good candidate for automated resolution and dispatched it to the Cloclo agentic workflow.\n\nCloclo (Claude) will analyze the issue and take the appropriate action.\n\nOm nom nom! 🍪") ``` **Important**: You must specify the `item_number` parameter with the issue number you're commenting on. This workflow runs on a schedule without a triggering issue, so the target must be explicitly specified. ## Important Guidelines -- ✅ **Up to three at a time**: Assign up to three issues per run, but only if they are completely separate in topic -- ✅ **Topic separation is critical**: Never assign issues that might have overlapping changes or related work -- ✅ **Be transparent**: Comment on each issue being assigned -- ✅ **Check assignments**: Skip issues already assigned to Copilot -- ✅ **Sibling awareness**: For "task" or "plan" sub-issues, skip if any sibling already has an open Copilot PR +- ✅ **Up to three at a time**: Dispatch up to three issues per run, but only if they are completely separate in topic +- ✅ **Topic separation is critical**: Never dispatch issues that might have overlapping changes or related work +- ✅ **Be transparent**: Comment on each issue being dispatched +- ✅ **Check dispatched**: Skip issues that already have an open PR or active work in progress +- ✅ **Sibling awareness**: For "task" or "plan" sub-issues, skip if any sibling already has an open PR - ✅ **Process in order**: For sub-issues of the same parent, process oldest first -- ✅ **Always report outcome**: If no issues are assigned, use the `noop` tool to explain why -- ❌ **Don't force batching**: If only 1-2 clearly separate issues exist, assign only those +- ✅ **Always report outcome**: If no issues are dispatched, use the `noop` tool to explain why +- ❌ **Don't force batching**: If only 1-2 clearly separate issues exist, dispatch only those ## Success Criteria @@ -561,8 +565,8 @@ A successful run means: 11. You selected up to three appropriate issues from the top of the priority list that are completely separate in topic 12. You read and understood each issue 13. You verified that the selected issues don't have overlapping concerns or file changes -14. You assigned each issue to the Copilot coding agent using `assign_to_agent` -15. You commented on each issue being assigned +14. You dispatched each issue to the cloclo agentic workflow using `cloclo` +15. You commented on each issue being dispatched ## Error Handling @@ -573,6 +577,6 @@ If anything goes wrong or no work can be assigned: - **No suitable separate issues**: Use the `noop` tool explaining which issues were considered and why they couldn't be assigned (e.g., overlapping topics, sibling PRs, etc.) - **API errors**: Use the `missing_tool` or `missing_data` tool to report the issue -**CRITICAL**: You MUST call at least one safe output tool every run. If you don't assign any issues, you MUST call the `noop` tool to explain why. Never complete a run without making at least one tool call. +**CRITICAL**: You MUST call at least one safe output tool every run. If you don't dispatch any issues, you MUST call the `noop` tool to explain why. Never complete a run without making at least one tool call. -Remember: You're the Issue Monster! Stay hungry, work methodically, and let Copilot do the heavy lifting! 🍪 Om nom nom! +Remember: You're the Issue Monster! Stay hungry, work methodically, and let Cloclo do the heavy lifting! 🍪 Om nom nom!