Skip to content

refactor: platform provider seam (GitHub only for now) - #36

Merged
wangzhizhou merged 1 commit into
mainfrom
refactor/provider-seam
Nov 10, 2026
Merged

wangzhizhou merged 1 commit into
mainfrom
refactor/provider-seam

Conversation

@wangzhizhou

Copy link
Copy Markdown
Contributor

按计划只做抽象,不实现 GitLab/Gitea。

  • 新增 agent-runner/src/providers/:types.ts(接口 + capabilities)、github.ts(唯一实现)、index.ts(注册表 + resolveProvider)。
  • main.ts 的 Issue/标签/评论/PR/auto-merge/锁/事故闭锁全部走 seam;EASYGH_PROVIDER 选实现,未实现的平台明确报错、不静默回退。
  • GitHub 专属能力(App 发现、workflow dispatch、rulesets)通过 capabilities 标记,未来平台可降级。
  • 区分了模型 provider(deepseek)与平台 provider(github):平台对象命名为 platform。
  • 67 个测试全绿;actionlint 通过。

后续接 GitLab/Gitea 只需实现 Provider + 提供发现仓库机制,见 docs/portability.md §4。

Everything the runner needs from the hosting platform now goes through
`src/providers/`: issues, labels, comments, pull requests, auto-merge, the
claim lock and the incident latch. `github.ts` remains the only implementation
and is wrapped by `providers/github.ts`; the runner resolves it once via
`resolveProvider()` (`EASYGH_PROVIDER`, default `github`).

- capabilities flags make the GitHub-only parts explicit (app-mode discovery,
  atomic tag-ref lock, auto-merge, draft PRs, incident latch) so a future
  GitLab/Gitea provider can degrade instead of pretending.
- unknown providers fail loudly with a pointer to src/providers/<name>.ts and
  docs/portability.md; there is no silent fallback.
- main.ts keeps the model "provider" (deepseek/...) separate from the platform
  "provider" (github): the platform object is `platform`.
- tests: registry, default, env selection, unknown provider, registering a
  custom provider (67 total).
@wangzhizhou
wangzhizhou merged commit db1372c into main Nov 10, 2026
2 checks passed
@wangzhizhou
wangzhizhou deleted the refactor/provider-seam branch November 10, 2026 08:41
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.

1 participant