Skip to content

[feat] Support OpenCode agent and GitLab as git provider #303

Closed

Description

@ceragon

Is your feature request related to a problem? Please describe.

Our team uses OpenCode as the AI coding agent and GitLab (self-hosted) as our git platform. Currently TeamAI CLI only supports Claude Code / Codex / CodeBuddy / WorkBuddy as agents, and GitHub / TGit / CNB as git providers. We'd like to use TeamAI's harness management with our existing toolchain.

Proposed Feature

1. OpenCode Agent Support

Add OpenCode (https://github.com/opencode-ai/opencode) as a supported agent, so that teamai pull can inject skills/rules/docs into OpenCode's configuration format, and hooks (SessionStart, etc.) work in OpenCode sessions.

2. GitLab as a Git Provider

Add GitLab (both gitlab.com and self-hosted instances) as a supported git provider, covering:

  • teamai init — OAuth / token-based auth for GitLab
  • teamai push — create branch + MR via GitLab API
  • teamai pull — fetch and merge from GitLab remote
  • CI MR-extract — work with GitLab webhook / pipeline events

Alternatives Considered

Environment

  • AI Agent: OpenCode (latest)
  • Git Platform: GitLab (self-hosted, v17.x)
  • OS: macOS / Linux

Additional Context

OpenCode has a plugin/extension system and its own config format (.opencode/opencode.jsonc). The integration would need to map TeamAI's harness resources (skills, rules, docs) to OpenCode's conventions.

For GitLab, the MR workflow maps naturally to GitLab's Merge Request API — the main difference from GitHub is the API endpoints and auth mechanism (Personal Access Token or OAuth2).

Activity

  1. Walternater commented on Aug 21, 2026

    @Walternater
    Contributor

    +1 — our team also needs a GitLab provider. Adding some source-level observations from v0.20.0 that may help whoever picks this up:

    1. Provider enum: the provider field in teamai.yaml is currently z.enum(["tgit", "github"]); the schema and the defaulting logic (providerName ?? getDefaultProvider(...), defaults to tgit for backward compat) both need extending.
    2. Module layout: provider code is already organized as providers/<name>/ (existing: tgit, github, cnb), so a providers/gitlab/ would slot in cleanly. The cnb module already demonstrates supporting a self-hosted host via an env var (TEAMAI_CNB_HOST / TEAMAI_CNB_HOST fallback logic) — a TEAMAI_GITLAB_HOST would cover self-hosted GitLab instances the same way.
    3. Hardcoded checks: there are platform-specific branches like mrUrl.includes("github.com") outside the provider modules; those need to be pulled behind the provider interface as part of this work.
    4. What already works: cloning uses plain git clone, so a GitLab remote clones fine — what breaks afterwards is member registration, MR interop, and status reporting, i.e. exactly the provider surface.

    If this doesn't get scheduled soon, we'd also be happy to put together a PR draft following the existing providers/<name>/ structure.

  2. jeff-r2026 commented on Aug 24, 2026

    @jeff-r2026
    Collaborator

    Several recently merged PRs implement large parts of this request:

    OpenCode agent support

    GitLab git provider

    Related (generic-provider alternative)

    Keeping this issue open until OpenCode hooks land, which is the remaining piece.

  3. Walternater commented on Aug 25, 2026

    @Walternater
    Contributor

    Quick follow-up — between forking my work and opening the PR, the upstream GitLab provider shipped in 0.21.0-beta.0 (much more complete than what I'd drafted: 5 files, http.extraHeader to avoid token persistence in .git/config, reviewer_ids resolution, listOrgRepos, GITLAB_URL support). So I scrapped the duplicate implementation and PR'd only the genuinely missing piece: an opt-in live smoke test under src/__tests__/e2e/gitlab-provider-live.test.ts that mirrors the existing cnb-provider-live pattern.

    PR: #321

    Mutating flow (create → clone → push → open-MR) was verified manually against git.guazi-corp.com before opening the PR; the closed !2 with sha=e160899 was created via the same provider code paths shipping in 0.21.0-beta.0, so this works as a regression guard for anyone running the e2e suite with a real GitLab instance.

    Closing out from this end — happy to help on the generic provider path (#300) if that's still on the roadmap.

  4. self-assigned this
    on Aug 25, 2026
  5. added a commit that references this issue on Aug 26, 2026
    d004fcb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions