feat(ai): Coding agent service (services/ai/agent.go) #367

Open
opened 2026-05-31 16:28:34 +00:00 by jmiller · 0 comments
Owner

Summary

Full coding agent that implements issues when assigned to mokogitea-claude[bot] or labeled ai:implement.

Parent Issue

#359

Triggers

  • Issue assigned to mokogitea-claude[bot]
  • Issue labeled ai:implement
  • @mention: "implement this"

Workflow

  1. Bot comments: "Working on this"
  2. Clone/checkout, create dev/ branch
  3. Read .mokogitea/CLAUDE.md
  4. Claude agent loop: analyze, explore, implement, test, iterate
  5. Commit with Co-Authored-By
  6. Push branch, open PR
  7. Comment: "Done, see PR #N"

Failure Handling

  • Posts what it tried and where it got stuck
  • Leaves partial branch or deletes if no progress
  • Removes ai:implement label
  • Suggests what info would help

Constraints

  • Max turns/tokens per org config
  • 10 min timeout per job
  • Only dev/* branches
  • Cannot modify .mokogitea/ directory
  • Cannot access secrets/.env
  • One job per repo at a time (queue others)

Implementation

  • services/ai/agent.go
  • services/ai/workspace.go
  • services/ai/executor.go
  • models/ai/job.go

Dependencies

  • AI settings
  • #362 (mokogitea-claude[bot])
## Summary Full coding agent that implements issues when assigned to mokogitea-claude[bot] or labeled ai:implement. ## Parent Issue #359 ## Triggers - Issue assigned to mokogitea-claude[bot] - Issue labeled ai:implement - @mention: "implement this" ## Workflow 1. Bot comments: "Working on this" 2. Clone/checkout, create dev/ branch 3. Read .mokogitea/CLAUDE.md 4. Claude agent loop: analyze, explore, implement, test, iterate 5. Commit with Co-Authored-By 6. Push branch, open PR 7. Comment: "Done, see PR #N" ## Failure Handling - Posts what it tried and where it got stuck - Leaves partial branch or deletes if no progress - Removes ai:implement label - Suggests what info would help ## Constraints - Max turns/tokens per org config - 10 min timeout per job - Only dev/* branches - Cannot modify .mokogitea/ directory - Cannot access secrets/.env - One job per repo at a time (queue others) ## Implementation - services/ai/agent.go - services/ai/workspace.go - services/ai/executor.go - models/ai/job.go ## Dependencies - AI settings - #362 (mokogitea-claude[bot])
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#367