Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Release job (release_bead): Finds THE CLAIMED BEAD in_progress and release it them back to open state |
…nents Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…gress bead Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in 7effebb. The release_bead job now:
This prevents releasing beads from other concurrent workflow runs. |
…ead job, and bd sync Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot the |
|
…d bead Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
.github/workflows/beads-worker.md
Outdated
Fixed in 521ed7d. Added validation step to |
|
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
Fixed in 8b554c0. Removed
Already implemented in fe3a2bf. Added |
.github/workflows/beads-worker.md
Outdated
| required: false | ||
| type: string | ||
| steps: | ||
| - name: Checkout repository |
There was a problem hiding this comment.
@copilot need a shallow git clone, then run "bd sync"
There was a problem hiding this comment.
Fixed in 6142f84. Changed to shallow clone with fetch-depth: 1 and added bd sync step after checkout to sync beads data from the repository.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot beads does not need a full checkout of the repo. It needs git+repo configured and it will sync the git data structures itself. Review the use of actions/checkout and make it more efficient / lightweight . Do not leave around the credentials. |
…ntial cleanup Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in d5f4923. Replaced all |
|
@copilot use the beads-sync branch for beads operations |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
.github/workflows/beads-worker.md
Outdated
| echo "✓ Beads data synced" | ||
|
|
||
| # Clear credentials | ||
| git config --unset credential.helper |
There was a problem hiding this comment.
Fixed in 78cc394. Removed premature credential cleanup from all jobs. Credentials are now kept throughout job execution for all bd operations and only cleaned up at the end after all bd commands complete.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Beads Worker Workflow - Complete Implementation ✅
Summary
Successfully created an agentic workflow that automatically picks up and executes ready tasks from beads-equipped repositories. The workflow runs hourly and integrates with the beads task tracking system using a clean architecture with separate jobs for bead claiming and agent execution.
Implementation Checklist
schedule: hourlyfor cleaner configurationstrict: truecontents: readfor main workflow permissionsbeadcustom job withcontents: writebd syncinstead of manual git operationsTechnical Implementation
1. Hourly Schedule
schedule: hourly(system generates scattered cron)workflow_dispatchfor testing2. Separate Bead Job
beadjob that depends onactivationcontents: writepermission for bead operationsgit init+ remote configuration instead of full checkoutbeads-syncbranchbd syncbd ready --json --no-daemonbd update <id> --status in_progressbd syncid,title,description,status3. Agent Job Dependencies ✨ CONDITIONAL
activationandbeadjobsif: needs.bead.outputs.id != ''${{ needs.bead.outputs.id }}contents: readpermission only (strict mode)4. Custom Safe Output:
bead-update-state✨ SIMPLIFIED & VALIDATEDProvides MCP tool for agent to update bead state with automatic bead selection and validation:
needs.bead.outputs.id)open,in_progress,closed)git initwithbeads-syncbranchbd syncstate(required with options),reason(optional)open,in_progress,closedcontents: writefor bead operationsbd syncto commit changes5. Release Job
Custom job that runs with
if: always() && needs.bead.outputs.id != '':agentandbeadjobsneeds.bead.outputs.idgit initwithbeads-syncbranchbd syncin_progressstateopenstate with agent result detailsbd syncto commit changes6. State Machine Documentation ✨
open,in_progress,closed7. Extensive Logging ✨
===)Architecture Improvements
1. Schedule Configuration
schedule: hourly2. Strict Mode
strict: truefor better securitycontents: readonlycontents: write3. Job Separation
beadjob for claiming beadsneeds.bead.outputs.*4. Sync Operations
bd syncinstead of manual git operations5. Simplified Interface ✨
bead-update-stateno longer requiresbead_idinputneeds.bead.outputs.idbeads-syncbranch for beads operations6. Conditional Execution ✨
7. Lightweight Git Integration ✨
git init+ remote configuration instead ofactions/checkoutbeads-syncbranchbd syncSecurity Considerations
Strict Mode: Enabled (
strict: true) for enhanced securityPermissions:
contents: read- Read-only accesscontents: write- For bead state management in.beads/directorycontents: write- For releasing beadscontents: write- For custom safe output operationsCredential Management:
git config --unset credential.helperValidation:
Files Modified
.github/workflows/beads-worker.mdschedule: hourlystrict: truecontents: readbeadcustom jobif: needs.bead.outputs.id != ''beadjobneeds.bead.outputs.*needs.bead.outputs.idbd syncactions/checkoutwith lightweightgit initinit.defaultBranchfrommaintobeads-syncbd sync.github/workflows/beads-worker.lock.yml(58.4 KB)beads-syncas default branchWorkflow Execution Flow
graph TD A[Hourly Trigger] --> B[Activation Job] B --> C[Bead Job] C --> D[git init beads-sync + remote] D --> E[Configure credentials once] E --> F[bd sync] F --> G{Bead Found?} G -->|Yes| H[bd update to in_progress] G -->|No| I[Exit with empty outputs] H --> J[bd sync] J --> K[Cleanup credentials] K --> L{Agent Job If Check} L -->|Bead ID exists| M[Agent Executes] L -->|No Bead ID| N[Skip Agent] M --> O{Agent Updates State?} O -->|Yes| P[git init + configure credentials] P --> Q[bd sync] Q --> R[bd update claimed bead] R --> S[bd sync] S --> T[Cleanup credentials] O -->|No| U[Release Job] T --> V[End] U --> W[git init + configure credentials] W --> X[bd sync] X --> Y{Bead Still in_progress?} Y -->|Yes| Z[bd update to open] Z --> AA[bd sync] AA --> AB[Cleanup credentials] Y -->|No| AC[Skip Release] AB --> V AC --> V I --> V N --> VTesting Results
✅ Workflow compiles successfully with no errors
✅ All jobs properly configured with correct dependencies
✅ Bead ID correctly propagated via job outputs
✅ Agent job depends on bead job with conditional execution
✅ Agent job only runs if bead claimed
✅ Release job only targets the claimed bead
✅ bead-update-state automatically uses claimed bead (no bead_id input)
✅ State input validates with options field
✅ No full repository checkout - uses lightweight git init
✅ All operations use beads-sync branch
✅ Beads manages git data via bd sync
✅ Credentials kept throughout job for bd operations
✅ Credentials cleaned up only at end of each job
✅ Extensive logging added to all operations
✅ State machine documented in prompt
✅ Uses
bd syncfor all git operations✅ Strict mode enabled with proper permission separation
✅ Schedule uses
hourlyformat✅ Custom safe output job (
bead-update-state) correctly registered✅ MCP tools available to agent
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.