2.7 KiB
2.7 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 436e133f-2c31-488a-9810-fb6ca5b45250 | solution | Refactor: issue-poller.sh — replaced 5 of 6 Haiku+MCP calls with direct curl+jq Gitea API calls |
|
0.8 | 0.8 | 2026-03-03T21:25:29.636362+00:00 | 2026-03-03T21:26:00.855903+00:00 |
|
Issue-Poller Refactor: Haiku → curl+jq
Project
claude-scheduled / issue-poller automation
File
~/.config/claude-scheduled/issue-poller.sh
Motivation
- Haiku spawned for simple CRUD operations was slow (~60-90s discovery phase) and expensive (~$0.80-1.00/run)
- The MCP wrapper for list_repo_issues was causing an infinite loop (see related bug fix memory)
What Was Replaced (5 of 6 calls)
| Old (Haiku+MCP) | New (curl+jq) | Endpoint |
|---|---|---|
| Auth check | gitea_get /user | GET /api/v1/user |
| List issues | gitea_get /repos/{owner}/{repo}/issues?type=issues | GET with type filter |
| Label race-check | gitea_get issue + jq | GET issue JSON |
| Add label | gitea_post labels | POST /issues/{id}/labels |
| Post-worker label swap | gitea_delete + gitea_post | DELETE + POST labels |
What Was Kept (1 call)
- Feasibility check — genuinely needs AI reasoning to determine if an issue is actionable
Helper Functions Added
gitea_get() # curl GET wrapper with auth
gitea_post() # curl POST wrapper with JSON body
gitea_delete() # curl DELETE wrapper
ensure_label() # search existing labels before creating (prevents duplicates)
add_label() # add label to issue
remove_label() # remove label from issue
Token Source
~/.config/claude-scheduled/secrets
Performance Improvement
- Discovery phase: ~60-90s → ~2s
- Cost savings: ~$0.80-1.00/run