cli/pkg/jobrunner
Claude 886c67e560 feat(agentci): rate limiting and native Go dispatch runner
Adds pkg/ratelimit for Gemini API rate limiting with sliding window
(RPM/TPM/RPD), persistent state, and token counting. Replaces the
bash agent-runner.sh with a native Go implementation under
`core ai dispatch {run,watch,status}` for local queue processing.

Rate limiting:
- Per-model quotas (RPM, TPM, RPD) with 1-minute sliding window
- WaitForCapacity blocks until capacity available or context cancelled
- Persistent state in ~/.core/ratelimits.yaml
- Default quotas for Gemini 3 Pro/Flash, 2.5 Pro, 2.0 Flash/Lite
- CountTokens helper calls Google tokenizer API
- CLI: core ai ratelimits {show,reset,count,config,check}

Dispatch runner:
- core ai dispatch run — process single ticket from queue
- core ai dispatch watch — daemon mode with configurable interval
- core ai dispatch status — show queue/active/done counts
- Supports claude/codex/gemini runners with rate-limited Gemini
- File-based locking with stale PID detection
- Completion handler updates issue labels on success/failure

Closes #42

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 03:08:16 +00:00
..
forgejo fix(agentci): use log.E() error pattern, add Charm SSH TODOs 2026-02-09 11:15:11 +00:00
handlers feat(agentci): rate limiting and native Go dispatch runner 2026-02-10 03:08:16 +00:00
journal.go feat(jobrunner): add automated PR workflow system (#329) 2026-02-05 10:36:21 +00:00
journal_test.go feat(jobrunner): add automated PR workflow system (#329) 2026-02-05 10:36:21 +00:00
poller.go feat(jobrunner): add automated PR workflow system (#329) 2026-02-05 10:36:21 +00:00
poller_test.go feat(jobrunner): add automated PR workflow system (#329) 2026-02-05 10:36:21 +00:00
types.go feat(agentci): Clotho orchestrator and security hardening 2026-02-10 03:08:16 +00:00
types_test.go feat(jobrunner): add automated PR workflow system (#329) 2026-02-05 10:36:21 +00:00