Skip to content

feat(server): add Cline provider over ACP - #8028

Open
amanthanvi wants to merge 9 commits into
pingdotgg:mainfrom
amanthanvi:t3code/add-cline-provider
Open

feat(server): add Cline provider over ACP#8028
amanthanvi wants to merge 9 commits into
pingdotgg:mainfrom
amanthanvi:t3code/add-cline-provider

Conversation

@amanthanvi

@amanthanvi amanthanvi commented Aug 23, 2026

Copy link
Copy Markdown

What Changed

Adds Cline as a sixth built-in, Early Access provider over the official cline --acp transport.

  • registers Cline across contracts, provider instances, server orchestration, diagnostics, web/desktop, mobile, marketing, and docs
  • uses Cline's exact ACP-advertised id: "model" catalog and rejects provider IDs, stale IDs, empty catalogs, and invented fallback models
  • reuses credentials established by cline auth or CLINE_API_KEY; T3 never invokes ACP authenticate, which can open OAuth in a browser on the host
  • bounds interactive and health startup/shutdown, including TERM-ignoring subprocesses, and resumes exact sessions through the authoritative session/load response
  • serializes each model change with its matching prompt and publishes completion atomically across concurrent steers
  • advertises and enforces only Full access + Build; saved unsupported state stays visible and blocked until the user explicitly changes it, with no silent permission escalation
  • blocks unsupported image drafts and direct preview annotations across web/mobile/new-task/outbox paths while preserving user input
  • keeps Cline out of background title/branch/commit/change-request generation and withholds T3 MCP/browser credentials that current Cline ACP does not consume
  • cleans up prompt RPC children across cancellation and pre-registration failure paths
  • preserves numeric-zero immediate force-kill escalation and visibly explains unsupported modes, empty model catalogs, and unavailable source-control writer backends
  • uses Cline's official robot vector

Known product boundaries are explicit: images, T3 agent-browser/preview MCP, background text generation, Plan, non-Full-access modes, structured input, and rollback are unsupported by this integration until upstream can uphold those contracts safely.

Why

Cline users can control their existing CLI through T3 Code's local and remote architecture without a provider-specific client path. The conservative capability contract prevents the UI or server from claiming permissions, attachments, MCP tools, or background behavior that current Cline ACP cannot enforce.

Official references: Cline SDK, Cline ACP usage, Cline CLI ACP agent.

UI Changes

Adds the official Cline icon, provider settings/model states, Full-access/Build capability gates, and attachment-unavailable states on web and mobile. Before/after web and mobile evidence is attached to the PR. No motion or timing behavior was added.

Validation

  • frozen changed-test inventory before the final bot follow-up: 23 passed / 1 opt-in live-probe skipped files; 485 passed / 3 skipped tests
  • final follow-up suite: 3 files and 94/94 tests passed; all 5 new concurrency/auth/capability regressions passed deterministically
  • immediate force-kill propagation: 2 files and 36/36 tests passed, including wrapper-to-spawner forwarding of numeric zero
  • final client-state suite: 7 files and 125/125 tests passed; unsupported-mode warnings, empty-catalog send reasons, source-writer recovery, and preview draft preservation are covered
  • final blocked-submit lifecycle suite: 3 files and 78/78 tests passed; mode correction and unsupported-image removal clear only the stale validation message while preserving the draft
  • stable typed-error contract suite: 2 files and 29/29 tests passed; adapter and driver wrappers retain their exact nested typed causes while exposing stable lifecycle-stage details
  • pending user-input submission suite: 2 files and 30/30 tests passed; structured answers bypass provider-only availability gates while ordinary sends and final dispatch rejection remain blocked
  • carried-image restriction suite: 5 files and 115/115 focused tests passed; the active dispatch provider now drives a persistent mode-or-attachment banner without broad draft subscriptions
  • differing-model concurrency regression repeated 5/5 successfully
  • contracts, shared, server, web, and mobile typechecks; server reported only unrelated existing Effect suggestions
  • marketing check: 0 errors, 0 warnings, and 0 hints
  • changed-file formatting, deny-warnings lint, git diff --check, and SVG validation
  • integrated provider settings verification on web/desktop and provider/model/composer verification in the iOS Simulator
  • independent GPT-5.6 Sol adversarial review: GO, no P1/P2 blocker
  • independent GPT-5.6 Luna Extra High monitor: GO, no P1/P2 blocker

The authenticated live cline --acp probe remains opt-in and was skipped because Cline is not installed or authenticated in this isolated environment. It requires a current authenticated Cline CLI and a disposable repository; T3 does not trigger the provider's browser-based authentication flow automatically.

Checklist

  • This PR is small and focused — it is one provider concern, but the required server/contracts/web/mobile/docs surface exceeds the repository's small-PR guidance
  • I explained what changed and why
  • I included before/after evidence for the UI changes
  • Video is not applicable; no animation or motion behavior changed

Implemented and reviewed with GPT-5.6 Sol and GPT-5.6 Luna in T3 Code through the Codex harness.

Cline CLI (`cline --acp`) speaks Agent Client Protocol v1 over stdio
with session resume, plan/act modes, permission prompts, and a
config-option model catalog. This wires it in as a built-in driver on
the shared ACP runtime alongside Cursor and Grok: driver + adapter +
status probe + text generation, contracts settings, web/mobile
presentation, docs, and mock-agent test coverage.

Unlike the other ACP drivers, Cline's `authenticate` blocks in an OAuth
device flow until the user signs in, so the status probe tracks
authenticate request phases and surfaces an explicit unauthenticated
state pointing at `cline auth login` instead of a generic failure.
Copilot AI lite review requested due to automatic review settings August 23, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b7b4e95-0fc1-46e0-8aea-c5d23744073a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 23, 2026
Comment thread apps/web/src/components/ChatView.tsx Outdated
Comment thread apps/mobile/src/features/threads/ThreadComposer.tsx
Comment thread apps/mobile/src/state/use-thread-outbox-drain.ts
Comment thread apps/web/src/modelSelection.ts Outdated
Comment thread apps/web/src/components/settings/SourceControlWritingSettings.tsx Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx
Comment thread apps/server/src/provider/Layers/ClineAdapter.ts
Comment thread apps/server/src/serverSettings.ts Outdated
Comment thread apps/server/src/provider/Layers/ClineAdapter.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the web UI changes for the Cline provider (composer capability gating, provider icon, settings/model-picker fallbacks).

Three findings, all in apps/web/src:

  1. ChatComposer.tsx — Plan-mode capability is read from two different sources in the same component (driver default snapshot vs. selected instance snapshot), so the footer toggle and the /plan slash command can disagree.
  2. ChatComposer.tsx — an empty model catalog now replaces the provider/model picker with the disabled "No provider available" button, removing the only composer affordance for switching provider, and making the new No model available trigger fallback unreachable on this path.
  3. Icons.tsxClineIcon routes its brand color through text-*/currentColor while every other provider mark uses fill-*, so an existing call site's text-foreground/80 recolors it.

Runtime-mode filtering, the compact controls menu, the custom-model section fallback, and the source-control writer toggle all look consistent with the existing primitives.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/chat/ChatComposer.tsx Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx Outdated
Comment thread apps/web/src/components/Icons.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This adds a full Cline ACP provider with new subprocess, authentication, session, model-discovery, permission, and cancellation behavior, plus cross-cutting web, mobile, contract, and outbox changes. The breadth and runtime sensitivity of the integration warrant human review.

You can add or adjust custom eligibility rules. Learn more.

Comment thread apps/server/src/provider/acp/AcpSessionRuntime.ts Outdated
Comment thread apps/server/scripts/acp-mock-agent.ts
Comment thread apps/server/src/provider/Layers/ClineAdapter.ts
@amanthanvi

Copy link
Copy Markdown
Author

UI evidence

Before — provider settings:

Provider settings before Cline

After — web provider settings:

Cline provider settings on web

After — mobile provider/model selection:

Cline provider model selection on mobile

No motion or timing behavior changed.

Comment thread apps/server/src/provider/acp/AcpSessionRuntime.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the web UI surface of this PR (composer capability gating, provider picker fallbacks, settings rows, ClineIcon). The three findings from the previous run are resolved: ClineIcon now paints via fill-*/stroke-* like the sibling brand marks, plan-mode capability reads a single source (selectedProviderStatus), and an empty model catalog no longer replaces the whole ProviderModelPicker.

Two remaining consistency issues, both about a newly persistent restricted state that is never explained on screen.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ChatView.tsx
Comment thread apps/web/src/components/settings/SourceControlWritingSettings.tsx
Comment thread apps/web/src/components/ChatView.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding: the new "provider entry available but empty model catalog" state leaves the Send button enabled while the send path silently drops the submission. Prior findings (Cline icon paint, plan-toggle capability source, picker replacement) look resolved.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/chat/ChatComposer.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the new Cline provider modules (ClineDriver, ClineAdapter, ClineProvider, ClineAcpSupport, Services/ClineAdapter) plus the AcpSessionRuntime / ProviderDriver / TextGeneration changes against the Effect service conventions.

Two error-construction violations introduced in the new files: a wrapper's detail (and therefore its message) is derived from cause.message instead of stable structural attributes. The underlying error is already preserved as cause, so the copied string adds nothing and defeats the structured-error rule.

Everything else looked consistent with the conventions: subpath namespace imports, per-instance adapter closures matching the existing driver bundle model, Schema.TaggedErrorClass failures with cause, Effect.catchTags-free structural handling, and no ManagedRuntime/runPromise leaking into services.

Note (not flagged inline): makeClineAcpRuntime takes childProcessSpawner: ChildProcessSpawner.ChildProcessSpawner["Service"] as an input field and re-provides it via Layer.succeed, rather than requiring the service in the environment. It mirrors GrokAcpSupport/CursorAcpSupport exactly and the callers do acquire it with yield* ChildProcessSpawner.ChildProcessSpawner, so requirements stay visible; acquiring it inside the helper would be the cleaner shape if these modules are revisited.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/Drivers/ClineDriver.ts Outdated
Comment thread apps/server/src/provider/Layers/ClineAdapter.ts Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx
Comment thread apps/web/src/components/chat/ChatComposer.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 14139e8. Configure here.

Comment thread apps/web/src/components/chat/ProviderModelPicker.logic.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding: the new send-block for provider-rejected image attachments has no persistent visible surface, unlike the mode block that now gets a composer banner. Previously flagged items (ClineIcon brand paint, picker hidden on empty catalog, instance-scoped plan-mode capability, silent empty-catalog send, mode-block banner, dead source-control-writer switch) all look addressed.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ChatView.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants