Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
feat(cline): reasoning effort via --thinking, plain ClinePass subscription message
Krishna Dobhal5f7bdbfda1d3
diff --git a/server/drivers/acp/cline.test.ts b/server/drivers/acp/cline.test.tsindex ccfa994015..3757641ba9 100644--- a/server/drivers/acp/cline.test.ts+++ b/server/drivers/acp/cline.test.ts@@ -9,7 +9,7 @@ import type { ProviderInstance } from "../../contracts.ts";import { recordEvents, type EventRecorder } from "../../testing/events.ts";import { removeTempDir } from "../../testing/cleanup.ts";import { BUILT_IN_DRIVERS } from "../builtIn.ts";-import { CLINE_SUPPORT, ClineAgentDriver, clinePlanLimit } from "./cline.ts";+import { CLINE_SUPPORT, ClineAgentDriver, clinePlanLimit, clineReportedFailure } from "./cline.ts";import { clineTierModels } from "./cline-models.ts";import { supportsApprovalMode } from "../../../shared/approval-mode.ts";import { assertToolScopeSupported } from "../../../shared/tool-scope-support.ts";@@ -176,6 +176,19 @@ describe("Cline ACP driver", () => {expect(clinePlanLimit(new Error("reached your context window limit"), now)).toBeUndefined();});+ it("says plainly that ClinePass models need a subscription", () => {+ const words = "No access to ClinePass subscription models yet. Subscribe to ClinePass, the low cost open weights model coding plan: https://app.cline.bot/dashboard/subscription?personal=true";+ const failure = clineReportedFailure(new Error(`Internal error: ${words}: ${words} (session/prompt)`));+ expect(failure).toMatchObject({ acpUsageLimit: false, message: expect.stringMatching(/^ClinePass models need a ClinePass subscription\..*pick a free Cline model\.$/) });+ expect(clineReportedFailure(new Error("Invalid params"))).toBeUndefined();+ });++ it("passes effort as --thinking, and omits it when unset", () => {+ const config = { cli: "cline", fullAuto: false };+ expect(CLINE_SUPPORT.spawnArgs(config, { threadId: "t", text: "hi", effort: "high" })).toEqual(["--acp", "--auto-approve", "false", "--thinking", "high"]);+ expect(CLINE_SUPPORT.spawnArgs(config, { threadId: "t", text: "hi" })).not.toContain("--thinking");+ });+it("fails the turn rather than silently using a fallback model", async () => {const { instance, recorder } = await create("set-model-invalid-params");await instance.adapter.sendTurn({ threadId: "cline-model-refused", text: "hello", model: "cline-default" });diff --git a/server/drivers/acp/cline.ts b/server/drivers/acp/cline.tsindex f3c2407b1a..eeaff4cddf 100644--- a/server/drivers/acp/cline.ts+++ b/server/drivers/acp/cline.ts@@ -77,7 +77,18 @@ export function clinePlanLimit(error: unknown, now = Date.now()): AcpReportedFaireturn new AcpReportedFailure({ ...failure, ...(resetsAt === undefined ? {} : { limitResetsAt: resetsAt }) }, true);}-type ConfigOption = { id?: string; currentValue?: unknown };+/** Cline 3.0.74: "No access to ClinePass subscription models yet. Subscribe to ClinePass, ...: https://app.cline.bot/..." */+const NO_PASS = /\bNo access to ClinePass subscription models\b/i;++export function clineReportedFailure(error: unknown): AcpReportedFailure | undefined {+ const text = error instanceof Error ? error.message : typeof error === "string" ? error : "";+ if (!NO_PASS.test(text)) return clinePlanLimit(error);+ return new AcpReportedFailure({+ message: "ClinePass models need a ClinePass subscription. Subscribe at https://app.cline.bot/dashboard/subscription?personal=true, or pick a free Cline model.",+ }, false);+}++type ConfigOption ={ id?: string; currentValue?: unknown };export const CLINE_SUPPORT: AcpSupport = {driverKind: "clineAgent",@@ -94,7 +105,9 @@ export const CLINE_SUPPORT: AcpSupport = {signInCommand: "cline auth",},// Never inherit Cline's terminal auto-approval default or a saved grant: the ACP broker answers permissions.- spawnArgs: () => ["--acp", "--auto-approve", "false"],+ // Cline 3.0.74 has no ACP effort option; without --thinking it reuses the level last chosen in its TUI.+ effortLevels: ["none", "low", "medium", "high", "xhigh"],+ spawnArgs: (_config, turn) => ["--acp", "--auto-approve", "false", ...(turn.effort ? ["--thinking", turn.effort] : [])],restartOnMcpChange: true,credentialEnv: ["CLINE_API_KEY"],transformEnv(env, config) {@@ -148,7 +161,7 @@ export const CLINE_SUPPORT: AcpSupport = {await request("session/set_model", { sessionId, modelId: model });}},- reportedFailure: (error) => clinePlanLimit(error),+ reportedFailure: clineReportedFailure,};export const ClineAgentDriver = {