Add teabot daemon implementation #1
Reference in New Issue
Block a user
Delete Branch "benvin/teabot-initial"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bootstraps the teabot daemon: a Go service (systemd user unit) that watches Gitea repos and dispatches one-shot Claude Code sessions in Docker containers to work issues and review pull requests, acting as configurable bot personalities. The container image reuses the existing
agent-devimage (already bundles the claude CLI + dev toolchain), so no new image is built.Because sessions run
claude --dangerously-skip-permissionswith a prompt built from event text, dispatch is gated by a fail-closed author allowlist so untrusted accounts cannot inject instructions into a permissionless session.internal/:config(config.yaml + per-personality tea-config parsing, defaults, validation),gitea(read-only REST client for issues/pulls/comments/diff),state(atomic JSON persistence of processed events),prompt(per-event prompt construction),dispatch(poll loop, loop prevention, first-contact seeding, follow-up routing, bounded concurrency), anddocker(containerisedclaude --printexecution behind aRunnerinterface)allowed_authorsallowlist (with optional per-reporepo_allowed_authorsoverride): only events authored by allowlisted logins spawn a container; others are recorded processed-only and logged; an empty allowlist dispatches nothing and warns at startup; comment follow-ups gate on the new comment's author, not merely the acted-on threadinternal/cli,main.go) withrun(--once,--log-json,--log-level),config init/config show, and shell completionsANTHROPIC_API_KEY/ANTHROPIC_BASE_URLinjection and SELinux:zrelabelsmake patch|minor|major, nfpm RPM spec (binary + completions + systemd user unit + example config),scripts/build-rpm.sh, and.woodpeckerpipelines (build/test/pre-commit on PR; test + cross-platform build + RPM PUT to artifactapi + Gitea release onv*tags), every step setting k8s resource requests+limitsdocs/(architecture, configuration incl. the allowlist security rationale, run, config) linked from the README, plusAGENTS.mdhttps://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv