Commit Graph
5983 Commits
Author SHA1 Message Date
Max Paulus 🥪 9ea8dcf3b7 fix integration tests 2026-05-29 11:57:47 -07:00
Dominic Cooney f4d97c1ef3 fix: declare missing direct dependencies in apps/vscode
jwt-decode, js-yaml, and tar are imported by the apps/vscode workspace (jwt-decode in ClineAuthProvider/OCA, js-yaml in frontmatter parsing, tar in scripts/download-ripgrep.mjs) but were not declared in apps/vscode/package.json. They were either dropped when firebase was retired (1335fa545) or never declared in the first place because npm hoisting from a transitive `@sap/xssec`/etc. made them resolve locally. On a clean CI install they did not resolve.

Adds:

  - jwt-decode @ ^4.0.0 (dependencies)

  - js-yaml   @ ^4.1.1 (dependencies, version pinned via existing overrides)

  - tar       @ ^7.5.2 (devDependencies, only used by scripts/download-ripgrep.mjs)

Regenerates package-lock.json via `npm install --package-lock-only` so `npm ci --include=optional` passes.
2026-05-29 11:57:47 -07:00
Dominic Cooney 0f395c6904 chore: fix lint and format on the vscode app
Lint fixes:

- hook-factory.test.ts: merge duplicate top-level beforeEach hooks (noDuplicateTestHooks)

- system-prompt integration tests: extract shared mockProviderInfo into a new prompt-test-fixtures.ts helper so it is no longer exported from a *.test.ts file (noExportsInTest); update importers accordingly

Format fixes:

- biome format --changed --write across the vscode app; purely cosmetic line-collapse/break adjustments, no semantic changes
2026-05-29 11:57:47 -07:00
Max Paulus 🥪 850f5bbabb remove timing code 2026-05-29 11:57:46 -07:00
Max Paulus 🥪 d8c6a9a394 harden perf improvements 2026-05-29 11:57:46 -07:00
Max Paulus 🥪 775715314a improve task startup perf 2026-05-29 11:57:46 -07:00
Max Paulus 🥪 63561d255d add telemetry to sdk extension
Wire SDK/core telemetry into the SDK-backed VS Code session path so
`@cline/core` can emit telemetry events through the SDK
`ITelemetryService` interface, while preserving VS Code and Cline user
opt-out behavior.

- Use the SDK's own telemetry service, not the legacy extension
`TelemetryService`, for SDK/core events.
- Configure the SDK telemetry service using SDK-style OpenTelemetry
environment variables:
  - `OTEL_TELEMETRY_ENABLED`
  - `OTEL_METRICS_EXPORTER`
  - `OTEL_LOGS_EXPORTER`
  - `OTEL_TRACES_EXPORTER`
  - `OTEL_EXPORTER_OTLP_PROTOCOL`
  - `OTEL_EXPORTER_OTLP_ENDPOINT`
  - `OTEL_EXPORTER_OTLP_HEADERS`
  - `OTEL_METRIC_EXPORT_INTERVAL`
- Do not bridge the legacy extension `CLINE_OTEL_*` config into this SDK
telemetry path.
- Do not make the legacy extension `TelemetryService` implement SDK
`ITelemetryService`.
- Do not inject telemetry from `src/sdk/cline-session-factory.ts`; keep
that factory focused on session config construction from
state/provider/model settings.
- Own the shared SDK telemetry handle in `SdkController`, because it
owns the SDK session lifecycle for the VS Code extension.
- Pass the shared telemetry service down through:
  - `SdkController`
  - `SdkSessionLifecycle`
  - `VscodeSessionHost`
  - `ClineCore.create({ telemetry })`
  - `CoreSessionConfig.telemetry` via
`VscodeSessionHost.prepare.applyToStartSessionInput(...)`
- Preserve existing per-session telemetry if remote config or another
prepare step already set `config.telemetry`:

  ```ts
  telemetry: inputWithRemoteConfig.config.telemetry ?? options.telemetry
  ```

The SDK telemetry service must be wrapped by a VS Code/Cline policy
gate.

Ordinary telemetry includes:

- `capture(...)`
- `recordCounter(...)`
- `recordHistogram(...)`
- `recordGauge(...)`

These calls are allowed only when both are true:

1. VS Code/host telemetry is enabled.
2. Cline's `telemetrySetting` is not `"disabled"`.

`"unset"` counts as allowed, matching the existing extension behavior.

`captureRequired(...)` bypasses Cline's `telemetrySetting ===
"disabled"`, but still respects VS Code/host telemetry disabled.

This keeps VS Code's global telemetry setting as the hard privacy gate.

The wrapper starts with host telemetry disabled until
`HostProvider.env.getTelemetrySettings({})` resolves.

This is privacy-conservative: early events are dropped rather than
emitted before VS Code's host telemetry setting is known.

The wrapper also subscribes to
`HostProvider.env.subscribeToTelemetrySettings(...)` so runtime VS Code
telemetry changes are reflected.

- `SdkController` creates the shared SDK telemetry handle once.
- `SdkController.dispose()` disposes the shared SDK telemetry handle.
- `VscodeSessionHost` does not own or dispose the telemetry handle.
- `ClineCore.dispose()` does not dispose the telemetry object it
receives, so passing the shared telemetry service into per-session
`ClineCore` instances is safe.

- [x] Add `src/sdk/sdk-telemetry.ts`.
- [x] In `sdk-telemetry.ts`, create a VS Code SDK telemetry handle using
`createConfiguredTelemetryHandle(createClineTelemetryServiceConfig(...))`.
- [x] In `sdk-telemetry.ts`, add a policy wrapper implementing SDK
`ITelemetryService`.
- [x] Gate ordinary telemetry on both VS Code host telemetry and Cline
`telemetrySetting !== "disabled"`.
- [x] Gate `captureRequired(...)` on VS Code host telemetry only.
- [x] Initialize host telemetry state asynchronously from
`HostProvider.env.getTelemetrySettings({})`, defaulting to disabled
until resolved.
- [x] Subscribe to host telemetry changes via
`HostProvider.env.subscribeToTelemetrySettings(...)`.
- [x] Ensure metadata/common-property mutator methods always delegate to
the underlying SDK telemetry service.
- [x] Ensure `flush()` and `dispose()` delegate to the SDK telemetry
handle and clean up any local subscription state.
- [x] Add a shared SDK telemetry field to `SdkController`.
- [x] Create the shared telemetry handle in `SdkController`
construction.
- [x] Dispose the shared telemetry handle in `SdkController.dispose()`.
- [x] Add `telemetry?: ITelemetryService` to
`SdkSessionLifecycleOptions`.
- [x] Pass telemetry from `SdkController` into `SdkSessionLifecycle`.
- [x] Pass telemetry from `SdkSessionLifecycle` into
`VscodeSessionHost.create(...)`.
- [x] Add `telemetry?: ITelemetryService` to `VscodeSessionHostOptions`.
- [x] Pass `options.telemetry` to `ClineCore.create({ telemetry:
options.telemetry, ... })`.
- [x] In `VscodeSessionHost.prepare.applyToStartSessionInput(...)`, set
`config.telemetry` to existing `config.telemetry` or
`options.telemetry`.
- [x] Remove any telemetry injection from
`src/sdk/cline-session-factory.ts`.
- [x] Add unit coverage for the policy wrapper behavior.
- [x] Add/adjust tests for telemetry propagation through
`SdkSessionLifecycle` and `VscodeSessionHost`.
- [x] Run targeted tests for changed SDK files.
- [x] Run TypeScript validation for the touched paths.

Evidence to collect during implementation:

- SDK `session.started` is emitted through the shared SDK telemetry
service when allowed.
- SDK local runtime events that read `config.telemetry` receive the same
service.
- Ordinary events are dropped when Cline `telemetrySetting` is
`"disabled"`.
- Ordinary and required events are dropped when VS Code host telemetry
is disabled.
- Required events still emit when Cline telemetry is disabled but VS
Code host telemetry is enabled.
- Remote-config-provided `config.telemetry` is preserved and not
overwritten by the VS Code default telemetry service.
2026-05-29 11:57:46 -07:00
Dominic Cooney c5c02b5514 fix(mcp): accept CLI-authored nested transport format, preserve oauth/metadata, improve schema error messages
The Cline CLI (cline mcp add) writes servers in a nested transport format:
  { transport: { type, url }, disabled, oauth }

The VSCode extension only accepted the flat format it writes:
  { type, url, disabled, autoApprove }

This caused all MCP servers to silently disappear with a generic
'Invalid MCP settings schema.' error that told users nothing useful.

Changes:
- schemas.ts: Add nestedTransportConfigSchema as the first union arm in
  ServerConfigSchema, placed first so the 'transport:' key acts as an
  unambiguous discriminator. The transform flattens nested -> flat format
  with zero downstream impact (connection logic unchanged).
- schemas.ts: Add oauth and metadata passthrough fields to BaseConfigSchema
  so CLI-written OAuth state and metadata survive round-trips when the
  extension modifies the file (e.g. toggling disabled).
- McpHub.ts: Dramatically improve error messages — include file path,
  per-server breakdown of which fields failed (from Zod error paths), and
  an 'Open Settings File' button for one-click navigation.
- schemas.test.ts: 14 new tests covering nested format, flat format,
  mixed files, oauth/metadata preservation, and error rejection.
2026-05-29 11:57:46 -07:00
Dominic Cooney a4a5a45135 sdk migration: squashed pre-2026-05-22 work
Collapses the early SDK-migration history (through 2026-05-20) into a single commit. Later commits are preserved individually.
2026-05-29 11:57:34 -07:00
Tomás BarreiroandSaoud Rizwan 791d238996 Move vscode to apps (#10961)
* Move all vscode related files to /apps/vscode

* Fix launch and biome

* Ignore generated files

* Remove unused icons

* fix tsconfig

* Update workflows (#10962)

* Add default branch

* Move files to the right dir

* fix: add vscode publish README placeholder

---------

Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
2026-05-25 21:35:59 +02:00
Ara 9ee618111d bump version and update changelog (#11036) v3.85.0 2026-05-25 10:47:32 -07:00
tjandy98 4bec5931f6 add gpt-5.5 (#11032) 2026-05-25 06:30:21 -07:00
Saoud Rizwan 3115679031 feat: add DeepSeek V4 models (#11027)
* feat: add DeepSeek V4 models

* fix: align DeepSeek V4 cache pricing
2026-05-25 06:29:49 -07:00
Saoud Rizwan 8a6441fddd chore(cli): release v3.0.13 cli-v3.0.13 2026-05-22 17:41:54 -07:00
Saoud Rizwan 7ef5b1e7af test(llms): add provider VCR smoke tests to prevent e.g. ChatGPT regressions (#11012)
* test(llms): add provider vcr smoke tests

* fix(llms): harden provider vcr recording cleanup
2026-05-22 17:37:20 -07:00
Saoud Rizwan 3e58e7b024 fix(cli): show loading dialog for history resume (#11013) 2026-05-22 17:20:59 -07:00
Willis d16667f0b8 fix: use correct base URL for Vertex AI global endpoint with Claude models (#10288)
* fix: use correct base URL for Vertex AI global endpoint with Claude models

The AnthropicVertex SDK constructs the API hostname as
`${region}-aiplatform.googleapis.com`, which produces
`global-aiplatform.googleapis.com` when region is "global".
This hostname does not exist and returns 404.

Per Google Cloud docs, the correct global endpoint hostname is
`aiplatform.googleapis.com` (no region prefix). This fix overrides
the baseURL when region is "global" to use the correct hostname.

Fixes #10287

* chore: add changeset for vertex global endpoint fix

* fix: rebase on main and re-apply global endpoint baseURL override
2026-05-22 17:11:15 -07:00
Saoud Rizwan a740c49524 fix(cli): defer empty session creation after reset (#11000)
* fix(cli): skip empty clear session restart

* fix(cli): defer empty session creation after reset

* fix(cli): clarify session start race guard

* fix(cli): avoid re-resuming after new session reset
2026-05-22 17:02:47 -07:00
Saoud Rizwan 3bc1ee8382 feat(shared): add VCR request body contracts (#10997)
* feat(shared): add VCR request body contracts

* fix(shared): tighten VCR request body contracts

* test(shared): cover legacy VCR cassette playback
2026-05-22 16:00:36 -07:00
Saoud Rizwan ecf354c753 chore(cli): release v3.0.12 cli-v3.0.12 2026-05-22 15:14:29 -07:00
TheRealSpencer a66c5ee973 chore(deps): pin protobuf to 7.5.8 via overrides (#10998) 2026-05-22 15:11:06 -07:00
Saoud Rizwan 46659eebeb fix(cli): show loading dialog during model settings transitions (#10999)
* fix(cli): show loading dialog during model settings transitions

* docs(cli): explain loading dialog render yield
2026-05-22 14:54:16 -07:00
Saoud Rizwan 899ee0bfea fix(cli): add inline ask question tool prompt (#10989)
* fix(cli): inline runtime tool prompts

* fix(cli): address inline prompt review
2026-05-22 13:57:01 -07:00
Bee db4598e310 Cline SDK 0.0.42 (#10994)
Version bump
sdk/sdk/v0.0.42 sdk/agents/v0.0.42 sdk/llms/v0.0.42 sdk/shared/v0.0.42 sdk/core/v0.0.42
2026-05-22 13:31:48 -07:00
Saoud Rizwan 627e539266 fix(cli): bypass release age gate for manual updates (#10987)
* fix(cli): bypass release age gate for manual updates

* fix(cli): use yarn env override for update age gate
2026-05-22 13:29:25 -07:00
Saoud Rizwan 87ff61915f chore(cli): release v3.0.11 cli-v3.0.11 2026-05-22 13:03:25 -07:00
Saoud Rizwan a305556452 fix(llms): revert implicit output cap regression (#10990)
* fix(llms): avoid implicit output token caps

* test(llms): cover ChatGPT OAuth output token regression
2026-05-22 12:59:43 -07:00
Robin Newhouse ca12e97288 fix(cli): make config footer toggle hint contextual (#10976) 2026-05-22 12:34:48 -07:00
Bee 0c89716849 feat(core): includes tool names in tool results across messages (#10975)
* fix(llms): Use Google auth for Vertex Gemini

- Pass `providerConfig.gcp.projectId` through to Vertex Gemini as `googleAuthOptions.projectId`
- Disable Vertex API-key express mode when GCP project config is present so `google-auth-library` handles auth
- Add coverage for `AgentConfig.providerConfig.gcp` forwarding and Vertex Gemini provider creation
- Fix vertex model list only contains Claude models issue

* feat(core): includes tool names in tool results across messages

Updated `tool_result` content blocks to consistently include the `name` of the tool being executed. This change propagates through provider helpers and applies the new schema across all associated unit and live tests, ensuring proper tracking and logging of tool interactions within messages.
2026-05-22 11:36:32 -07:00
Robin Newhouse 1c401dbe1a Fix SDK LLM live provider configs (#10977) 2026-05-22 11:04:33 -07:00
Bee ed78404e4b fix(llms): Use Google auth for Vertex Gemini (#10974)
- Pass `providerConfig.gcp.projectId` through to Vertex Gemini as `googleAuthOptions.projectId`
- Disable Vertex API-key express mode when GCP project config is present so `google-auth-library` handles auth
- Add coverage for `AgentConfig.providerConfig.gcp` forwarding and Vertex Gemini provider creation
- Fix vertex model list only contains Claude models issue
2026-05-22 11:02:35 -07:00
Saoud Rizwan 0157ed9efb chore(cli): release v3.0.10 cli-v3.0.10 2026-05-21 20:23:07 -07:00
Saoud Rizwan 5574c95ff2 docs(cli): note ignore-scripts local pack guard quirk in publish-cli skill 2026-05-21 20:22:44 -07:00
Saoud Rizwan 31ee8eb744 feat(cli): install plugins from file URLs (#10945)
* feat(cli): install plugins from file URLs

* fix(cli): harden remote plugin installs

* docs: document plugin file URL installs

* docs: simplify plugin file URL wording

* docs: trim CLI plugin example
2026-05-21 19:58:20 -07:00
Renee HuangandSaoud Rizwan 7952e230ae Add Ollama API key note in TUI settings (#10947)
* Add Ollama API key note in TUI settings

* refactor: centralize provider config field metadata

---------

Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
2026-05-21 16:27:31 -07:00
Bee 6bcfa34ba9 feat(sdk): track idle and pending session states (#10959)
* feat(runtime): track idle and pending session states

Propagate idle and pending as non-terminal session statuses across the CLI, hub records, and active-session checks. Update runtime handling so interactive sessions remain active while idle or awaiting approval instead of being treated as ended.

Removed `status` from showing up in `cline history` for now.

* hydrate: false no longer reads message files for every session.
2026-05-21 16:09:45 -07:00
Ara cf18793434 feat(sdk): add Poolside provider (#10956) 2026-05-21 16:04:38 -07:00
Saoud Rizwan a7ba25d6e1 feat(uri): add /lg-task webhook integration for LG dashboard flow (#10194)
* feat(uri): add LG task deeplink webhook integration

* feat(uri): include prompt-file path in LG task prompt

* refactor(uri): move LG webhook setup into integration service
2026-05-21 16:03:21 -07:00
Ara 2af2028861 feat: add Gemini 3.5 Flash to Gemini providers (#10955) 2026-05-21 15:43:44 -07:00
Ara 932c8e68e1 Infer Telegram bot username from token (#10954)
* fix(cli): infer Telegram bot username from token

* fix(cli): address Telegram connector review feedback

* test(cli): confirm Telegram schedule delivery bot metadata

* fix(core): publish schedule completion events to connectors

* Revert "fix(core): publish schedule completion events to connectors"

This reverts commit 0d64f037b9.
2026-05-21 15:03:36 -07:00
Bee 3cd13352eb fix(cron): publish failed schedule execution events (#10937)
* fix(cron): publish failed schedule execution events

Add cron runner execution event publishing for completed and failed runs.
Update connector adapters to react to failed schedule executions so clients are notified when scheduled work does not complete successfully.

* add unit tests
2026-05-21 14:57:26 -07:00
Tomás Barreiro 2c842328a8 Inject OTEL variables into the cli at buildtime (#10958)
* Inject OTEL variables

* Add telemetry to the nightly

* Add variables to the build script
2026-05-21 23:43:30 +02:00
Saoud Rizwan d3b3ff1c33 fix(cli): satisfy config item hook lint (#10968) 2026-05-21 14:38:36 -07:00
Robin Newhouse 2508e76af8 Fix SDK model catalog token-limit semantics ENG-2100 (#10946)
* fix(llms): preserve catalog output limits

* chore(llms): regenerate model catalog
2026-05-21 14:19:35 -07:00
Ara a702bf9b38 fix(cli): soften rejected tool call display (#10871) 2026-05-21 14:00:55 -07:00
Robin Newhouse a8cea1dca3 Fix disabled skill availability in SDK CLI ENG-2058 (#10876)
* fix(sdk): hide skills tool when skills are disabled

* fix(cli): refresh skill slash commands after toggle
2026-05-21 11:23:14 -07:00
Bee 2a351ffdd5 fix: Bedrock legacy migration for awsProfile (#10943)
The new Bedrock path is not failing because credential_process is unsupported. Both old and new code use AWS SDK v3’s fromNodeProviderChain, which can load credential_process.

The practical difference is that the migrated config does not include the AWS profile name:

```
"aws": {
  "region": "us-east-1",
  "authentication": "profile"
}
```

There is no `"profile": "bedrock"` So the new llms provider never targets [profile bedrock]. It calls fromNodeProviderChain({ ignoreCache: true, clientConfig: { region } }), which means AWS SDK will use AWS_PROFILE if present, otherwise default.

## Cause

The migration code only migrates awsProfile when legacy awsUseProfile is true. But the old extension treats profile auth as active when awsAuthentication === "profile" too:

```
profile:
  legacyGlobalState.awsAuthentication === "profile" || legacyGlobalState.awsUseProfile
    ? trimNonEmpty(legacyGlobalState.awsProfile)
    : undefined
    ```

## Fixes

The migration now preserves awsProfile when awsAuthentication === "profile", even if the old awsUseProfile flag is missing. It also treats profile-based Bedrock settings as enough to migrate Bedrock without static AWS keys.
2026-05-20 16:46:38 -07:00
Bee 69f148bad9 refactor: cache global settings reads by file metadata (#10933)
* refactor: cache global settings reads by file metadata

Avoid repeated global settings file reads by caching parsed settings and
validating the cache with path, mtime, and size. Invalidate the cache after
writes so updates remain visible, and clarify the legacy skills config name.

* refactor for performance

mtime-keyed cache of the parsed GlobalSettings — repeated reads do statSync + 4 comparisons instead of readFile + JSON.parse + zod (~30-100× speedup on hot path).
statSync(filePath, { throwIfNoEntry: false }) — avoids exception construction on missing-file path.
Cache invalidated on write — doesn't rely on filesystem mtime resolution.
loadSettingsFromDisk helper — pulls the read/parse/validate flow into one place, eliminates the previous three duplicated settingsCache = {...} assignments.
toggleDisabledTool cleaned up — single set construction + single write call, no branched copy of writeGlobalSettings.

* add unit tests for caching logic

* object freeze
2026-05-20 12:11:46 -07:00
Bee 6ca92794e1 chore: model catalog updated 1779302019893 (#10934)
All files automatically changed and formatted by `cd sdk && bun run build:models`

Generated model catalog version updated to 1779251127504

This includes the new X AI build
2026-05-20 11:52:25 -07:00
Bee 27bd4c6c65 chore: generated model catalog update (#10921)
version 1779251127504
2026-05-20 09:03:39 -07:00