Skip to content

feat: rewrite from bash to Python3 with worker/platform abstraction#13

Open
xmm1989218 wants to merge 1 commit into
GigleAI:mainfrom
xmm1989218:feat/python-rewrite
Open

feat: rewrite from bash to Python3 with worker/platform abstraction#13
xmm1989218 wants to merge 1 commit into
GigleAI:mainfrom
xmm1989218:feat/python-rewrite

Conversation

@xmm1989218

Copy link
Copy Markdown

动机

Bash 脚本不跨平台(依赖 tmux/jq/flock/systemd),难以扩展新 worker 和新 Git 平台。

改动

  • Bash -> Python 3.11+ 包(零第三方依赖),uv 管理
  • Worker 抽象:WorkerBase 基类 + ClaudeWorker(--bg/attach)+ OpencodeWorker(HTTP API via opencode serve)
  • Git Platform 抽象:PlatformBase 基类 + GitHubPlatform(gh CLI)+ GitLabPlatform(glab CLI)
  • 跨平台文件锁(fcntl/msvcrt)
  • CLI: daemon/poll/setup/status/attach/logs/cleanup/seed
  • 不再依赖 tmux/jq/flock/systemd,daemon 自跑 while True 循环
  • prompt 模板注入 \ 变量(gh/glab)
  • 自动检测 Git 平台(看 git remote URL),检测不到则报错要求手动配 PLATFORM=
  • 101 个单元测试全部通过
  • 旧 scripts/ 标记 deprecated,systemd/ 已删除

验证

  • python -m coding_agent --help
  • python -m pytest tests/ -v (101 passed)
  • python -m coding_agent poll(需 gh auth + coding-agent.config)
  • 所有模块 import 测试通过

- Bash scripts -> Python 3.11+ package (zero third-party deps), managed by uv
- Worker abstraction: WorkerBase + ClaudeWorker (claude --bg/attach) + OpencodeWorker (HTTP API via opencode serve)
- Git Platform abstraction: PlatformBase + GitHubPlatform (gh CLI) + GitLabPlatform (glab CLI)
- Cross-platform file locking (fcntl/msvcrt)
- CLI: daemon/poll/setup/status/attach/logs/cleanup/seed
- No longer depends on tmux/jq/flock/systemd; daemon runs while-True loop
- Prompt templates inject \ variable (gh/glab)
- Auto-detect Git platform from git remote URL; fallback to manual PLATFORM= config
- 101 unit tests all passing
- Old scripts/ marked deprecated; systemd/ removed
@luosky

luosky commented May 21, 2026

Copy link
Copy Markdown
Collaborator

去掉了 tmux 不太行。
tmux session 可以管理自动化环境,包括启动和销毁预览的前后端 server等一系列运维相关操作。
并且也附带给了 agent 获取环境信息的能力,比如我的 agent 不用 mcp,就能自己查后端的 log 来排查问题了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants