Add a checkbox for users to indicate they're on a beta version, and
auto-apply the 'beta' label via the existing auto-label workflow when
the checkbox is checked.
* CLINE-1814 typed RipgrepSpawnError + error_reason proto
* file-search.ts: define RipgrepSpawnError carrying stderr+exitCode; reject
on non-zero ripgrep exit (with empty results) instead of resolving to []
* file-search.ts: re-throw from searchWorkspaceFiles and
searchWorkspaceFilesMultiroot so the controller sees the error and can
attach a structured error_reason to the proto response
* file-search.test.ts: assert spawn-time and exit-time errors both surface
as RipgrepSpawnError
* file.proto/FileSearchResults: add optional error_reason and error_message
fields with the closed enumeration of values documented inline
Phase 1 of the visibility patch. No behaviour change for healthy installs;
broken installs now surface a real error instead of an empty list.
Refs: CLINE-1814
* CLINE-1814 surface error_reason in picker UI
Controller (searchFiles.ts):
* classify thrown errors into a closed enumeration of error_reason values
(workspace_unavailable, ripgrep_spawn_failed, unknown). RipgrepSpawnError
unwraps the first line of stderr into error_message so the picker can
surface ENOENT / EACCES / 'Operation not permitted' verbatim.
* the no-workspace-path branch now returns workspace_unavailable instead
of an empty result list.
* keep using telemetry.captureMentionFailed for aggregate signal but map
ripgrep_spawn_failed -> 'unknown' to stay within the existing closed enum.
Webview (ChatTextArea + ContextMenu):
* ChatTextArea threads errorReason / errorMessage from each searchFiles
RPC response (and from RPC-level rejections) into ContextMenu.
* ContextMenu renders a grey, italic, smaller subtitle beneath the
'No results found' row when an error_reason is present.
* renderErrorSubtitle() carries a short doc-comment for each value so
reviewers can see at a glance how each error_reason maps to UI copy.
Refs: CLINE-1814
* CLINE-1814 trim verbose CLINE-1814 ticket-reference comments
Pure code-quality pass over the Phase 1 changes: condense the long
narrative comments that referenced the ticket into terser explanatory
comments where they still add value, and remove ones that just
repeated what the (now-stable) code already says. No behaviour change.
* CLINE-1814 fix RipgrepSpawnError override of Error.cause
TS error 'This member must have an override modifier because it
overrides a member in the base class Error' - Error gained an optional
'cause' field in ES2022. Drop the explicit field declaration and pass
the cause via the standard ES2022 ErrorOptions in super(). Behaviour
unchanged: instances still expose .cause via the base-class field.
* CLINE-1814 fix Windows race in executeRipgrepForFiles finalisation
CI hit this on Windows:
AssertionError: expected [Promise] to be rejected with a message
matching /ripgrep exited with code 2/, but got 'ripgrep exited with
code null: rg: /bogus: No such file or directory (os error 2)'
The readline 'close' event and the child-process 'exit' event fire in
non-deterministic order on Windows. The previous code keyed off 'close'
alone, which meant the rejection branch could run with exitCode still
null even when the process eventually exited with a real code.
Fix: gate finalisation on both events with a small barrier (rlClosed +
processExited + finalised flags). Idempotent and safe under any
ordering. Test passes on darwin (where the ordering used to be benign)
and the same path now produces the expected exitCode=2 message on
Windows.
No production-behaviour change on the happy path: results still resolve
exactly when the readline finishes parsing stdout.
* CLINE-1814 address Phase 1 code-review feedback
Three small follow-ups from review on the Phase 1 PR:
1) ContextMenu.tsx: drop a stray trailing semicolon on the
selectedType prop declaration so the interface style stays
consistent with the rest of the file (no semicolons on field
declarations). Cosmetic only, no behaviour change.
2) file-search.ts: in executeRipgrepForFiles' rgProcess.on('error')
handler, set finalised = true before reject() so that a subsequent
('close', 'exit') pair can't pass the finalise() guards. The
double-reject was already a no-op (Promises swallow further
reject() calls once settled), but unconditionally maintaining the
barrier invariant makes the lifecycle of this Promise much easier
to reason about and matches the symmetry of the other two
finalise() callers.
3) file-search.test.ts: collapse the awaited-twice rejected-promise
pattern in 'should reject with RipgrepSpawnError when ripgrep
exits non-zero with no results'. The previous form
(await should(p).be.rejectedWith(...); await p.catch(...)) worked
because settled promises replay their value, but it's subtly
misleading. The new form awaits once via .catch() and asserts on
the resulting error directly.
All six File Search unit tests continue to pass.
* CLINE-1814 revert picker error subtitle (UI for impl-detail leak)
Per code-review feedback: surfacing structured error_reason / error_message
from FileSearchResults as a grey-italic subtitle on the 'No results found'
row exposes implementation detail to end-users. The user can't act on
'(ripgrep failed: rg: ENOENT)' or '(internal error: spawn EACCES)' — those
are diagnostic data that belong in logs and aggregate telemetry.
Reverted in this commit:
- ContextMenu.tsx: errorReason / errorMessage props removed,
renderErrorSubtitle helper deleted, NoResults row reverts to a plain
<span>No results found</span>.
- ChatTextArea.tsx: searchErrorReason / searchErrorMessage state and
all setSearchErrorReason / setSearchErrorMessage call-sites removed;
ContextMenu invocation no longer passes the two props.
Kept on purpose:
- The proto field FileSearchResults.error_reason — it's harmless on
the wire and the next commit wires it up to telemetry + structured
logging, which is where this signal actually belongs.
- The classifyError helper and ERROR_REASON_* constants in the
searchFiles controller — same reason, they feed telemetry next.
Six file-search unit tests still pass.
* CLINE-1814 telemetry: surface ripgrep_spawn_failed / workspace_unavailable
Until now the searchFiles controller's catch block collapsed every classified
error_reason — workspace_unavailable, ripgrep_spawn_failed, unknown — onto a
two-value telemetry enum (permission_denied | unknown), throwing away the
diagnostic signal we'd worked hard to extract. The Linear ticket explicitly
asks for the structured signal to feed telemetry; this commit delivers on that.
Changes:
- TelemetryService.captureMentionFailed: extend the errorType enum with
two new categorical values, ripgrep_spawn_failed and workspace_unavailable.
Doc-comment updated to call out that those two are picker-search failures
(vs the existing values which are mention-content retrieval failures).
- searchFiles.ts:
* empty-workspace branch now emits errorType=workspace_unavailable
(previously: not_found).
* catch-block computes errorType from the classified errorReason —
RipgrepSpawnError -> ripgrep_spawn_failed, EACCES -> permission_denied,
otherwise unknown — instead of always permission_denied | unknown.
Net result: ops can now distinguish 'ripgrep is broken on this user's
machine' from 'user is in a one-window-no-folder IntelliJ session' from
genuine code bugs in the search pipeline.
* CLINE-1814 log: include classified errorReason on searchFiles error line
Trivial follow-up to the previous commit. Triagers grepping
~/.cline/cline-core-service.log for searchFiles failures got the raw error
object dumped, but no hint as to which of the structured error_reason
buckets the failure falls into. Now the log line is
[ERROR] Error in searchFiles (errorReason=ripgrep_spawn_failed): <Error...>
so a single grep for 'errorReason=ripgrep_spawn_failed' surfaces every
ripgrep-side failure across the user's session without having to read the
stack trace. Same field value as the gRPC response and the telemetry event,
so the three sources can be cross-referenced in incident triage.
Also moved the classifyError() call above the Logger.error() call (was
below) so the reason is computed once, used twice.
* CLINE-1814 address Phase 1 review feedback (rename, simplify, trim comments)
Five review comments rolled into one commit:
file-search.ts
* Rename RipgrepSpawnError -> RipgrepError. The class covers spawn failures
AND non-zero-exit / stderr-on-empty-stdout paths; the old name only
described half its job.
* Drop the unread 'cause' constructor option. We were never reading
err.cause anywhere downstream, and the only producer was the
spawn-error path which already encodes the underlying message in the
string.
* Replace the rlClosed/processExited/finalised state machine with two
Promise resolvers awaited via Promise.all. Same ordering guarantees on
Windows (both 'close' and 'exit' must fire before we settle), zero
mutable bookkeeping, and the spawn-error path no longer needs to
pre-flip a 'finalised' flag to be safe against a late close+exit pair.
Used new Promise() rather than Promise.withResolvers() because TS lib
is es2022 and withResolvers is es2024; behavior is identical.
searchFiles.ts
* .trim() the stderr before split() so a leading newline doesn't yield
an empty first line on the telemetry / log path.
* Drop the 'this commit' comment (ephemera once 'this commit' is no
longer the most recent one) and the 'Determine mention type based on
the search request' comment, both of which restated the obvious code.
file-search.test.ts
* Update test name and assertion to match the renamed class.
All 6 file-search unit tests pass.
* CLINE-1814 drop unread RipgrepError.exitCode field
Follow-up to the previous review-feedback commit. The 'we're not reading
this anywhere' note was about exitCode, not cause - my mistake. The exit
code is already encoded into the error message string ('ripgrep exited
with code N: <stderr>'), so the dedicated field was carrying no
additional information for any consumer.
Dropped:
* RipgrepError.exitCode field and constructor option
* 'exitCode' from the two new RipgrepError(...) call sites
* 'should(err).have.property(exitCode, 2)' from the unit test
The internal exitCode local in executeRipgrepForFiles stays - it gates
the reject vs resolve decision after both 'close' and 'exit' have fired.
It's just no longer plumbed onto the error.
All 6 file-search unit tests still pass.
* feat(memory-observability): add periodic memory logging to cline-core
Introduces a lightweight memory monitor that logs process.memoryUsage()
snapshots to the existing cline-core log every 5 minutes, plus an
immediate baseline at startup and a final snapshot at graceful shutdown.
Each entry is written as a single `[MEMORY] key=valueMB ...` line so it
is trivially greppable and parseable:
grep '\[MEMORY\]' ~/.cline/cline-core-service.log
The timer is unref()'d so it does not keep the event loop alive on its
own, ensuring the Node process can still exit cleanly.
Also adds an informational log line after process.chdir(__dirname) that
records where V8 will write heap snapshots if --heapsnapshot-near-heap-limit
triggers them, and a best-effort process.on("exit") handler that scans
cwd for .heapsnapshot files on abnormal exit and logs their paths/sizes
so post-mortem investigation starts with the diagnostic data in hand.
This is Part 1 (periodic memory logging) and the Node-side portions of
Part 2 (snapshot directory + exit handler) of the memory observability
implementation plan. The V8 flag itself and the
~/.cline/heapsnapshots/ move-and-cap cleanup live in the Kotlin
CoreProcessManager and are applied separately in the plugin repo.
No business-logic changes; purely additive diagnostics.
* chore(memory-observability): enable --heapsnapshot-near-heap-limit=3 in runclinecore.sh
When cline-core approaches the V8 heap ceiling, V8 will now write up to
3 .heapsnapshot files to the current working directory before giving up
and crashing. These snapshots can be loaded into Chrome DevTools → Memory
tab to identify the objects retaining the most memory.
N=3 is chosen because the last snapshot (written just before the fatal
OOM) shows only live, truly-unreclaimable objects — the earlier ones still
contain garbage the GC hadn't collected yet. Having all three lets us
compare.
This flag is a V8 runtime flag and must be passed on the node command
line; it cannot be enabled from JavaScript at runtime.
Matches the equivalent change on the cline-core launcher in the IntelliJ
plugin repo (CoreProcessManager.kt).
* chore(memory-observability): reduce --heapsnapshot-near-heap-limit from 3 to 1
Reviewer concern: with --max-old-space-size=8192, each heap snapshot
serializes at roughly 4-5x heapUsed on disk, so three snapshots can
burst 24-40 GB to disk in the seconds before an OOM crash — right
when the system is already under memory/CPU pressure. On a laptop
with <40 GB free this can leave partial/corrupted snapshots or
trigger OS pressure on unrelated processes.
The plan doc originally argued 'snapshot 3 of 3 is most valuable
because it contains only live objects'. In practice, by the time V8
triggers the flag it has already run aggressive mark-compact cycles,
so snapshot 1 is nearly-all-live too. Our own Scenario B verification
run confirmed that even the first snapshot contained the retainer
chain — snapshots 2 and 3 added no diagnostic signal.
Trade-off:
- per-OOM disk burst: 24-40 GB -> 8-14 GB (3x reduction)
- time-to-crash (frozen): 30-60 s -> 10-20 s (3x reduction)
- diagnostic signal: essentially unchanged
The persistent-directory cap in CoreProcessManager.kt stays at 3, so
we still retain snapshots from the 3 most recent OOM events for
cross-event comparison.
* chore(memory-observability): shorten runclinecore.sh flag comments
The one-line pointer to CoreProcessManager.kt was more noise than
signal given the flags are visible on the same line as the command.
Rationale for the --heapsnapshot-near-heap-limit value lives in the
Kotlin constant's KDoc and in the commit log.
* Make the nightly publishing script use the stable channel of cline-nightly.
* Address PR review feedback from Greptile and Copilot
- Reject unknown CLI flags with an error message, preventing typos like
--prerelease from silently publishing to the wrong channel (Greptile)
- Rename 'stable' to 'release' throughout docs, help text, and log
messages to match VS Code Marketplace terminology (Copilot)
- Rename workflow step from 'Publish Extension as Pre-release' to
'Publish Nightly Extension' since it now publishes to the release
channel by default (Greptile)
* fix: set --max-old-space-size=8192 for cline-core node process
The cline-core Node.js process was launched without a V8 heap limit,
defaulting to ~2GB. Long conversations with large file reads cause
GC-thrashing and eventual OOM crashes. Set the limit to 8GB to provide
sufficient headroom for extended sessions.
* fix: set --max-old-space-size=8192 for cline-core node process
* docs: add prompt storage schema and OpenTelemetry events reference
- Add comprehensive prompt storage documentation (DEVREL-142)
- Complete enterpriseTelemetry.promptUploading schema
- Setup guides for AWS S3 and Cloudflare R2
- Storage architecture and sync worker behavior
- IAM policies and troubleshooting
- Add OpenTelemetry events catalog (DEVREL-143)
- Document 80+ events across 8 categories
- Example payloads and analytics query patterns
- Integration examples for Datadog, Grafana, New Relic
- Event schema reference and best practices
- Update monitoring documentation
- Add cross-references between related pages
- Update navigation in docs.json
- Integrate new pages into Enterprise > Monitoring section
* fix: update broken link in telemetry.mdx to point to OTel events page
* docs: address PR review comments
- Fix file contents exclusion claim in prompt-storage.mdx
- Remove misleading claim about file contents not being stored
- Add warning that tool inputs (like write_to_file content) are included
- Standardize attribute naming in opentelemetry-events.mdx
- Change model_id to model in event tables for consistency
- Match actual emitted event schema shown in example payloads
- Add SQL syntax note in opentelemetry-events.mdx
- Clarify that attribute access syntax is platform-specific
- Provide examples for BigQuery and ClickHouse
* adjustments
- Update root package.json axios from 1.13.6 to 1.15.0
- Update evals/package.json axios from 1.13.6 to 1.15.0
- Update docs/package.json axios override from 1.13.5 to 1.15.0
- Regenerate all package-lock.json files
* feat: wire up globalSkills consumption from remote config
The remote config schema already includes globalSkills (merged in #10236).
The dashboard can save skills to remote config. This PR wires up the
extension to read and use them.
## Changes
### State storage (Layer 1)
- Add remoteGlobalSkills to REMOTE_CONFIG_EXTRA_FIELDS
- Add remoteSkillsToggles to GLOBAL_STATE_FIELDS
### Remote config transform/apply/clear (Layer 2)
- Map globalSkills → remoteGlobalSkills in transformRemoteConfigToStateShape
- Sync remoteSkillsToggles in applyRemoteConfig using frontmatter.name
as the identity key (not entry.name)
- Clear remoteSkillsToggles in clearRemoteConfig
### Skill discovery (Layer 3)
- discoverSkills accepts optional remoteSkillEntries parameter (pure
utility, no StateManager coupling)
- getSkillContent accepts optional remoteSkillEntries parameter for
remote content loading without disk I/O
- Precedence: remote (enterprise) > disk-global (user) > project
### refreshSkills (Layer 3b)
- Reads remote entries from controller.stateManager, parses frontmatter,
builds SkillInfo entries with alwaysEnabled field
### UseSkillToolHandler (Layer 4)
- Toggle filter checks remoteSkillsToggles for remote: prefixed skills
- Directory note omitted for remote skills
- Passes remoteSkillEntries to both discoverSkills and getSkillContent
### toggleSkill
- Routes remote: prefixed paths to remoteSkillsToggles keyed by name
### Proto + webview
- Added always_enabled field to SkillInfo proto message
- Modal passes isRemote + alwaysEnabled to RuleRow for remote skills
- Uses skill.name as display label for remote skills
## Design decisions
- frontmatter.name is the sole identity for remote skills (entry.name
is ignored). This matches how local skills work.
- remote: path prefix distinguishes remote from disk skills in toggle
stores and content loading.
- skills.ts remains a pure utility module with zero StateManager coupling.
Callers inject remote entries as parameters.
- 42 unit tests covering discovery, precedence, content loading, toggle
sync, and frontmatter parsing.
* fix: enforce alwaysEnabled in toggle sync to prevent stale false overrides
When applyRemoteConfig syncs skill toggles, synchronizeRemoteRuleToggles
preserves existing toggle values — including false. If an admin later
sets alwaysEnabled: true on a skill that a user had previously disabled,
the stale false toggle would survive the sync. The UI would show the
skill as locked-on (via the alwaysEnabled check in refreshSkills), but
UseSkillToolHandler's filter would see false in the toggle store and
exclude it, causing a 'Skill not found' error for a skill the user can
see is active.
Fix: after synchronizeRemoteRuleToggles, force any alwaysEnabled entry
with a false toggle back to true. This makes the toggle store the single
source of truth — both UI and handler now agree.
Adds 4 tests covering the alwaysEnabled enforcement edge cases.
* fix: deduplicate remote skill parsing, add drift validation, and fix architectural gaps
1. Extract shared parseRemoteSkillEntries utility (skills.ts)
- Single validation point for remote skill entries, replacing duplicated
frontmatter parsing in skills.ts, refreshSkills.ts, and remote-config/utils.ts
- Enforces entry.name === frontmatter.name to catch drift between the
dashboard and SKILL.md content (rejects with warning on mismatch)
2. Eliminate redundant frontmatter re-parsing in getSkillContent
- Was re-parsing every entry's frontmatter to find a match by name
- Now uses entry.name for lookup since drift validation guarantees equality
3. Enforce alwaysEnabled in UseSkillToolHandler
- The toggle filter was missing the alwaysEnabled check, so a stale false
toggle could hide an admin-locked skill from the model
- Now matches the logic in refreshSkills.ts
4. Add remote_skills_toggles to SkillsToggles proto
- toggleSkill now returns remoteSkillsToggles in the response, matching
how remote rules/workflows already work
5. Separate Enterprise Skills section in UI
- Remote skills now render under their own "Enterprise Skills" header,
consistent with how rules and workflows display remote entries
6. Update tests for new validation behavior
- Tests now use entry.name matching frontmatter.name (was deliberately
mismatched before); added drift rejection tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: enable viewing remote skills and fix tooltip text in RuleRow
- openRemoteFile now handles remote://skill/{name} URIs (was only
rule and workflow), looking up content from remoteGlobalSkills
- RuleRow's handleEditClick builds the correct URI type for skills
(was falling through to "rule")
- Tooltip text now uses ruleType ("View skill file") instead of
hardcoded "View rule file" for all remote entries
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: soften drift validation to warn-not-reject, fix content lookup fallback
The strict entry.name !== frontmatter.name rejection was silently hiding
org-configured skills when the dashboard's entry.name didn't match the
SKILL.md frontmatter name.
- parseRemoteSkillEntries now warns on drift but uses frontmatter.name as
the canonical identity instead of rejecting the entry
- getSkillContent falls back to frontmatter match when entry.name lookup
misses (handles drift for content loading)
- openRemoteFile falls back to frontmatter match for skill view (same
reason)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: include remote skills in system prompt and fix remote config race
The system prompt generation called discoverSkills() without passing
remoteSkillEntries, so the model never learned about remote skills and
never invoked use_skill for them. This was the actual cause of remote
skills being invisible to the model despite showing in the UI.
Also fixes a race condition in applyRemoteConfig where clearRemoteConfig()
wiped the in-memory cache before repopulating it field-by-field. Any
concurrent reader (e.g., UseSkillToolHandler) during that window would
see an empty cache. Replaced with atomic replaceRemoteConfig() that
builds the new cache and swaps it in a single assignment.
- task/index.ts: pass remoteSkillEntries to discoverSkills, add
remoteSkillsToggles + alwaysEnabled filtering (matching handler)
- StateManager: add replaceRemoteConfig() for atomic cache swap
- remote-config/utils.ts: use replaceRemoteConfig instead of
clearRemoteConfig + setRemoteConfigField loop
- Remove debug logging from parseRemoteSkillEntries and handler
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: include remote skills in subagent path
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(models): prepare Claude Opus 4.7 provider support
* remove deprecated params for opus 4.7
- opus 4.7 doesn't accept params like temperature, top_p, top_k anymore.
This commit removes those params only for opus 4.7
* Agent hill climb fixes
* Anthropic adaptive thinking
* Removing 1m context switcher
* Removing 1m models fully
* Restore Anthropic 1M variants and context switchers
* Adding 1m
* remove changeset
* fix Opus 4.5 adaptive thinking detection
---------
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
Replace the old client-side per-org scan for remote config with a single
discovery call to GET /api/v1/users/me/remote-config. Reuse the inline
config value when possible, falling back to the org-level endpoint only
when inline parse fails.
Key changes:
- Single discovery call replaces N org-level requests
- Resolve config before switching org to avoid stranding the user
- Transient errors preserve existing config (log-only, no clearing)
- authenticatedRequest() strict null vs undefined validation
- Auth precheck in fetchUserRemoteConfig() with token pass-through
* fix(prompts): add use_subagents to GLM, Hermes, and XS TOOL_USE_SECTION overrides
These variants use hardcoded TOOL_USE_SECTION templates that bypass the
auto-generated tool descriptions. When use_subagents was added as a new tool,
it was registered in each variant's .tools() config but was never added to the
hardcoded override templates — so models using these variants never saw
use_subagents in their system prompt and could not call it.
This adds the use_subagents description block to the TOOL_USE_SECTION override
templates for glm, hermes, and xs variants, and updates the corresponding
test snapshots.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(prompts): gate use_subagents on subagentsEnabled and isSubagentRun context
The previous commit added use_subagents to the GLM, Hermes, and XS
TOOL_USE_SECTION override templates unconditionally. This was incorrect —
the canonical tool spec gates use_subagents with:
context.subagentsEnabled === true && !context.isSubagentRun
Without this guard, models would advertise use_subagents even when
subagents are disabled by the user, and subagent runs could recursively
spawn further subagents.
This commit:
- Wraps the use_subagents block in all three templates with the same
subagentsEnabled && !isSubagentRun conditional
- Converts HERMES_TOOL_USE_TEMPLATE from a plain string constant to a
function so it can access context (matching the pattern used by GLM
and XS templates)
- Updates snapshots accordingly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(prompts): align use_subagents rendering guard with tool context requirements
---------
Co-authored-by: sunghyun <jjinjukks1227@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(chat): add SpendLimitError UI for SPEND_LIMIT_EXCEEDED (429)
When the Cline backend returns a 429 with code SPEND_LIMIT_EXCEEDED (org
budget cap hit), the chat error flow now shows a dedicated SpendLimitError
component instead of falling through to the generic rate-limit message.
Changes:
- proto/cline/account.proto: add submitLimitIncreaseRequest RPC +
SubmitLimitIncreaseResponse message
- src/services/error/ClineError.ts: add SpendLimit error type; detect
SPEND_LIMIT_EXCEEDED before the generic rate-limit pattern check
- src/services/account/ClineAccountService.ts: add
submitLimitIncreaseRequestRPC() calling POST /api/v1/users/me/budget/request
- src/core/controller/account/submitLimitIncreaseRequest.ts: new gRPC
handler wired automatically by npm run protos
- webview-ui/src/components/chat/SpendLimitError.tsx: new card component
mirroring CreditLimitError; shows spent/limit amounts, resets_at, org
attribution, and a Request Increase button with 5-min localSto
When the Cline backend returns a 429 with code SPEND_LIMIT_EXCEEDED (org
budgetrors to
SpendLbudget cap hit), the chat budget_period,limit_usd,spent_usd,resets_at}
- component instead of falling through to the generic rate-limnd Limit
Reac
Changes:
- proto/cline/account.p
* Update webview-ui/src/components/chat/SpendLimitError.tsx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* chore: shorten spend limit error message verbiage
* fix(storybook): align spend limit story messages with component output
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
The previous copy ("Cline is moving out of the terminal", "old CLI")
gave the impression that the terminal TUI was being deprecated. Updated
to frame Kanban as the new default while making clear the TUI is still
fully available.
* Complete documentation for environment variable-based OpenTelemetry configuration
* Address PR review comments
- Add Values column to OTLP Configuration table for consistency
- Fix New Relic endpoint to include required port 4318
- Add note about Datadog region-specific endpoints
Remove Teams Plan as an option for seat upgrades in the managing-members documentation. This aligns with the product strategy to drive customers toward Enterprise for any multiplayer/team scenarios.
Related: https://github.com/cline/cline-web/pull/256
Surface the actual read_file line window in chat summaries so users can see what context was added, while keeping manual approval and repeated same-file reads rendered accurately.
* feat(cli): unify update flow for cline and kanban
* fix(cli): only install kanban when update is available
* fix(cli): include cline and kanban versions in no-update message
- Add linux-aarch64 to TARGET_PLATFORMS in package-standalone.mjs so
better-sqlite3 prebuilt binaries are downloaded for this platform.
- Rename linux-arm64 to linux-aarch64 in download-ripgrep.mjs for
consistency with the JetBrains plugin naming convention (which uses
Java's os.arch value 'aarch64').
* fix(read_file): add stable line labels in act/plan
* prompt: clarify read_file line labels for replace_in_file
* Update prompt snapshots
* feat(read_file): add chunked reading with start_line/end_line parameters
Add optional start_line and end_line parameters to read_file so models
can read files in chunks instead of loading entire files into context.
Default limit is 1000 lines per read, with a continuation hint guiding
the model to paginate when needed.
Made-with: Cursor
* feat: align read_file line format with SDK while keeping superior chunking
- Change line format from 'L1:' to '1 |' to match SDK format
- Add proper NaN validation for start_line/end_line parameters
- Keep 1000-line chunking with continuation hints (superior to SDK)
- Update tool description and tests to reflect new format
- Add directory usage guardrail back to tool description
- Update replace_in_file prompt to reference new line format
This aligns the PR with the newer SDK design patterns while
preserving the superior chunking behavior that prevents context
overflow issues.
* fix: resolve duplicate step numbering in replace_in_file instructions
Fixes the duplicate step 5 issue when NOTEBOOK_INSTRUCTIONS is
concatenated with BASE_DIFF_INSTRUCTIONS for .ipynb files.
Changes notebook instructions to step 6 to avoid ambiguity.
* test: update unit test snapshots
* test: fix gemini3 tools snapshot
* test: regenerate gemini3 tools snapshot
* fix: preserve line ranges on cached file reads
* test: refresh gemini3 tools snapshot
* test: strengthen chunked read assertions
* fix: normalize inverted read file ranges
VSCode's webview doesn't reliably play VP9/WebM, while JetBrains'
JCEF lacks H.264 decoding. Restore the original H.264/MP4 video and
use HTML5 <source> elements with explicit MIME types so each platform
picks the format it supports:
<source src=... type="video/mp4" /> <!-- VSCode -->
<source src=... type="video/webm" /> <!-- JetBrains -->
Also:
- Restore .mp4 Git LFS tracking in .gitattributes
- Update CI LFS verification to check both files
- Add webm to JetBrains MIME type map (BrowserRequestHandler)
JetBrains IDEs use JCEF (Chromium Embedded Framework) for webviews,
which often does not include H.264 decoding due to licensing
restrictions. This causes the kanban demo video to fail to play.
Transcode the video from H.264/MP4 to VP9/WebM, which is a royalty-free
codec universally supported in Chromium derivatives. This also reduces
the file size from 3.6MB to ~900KB.
Updated all references:
- Source component import (ClineKanbanLaunchModal.tsx)
- Git LFS tracking (.gitattributes)
- CI workflow LFS checks (publish.yml, publish-nightly.yml)
The migration announcement didn't explain what Kanban is. Swap the
"run cline --tui" line for a one-liner describing the product so users
know what they're opting into. The --tui escape hatch is still
discoverable via the Exit menu item.
* refactor: replace hand-rolled YAML parser in refreshSkills with shared helper
The refreshSkills controller had its own line-by-line YAML parser that
only handled simple key: value pairs. Replace it with the shared
parseYamlFrontmatter helper already used by the skills discovery path.
Same output for name and description fields. The shared parser handles
edge cases (arrays, nested values, quoted colons) more robustly.
* refactor: inline parseYamlFrontmatter, remove redundant wrapper
Remove the parseFrontmatter wrapper since only `data` is used by
the caller. Inline the call directly at the use site.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: John Choi <johnchoi@MacBook-Pro.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: upgrade MiniMax default model to M2.7
- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list
- Set MiniMax-M2.7 as default model
- Keep all previous models as alternatives
- Update provider documentation
* fix: correct M2.7 cache pricing and update prompt caching docs
- Updated cacheReadsPrice from 0.015 to 0.03 for both MiniMax-M2.7 and
MiniMax-M2.7-highspeed to match M2.5 pricing (same cache read rate
across M2.x models)
- Updated prompt caching tip to explicitly mention highspeed variants
* fix: correct MiniMax model pricing to match official rates
- M2.7-highspeed/M2.5-highspeed/M2.1-lightning: $0.60/$2.40 (not $0.30/$1.20)
- M2.7 cache: reads $0.06/M (not $0.03), writes $0.375/M (not $0.0375)
- All models: cache writes $0.375/M (not $0.0375)
Ref: https://platform.minimax.io/docs/llms.txt
---------
Co-authored-by: PR Bot <pr-bot@minimaxi.com>
The Kanban launch-by-default feature (beb54a4) redirects bare `cline`
invocations to Kanban, which blocks all TUI tests that launch without
`--tui`. Adding the flag ensures tests reach the legacy TUI as expected.
* feat(cli): refresh welcome banner and kanban launcher
* feat(cli): launch kanban by default with migration view
* feat(cli): add kanban process lifecycle management
Detach the kanban child process on Unix so it gets its own process
group, forward signals to the group for graceful shutdown, and fall
back to SIGKILL after a 10s timeout. Resolves exit codes from signals
correctly (130 for SIGINT, 143 for SIGTERM).
* feat: add repeated tool call loop detection
Detect when the LLM calls the same tool with identical arguments
repeatedly, which wastes tokens without making progress. This is
the #1 active complaint in the Cline issue tracker (13+ open issues
including #9923, #9916, #9846, #9816).
Two-stage escalation:
- Stage 1 (3 identical calls): inject a warning nudging the LLM
to try a different approach
- Stage 2 (5 identical calls): trigger the existing
consecutiveMistakeCount escalation (asks user or fails in YOLO)
Detection uses JSON.stringify with a sorted key replacer for
deterministic comparison. Metadata params like task_progress
(which change every call even when actual tool arguments are
identical) are stripped from the comparison.
Complementary to fileReadCache, which deduplicates file content but
still allows the tool call to succeed and consume a turn. Loop
detection catches the repeated call pattern itself.
Changes:
- loop-detection.ts: shared helper (toolCallSignature, checkRepeatedToolCall)
- TaskState.ts: add lastToolParams, consecutiveIdenticalToolCount
- ToolExecutor.ts: call checkRepeatedToolCall in handleCompleteBlock
- responses.ts: add formatResponse.repeatedToolCall
- loop-detection.test.ts: 5 tests
Manually verified: CLI test confirms soft warning at call 3,
YOLO mode failure at call 5.
Refs: #9923, #9916, #9846, #9816
* fix: address review feedback on loop detection
- Change hardEscalation threshold from >= to === so it fires exactly
once at count 5, matching softWarning behavior
- Widen toolCallSignature param type to Partial<Record<string, string>>
to match actual block.params type from ToolExecutor
- Add negative boundary assertions to verify no false positives at
calls 0, 1, 3, 4
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: reset loop detection state when user continues after mistake_limit_reached
When hard escalation fired at count === 5 and the user clicked
"continue", consecutiveIdenticalToolCount was never reset. The count
would exceed 5 but === 5 never matched again, silently disabling
loop detection for the rest of the task.
Reset consecutiveIdenticalToolCount, lastToolName, and lastToolParams
alongside the existing consecutiveMistakeCount reset so the detector
fully re-arms after the user continues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: John Choi <johnchoi@MacBook-Pro.local>
* fix: prevent OOM crash from globby's eager .gitignore scanning in listFiles
Replace globby's gitignore:true (which reads ALL .gitignore files in the
entire tree upfront, including inside gitignored directories) with
incremental .gitignore reading during BFS traversal.
In projects with large gitignored vendored dependencies containing many
nested repos, globby collects thousands of patterns, builds a massive
regex, and V8 runs out of memory during regex compilation (~488MB).
The fix reads .gitignore files only from directories the BFS actually
enters. Gitignored directories are never entered, so their .gitignore
files are never parsed and the pattern count stays small.
- Set gitignore:false, handle .gitignore ourselves
- Read root .gitignore in buildIgnorePatterns() to seed initial patterns
- Read subdirectory .gitignore lazily during globbyLevelByLevel BFS
- Accumulate patterns in currentIgnore so deeper levels respect them
- Add 4 tests: root patterns, file patterns, subdirectory .gitignore,
and OOM-prevention (no reading inside gitignored dirs)
* Code review followup
* Potential fix for code scanning alert no. 147: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Replace generic "missing parameter" errors with targeted guidance for
the two tools observed failing most in SWE-bench (6% of failures).
The new messages include the expected format (SEARCH/REPLACE blocks,
XML example) without the 30-line boilerplate reminder.
Made-with: Cursor
* fix: read cache_write_tokens from OpenRouter API instead of hardcoding 0
- Read prompt_tokens_details.cache_write_tokens from OpenRouter stream usage
chunks instead of hardcoding cacheWriteTokens to 0
- Read native_tokens_cache_write from generation endpoint fallback
- Replace fragile hardcoded model ID switch statement for cache_control blocks
with prefix-based matching (anthropic/, minimax/) so new models automatically
get prompt caching enabled
- Add unit test verifying cache_write_tokens are correctly extracted
Co-authored-by: Ara <arafat.da.khan@gmail.com>
* fix: read cache_write_tokens from OpenRouter API instead of hardcoding 0
- Read prompt_tokens_details.cache_write_tokens from OpenRouter stream usage
chunks instead of hardcoding cacheWriteTokens to 0
- Read native_tokens_cache_write from generation endpoint fallback
- Replace fragile hardcoded model ID switch statement for cache_control blocks
with prefix-based matching (anthropic/, minimax/) so new models automatically
get prompt caching enabled
- Add unit test verifying cache_write_tokens are correctly extracted
Co-authored-by: Ara <arafat.da.khan@gmail.com>
* Release v3.74.0 Notes
* Release v3.74.0 Notes
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: alex-lum <alex@cline.bot>
The presentation scheduler introduced in ff05ec3bb awaits in-flight
flushes during dispose(), but ask() blocks indefinitely on pWaitFor
waiting for user input. When abortTask() sets abort=true and then
awaits scheduler.dispose(), the in-flight flush (blocked on
ask("completion_result")) never resolves, deadlocking the UI.
Add abort flag check to ask()'s pWaitFor condition so blocked asks
unblock immediately when the task is aborted.
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: fix SDK documentation accuracy and completeness
- Fix setPermissionHandler API Reference to use correct async/return signature
(was showing old callback pattern with (request, resolve) => void)
- Remove non-existent PermissionResolver type from Exported Types table
- Fix PermissionHandler type description to match actual signature
- Add missing hooksDir option to ClineAgentOptions documentation
- Fix newSession() example to use real model IDs
- Replace developer personal path in Full Example with generic path
- Use placeholder for version in initialize() example to avoid staleness
- Expand Stop Reasons table and add note about current implementation
- Add missing key exported types: AcpSessionStatus, AcpSessionState,
RequestPermissionRequest/Response, PermissionOption, SessionUpdatePayload,
SessionModelState, ModelInfo, TextContent/ImageContent/AudioContent,
SetSessionMode/Model request/response types, TranslatedMessage
* docs: improve SDK visibility and disambiguate from API code examples
- Move SDK page higher in Cline CLI nav (after Installation, before Interactive Mode)
- Add sidebarTitle 'SDK (Programmatic Use)' for clearer nav label
- Rename api/sdk-examples to 'Code Examples' to avoid naming confusion with the Cline SDK
- Update API overview card title to match
* Apply suggestions from code review
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* docs: add ClientCapabilities, Error Handling, and BYO API key docs to SDK
- Document clientCapabilities object and its effect on agent behavior
- Add Error Handling section with all throwable errors per method
- Expand BYO API key setup with concrete CLI auth examples
* docs: fix duplicated Stop Reasons table rows from code review
* docs: fix 3 accuracy issues found in source code audit
- Fix protocolVersion: was '0.9.0' (fabricated), actually 1 (number) from @agentclientprotocol/sdk
- Fix clientCapabilities: was claiming they change SDK behavior, but ClineAgent always uses standalone providers (capabilities only matter via AcpAgent stdio wrapper)
- Fix permission options: remove reject_always (never sent by agent, only allow_once/allow_always/reject_once are used)
* docs: clarify custom clineDir usage with CLI --config flag
Address PR review feedback: the BYO auth section mentioned custom
clineDir without showing how to target it from the CLI. Remove the
vague reference and add explicit --config flag documentation with
side-by-side SDK and CLI examples.
* docs: remove misleading 'by default' qualifier from SDK BYO auth section
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix(cli): use kanban@latest to always fetch newest version
npx -y kanban may use a cached version. Using @latest ensures
users always get the most recent kanban release.
* chore(cli): bump version to 2.8.2 and update changelog
* Implement minimal change set for latency improvements
Cline's code review improvements
Further code review improvements
* fix: address code review issues for presentation scheduler
- Add reset() method to TaskPresentationScheduler to prevent stale
timer leaks between API request retries within the same task
- Call presentationScheduler.reset() in streaming state reset section
- Fix hadVisibleAssistantContent to track reasoning content, not just
text, preventing every reasoning chunk from getting immediate priority
- Remove unused 'low' priority from PresentationPriority type and
associated cadence configuration (YAGNI)
- Trim TaskLatencyTrigger to only values actually used: text/reasoning/tool
- Add JSDoc to isRemoteWorkspaceEnvironment documenting the heuristic
fallback and its false-positive risk
- Add Logger.warn for invalid cadence env-var overrides
- Add comment at scheduler construction explaining detection promise
dependency on remoteWorkspaceDetectionPromise
- Add comments to CLI host bridge about intentional remoteName omission
- Expand test coverage: reset(), coalescing, priority upgrade tests
* fix: address code review issues in latency/presentation scheduler
- Fix #1/#3: Set didPresentAnyContent=true for text and tool_calls chunks
so coalescing actually activates for text-only and tool streams (was
only set for reasoning chunks, defeating the 40/90ms cadence goal)
- Fix#2: Re-check flushInProgress after awaiting in-flight flush in
runFlushCycle to prevent two concurrent callers from both proceeding
past the guard and starting concurrent flushes
- Fix#4: Document flushNow() disposed no-op contract so callers
understand the finalization guarantee
- Fix#5: Add disposed guard to reset() to prevent post-dispose state
mutation
- Fix#6: Remove platform/version heuristic from isRemoteWorkspaceEnvironment
— only use remoteName. The substring match on 'remote' produced false
positives for version strings like '1.0.0-remote-fix'. Non-VSCode hosts
should populate remoteName explicitly to opt in to the higher cadence.
- Fix#7: Add remoteWorkspaceDetectionSettled flag and warn if getDelayMs
is called before detection resolves, making the timing dependency
explicit and detectable in production logs
- Fix#8: Upgrade disabled-scheduler bypass error from Logger.debug to
Logger.warn so silent flush failures are visible
- Update latency.test.ts: replace heuristic test with false-positive
regression tests and add null/empty-field coverage
* fix: address code review issues in latency/presentation scheduler
- Fix flushNow race condition: wait for all in-flight flushes to drain
before setting pendingPriority so the post-flush continuation cannot
steal it, guaranteeing at least one flush runs after flushNow() returns
- Add regression test for the flushNow race condition
- Fix disabled-path (CLINE_DISABLE_PRESENTATION_SCHEDULER): use
presentationScheduler.flushNow() instead of a fire-and-forget void
call so the presentAssistantMessage lock/pending-updates mechanism
is respected when the scheduler is bypassed
- Rename didPresentAnyContent -> didScheduleAnyContent to accurately
reflect that content has been scheduled, not necessarily flushed
- Update stale comment in streaming loop to match new variable semantics
- Upgrade remote workspace detection failure log level from debug to warn
- Document reset() interaction with in-flight flush on already-reset state
- Document empty-string remoteName edge case in getHostVersion.ts
* refactor: polish presentation scheduler for production readiness
- Extract PresentationPriority type to shared presentation-types.ts,
breaking the latency.ts → TaskPresentationScheduler.ts type coupling
- Remove redundant pendingWhileFlushing flag from TaskPresentationScheduler;
pendingPriority alone is sufficient for the post-flush continuation check
- Cache env var reads in latency.ts at module load (hot path optimization)
- Inline flushAssistantPresentation() one-liner into the scheduler constructor
- Make processNativeToolCalls protected to enable type-safe test access
- Remove as any cast in Task.processNativeToolCalls.test.ts
* Fixes as per Greptile review feedback
* Further fixes as per Greptile feedback
* Further fixes as per Greptile feedback
Replace hardcoded free models list with runtime resolution from
recommended models. The handler now dynamically fetches free model
IDs using refreshClineRecommendedModels with fallback to static
defaults, and normalizes model IDs for consistent comparison.
* feat: add file read deduplication cache to prevent repeated reads
- Add fileReadCache to TaskState for tracking read files per task
- ReadFileToolHandler checks cache before reading, returns cached content on repeat reads
- Warns model after 3+ reads of same file to stop re-reading
- WriteToFileToolHandler and ApplyPatchHandler invalidate cache on file changes
- Reduces wasted API tokens from models reading same files repeatedly
* fix: address file read cache gaps - image blocks, execute_command, redundant invalidation
* Update src/core/task/tools/handlers/ExecuteCommandToolHandler.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* PR changes
- __`TaskState.ts`__ — Simplified cache type from `{ content: string; readCount: number; imageBlock? }` to `{ readCount: number; mtime: number; imageBlock? }`. Dropped `content` to save memory; added `mtime` for external change detection.
- __`ReadFileToolHandler.ts`__ — Four improvements:
- __Removed redundant `.set()` call__ — reviewer was correct that objects are modified by reference in Map
- __Added mtime-based cache validation__ — on cache hit, `stat()` the file and compare mtime. If the file was modified externally (user edited in their editor), the cache entry is evicted and a fresh read occurs
- __Dropped content from cache__ — cache now only stores metadata (readCount, mtime, imageBlock). On cache hits, the file is re-read from disk, addressing memory concerns
- __Softened readCount >= 3 warning__ — removed the aggressive "Do NOT read this file again" language; now says "Please use the information you already have and proceed with your task"
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* feat: add feature tips tooltip during thinking state
Show rotating feature tips below the Thinking indicator to keep users engaged and educate them on features like Double-Check Completion, .clinerules, Plan Mode, MCP Servers, checkpoints, and more.
- New FeatureTip component with 12 curated tips
- 2s delayed appearance, 8s cycling with fade transitions
- Visible throughout entire thinking/reasoning phase
- Proper timer cleanup on unmount
* Update webview-ui/src/components/chat/FeatureTip.tsx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update webview-ui/src/components/chat/FeatureTip.tsx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Update webview-ui/src/components/chat/ChatRow.tsx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix: remove unused useMemo import from FeatureTip
* fix: increase test delays in QuitCommand.test.tsx for Windows CI reliability
* Update webview-ui/src/components/chat/FeatureTip.tsx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix: add smooth fade-in for first tooltip appearance
The first tooltip was appearing abruptly because the element went from
not-in-DOM (return null) to opacity-100 instantly. Added hasFadedIn state
with requestAnimationFrame to ensure the CSS transition applies on initial
render, giving the first tip a smooth 300ms fade-in.
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
llama.cpp's STB image library doesn't support WebP format. Users running
GLM 4.6V, GLM 4.5, and Devstral models via llama.cpp server (openai-compatible
endpoint) were hitting a 400 error when using the browser tool because Cline
sends screenshots as WebP by default.
modelDoesntSupportWebp() only checked for Grok models. Extend it to also
cover GLM and Devstral model families using the existing family detection
functions. Also update isGLMModelFamily() to handle space-separated model IDs
like 'GLM 4.6V' (the format llama.cpp server reports for this model).
Fixes#8203
* fix: Claude Code provider failing with 4.6 models and newer CLI versions
- Update --disallowedTools list to match current Claude Code CLI tools
(12 new tools were unblocked, causing models to use native tool_use
instead of Cline's XML tools)
- Fix rate_limit_event handling for new CLI format (top-level type
instead of system subtype)
- Handle unknown content block types and new message types gracefully
- Fix assistantHasContent check to account for tool calls accumulated
via toolUseHandler even when useNativeToolCalls is false
* resolved .include mismatch to .containEql
* Update src/integrations/claude-code/types.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Removed `LegacyRateLimitEvent` type and its union reference from `types.ts`
* Fixed loop with async tool calls in new claude code.
* PR review feedback fixes
__Fix #2 (claude-code.ts):__ Cleaned up the error field check — replaced verbose `"error" in message` guard + ternary chain with a simpler `message.error` check using optional chaining and nullish coalescing (`message.content?.[0]` + `?? fallback`).
__Fix #3 (claude-code.ts):__ Replaced `message.content.length > 0 ? message.content[0] : undefined` with `message.content?.[0]` using optional chaining for the `stop_reason` block.
__Fix #4 (claude-code.ts):__ Replaced repeated `(content as any)` casts in the `default` switch case with a single typed cast: `const unknownBlock = content as { type: string; text?: string }`, making the code cleaner and safer.
__Fix #5 (ApplyPatchHandler.ts):__ Replaced both `await import("node:path")` and `require("node:path")` dynamic imports with a static `import { resolve as resolvePath } from "node:path"` at the top of the file.
* Remove file read deduplication feature (moved to separate PR)
* Remove ReadFileToolHandler file-not-found test (moved to separate PR)
* Add LegacyRateLimitEvent type for older CLI format
* Restore ReadFileToolHandler.ts and test from upstream/main (fix stale local main revert)
* Revert ReadFileToolHandler.ts to match fork main (no try/catch, no test file)
* manually reverting back
* Update src/core/api/providers/claude-code.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Restore ReadFileToolHandler.ts and test to match cline/cline upstream main
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Fix issue with Windows notification
Fix Windows proto tooling
Fix Windows unit test path normalization
Revert "Fix Windows unit test path normalization"
This reverts commit 73400a3ca6f0300d009f7c8238a016d769186f3a.
Remove package-lock.json changes
* Remove unnecessary changes
* Use command approval string for notifications
* Address PR feedback on Windows notifications
* Fix Windows protoc path for CI
* Polish notification safety and test coverage
* Fix unfound tests in CI
* Harden Windows notifications and protoc execution
* Fix Windows path normalization in glob test
* Fix as per Greptile feedback
* feat(wandb): add W&B Inference by CoreWeave provider
Adds support for W&B Inference as an API provider using a W&B API key.
Implements a provider handler with OpenAI-compatible streaming and a static
model catalog, and wires the provider through the API layer, configuration
schema, storage, CLI model picker, and settings UI.
* Updated input/output price of NVIDIA-Nemotron
* Updated helpText
* handle reasoning tokens in streaming respons
* Added clarifying comment on how W&B token usage is reported and why cached tokens
* fix: restore proto field numbers changed by generation script
* Update src/core/api/providers/wandb.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* fix: catch errors in path-based tool handlers instead of crashing
ListCodeDefinitionNamesToolHandler, ListFilesToolHandler, and
SearchFilesToolHandler let exceptions from their core operations
propagate through ToolExecutor's re-throw path, crashing the CLI
process. This is the same class of bug fixed for ReadFileToolHandler
in #9730.
Changes per handler:
- Wrap the core operation in try/catch, returning formatResponse.toolError()
on failure so the model can see the error and recover gracefully.
- Move consecutiveMistakeCount reset to after a successful operation so
repeated failures accumulate toward the yolo-mode mistake limit.
- Increment consecutiveMistakeCount on caught errors.
Add end-to-end tests exercising each handler with a mock TaskConfig,
covering: non-existent paths, missing parameters, failure accumulation,
and success-based counter reset.
* address review: expand try/catch scope, add stub-based tests
- Include resolveWorkspacePath inside try/catch in
ListCodeDefinitionNamesToolHandler and ListFilesToolHandler (matching
SearchFilesToolHandler's pattern) so path resolution failures are
also caught gracefully.
- Fix trivially-true assertion in file-not-a-directory test.
- Add 6 new stub-based tests that force core operations to throw:
parseSourceCodeForDefinitionsTopLevel, listFiles, and
determineSearchPaths — verifying the catch paths return
formatResponse.toolError() and increment consecutiveMistakeCount.
- Total: 19 passing tests (up from 13).
* address review: move clineignore check before IO in ListFilesToolHandler
Move the .clineignore access validation before resolveWorkspacePath and
listFiles so blocked paths are rejected without incurring IO cost.
Also ensures consecutiveMistakeCount is only reset after all
validations and the core operation succeed.
* address review: increment counter on clineignore denial
Clineignore denial in ListFilesToolHandler now increments
consecutiveMistakeCount so repeated attempts at blocked paths
accumulate toward the yolo-mode mistake limit. Added 2 tests
verifying single and repeated clineignore denials.
Total: 21 passing tests.
* fix: increment consecutiveMistakeCount when SearchFilesToolHandler searches fail
Previously, SearchFilesToolHandler's executeSearch() caught regexSearchFiles
errors and returned {success: false}, but the handler unconditionally reset
consecutiveMistakeCount to 0 even when ALL searches failed. This contradicted
the PR's goal of accumulating failures toward the yolo-mode mistake limit.
Now we check if any search succeeded before resetting the counter:
- If at least one search succeeded: reset to 0 (existing behavior for successes)
- If all searches failed: increment the counter (new fix)
Also added comprehensive test coverage for this scenario, including tests for:
- regexSearchFiles throwing errors
- Repeated search failures accumulating
- Successful search resetting the counter after failures
* fix: detect error strings in ListCodeDefinitionNamesToolHandler
parseSourceCodeForDefinitionsTopLevel returns error strings instead of
throwing exceptions for file paths and non-existent directories. The
handler now detects these error conditions and increments
consecutiveMistakeCount so repeated failures accumulate correctly.
This addresses Greptile's feedback that the counter was unconditionally
resetting to 0 for all real-world failure modes of this handler.
* fix: catch extractFileContent errors in ReadFileToolHandler
When extractFileContent throws (e.g. file not found), the exception
propagated through ToolExecutor which re-threw it, crashing the CLI
process with exit code 1.
Now file read errors are caught and returned as formatResponse.toolError()
so the model can see the error and recover gracefully (e.g. try a
different file path) instead of terminating the entire task.
Also increments consecutiveMistakeCount so the yolo-mode mistake limit
still functions correctly.
* add tui UI tests
using microsoft/tui-test library, can run many headless versions of
cline and execute ui tests (requires Node <= 20)
improve brittle sleep calls
* add cli-tui-tests github action
---------
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
The Oracle Code Assist URL moved from /artificial-intelligence/code-assist/
to /application-development/code-assist/. The old URL returns a 404.
Fixes#9776
Co-authored-by: gatof81 <gatof81@users.noreply.github.com>
- calling telemetry service before initializeCli call causes a
"hostprovider not initialized error", which invokes errorservice, which
causes another "hostprovider not initialized error", which was breaking
this cline use case: echo "say hello" | cline
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
* Add an UsafeImage handler that asks for consent before loading specific images
* Fix div as child of p
* Render self-contained images without consent
* Render alt conditionally and store approved src
* use a block span
* feat(telemetry): restore cache token and cost metrics in captureTokenUsage
Add optional `options` parameter to `captureTokenUsage()` to record
cache write/read token counters and cost histograms that were
previously missing from telemetry.
- Extend `captureTokenUsage` with `cacheWriteTokens`, `cacheReadTokens`,
and `totalCost` fields via an options object
- Record `cline.tokens.cache_write`, `cline.tokens.cache_read` counters/
histograms and `cline.tokens.cost` histogram when provided
- Forward cache/cost data from both streaming `onUsageChunk` and
`getApiStreamUsage` fallback call sites in the task loop
- Add 3 test cases covering options forwarding, undefined skipping,
and event property inclusion
* refactor(telemetry): extract shared TokenUsage type and add value assertions
Address PR review feedback:
- Extract shared TokenUsage interface used by both captureTokenUsage and
captureConversationTurnEvent, preventing future drift
- Add numeric value assertions for cache/cost counters and histograms
so regressions recording wrong values are caught
- cli was storing fields to persistent state when it shouldn't be. The
value of these flags should only live for the duration of the CLI
session
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Exposes the existing useAutoCondense setting as a CLI flag, following
the same pattern as --double-check-completion. This allows enabling
auto-condense in eval runs (e.g. SWE-bench via Harbor) to reduce
context exhaustion failures.
Made-with: Cursor
The Gemini converter was the only provider that didn't include
parameter-level descriptions in native tool call schemas. Anthropic
and OpenAI converters both resolve param.instruction into each
parameter's description field. This was missing for Google/Gemini,
meaning the model only saw parameter names and types with no
explanation of what each parameter expects.
Made-with: Cursor
listFiles() passed unvalidated paths as globby's `cwd`, crashing with
"The cwd option must be a path to a directory" when the model provided a
file path instead of a directory. This affected ~22% of SWE-bench tasks.
- Add isDirectory guard in listFiles() before calling globby
- Fix listFiles() to use resolved absolutePath for cwd instead of raw dirPath
- Return actionable error in parseSourceCodeForDefinitionsTopLevel when
path is a file, guiding the model to use read_file instead
- Clarify list_code_definition_names parameter description to
distinguish directory input from file input
Made-with: Cursor
- S1: Don't modify test assertions to match buggy code
- S2: Run project's existing test suite to verify fixes
- CLI_RULES: Remove Node.js-specific examples (npm/tsc)
Made-with: Cursor
* Add implementation plan doc
* feat(hooks): reintroduce runtime hooks feature toggle
* fix: thread effective hooks toggle through hook execution
* test: cover hooks feature toggle visibility and settings wiring
* Remove implementation plan doc
* Move Hooks toggle to Advanced section in Feature Settings
* Fixes as per PR feedback
* Clarifying hooksEnabled
* Make hooksEnabled true by default
* Further fixes as per Greptile feedback
* Further fixes as per Greptile feedback
* Fix failing tests
Fixes#9269 - Thinking blocks missing in Bedrock Opus 4.6
Changes:
- Add explicit handling for 'thinking' and 'redacted_thinking' content types
in formatMessagesForConverseAPI() so they are silently skipped instead of
triggering 'Unsupported content type: thinking' warnings
- Capture signature from additionalModelResponseFields thinking responses
- Add signature_delta handling in contentBlockDelta for streaming
- Add redacted_thinking block handling in contentBlockStart for streaming
- Extend ContentBlockStart/Delta interfaces with signature and data fields
- Add 'redacted_thinking' and 'document' to SupportedContentType union
- Add tests for thinking/redacted_thinking block filtering in message conversion
* feat(cli): add --hooks-dir flag for runtime hook injection
Adds a --hooks-dir <path> CLI flag that allows passing an additional
hooks directory at spawn time. This enables orchestration tools (like
Kanbanana) to inject per-session lifecycle hooks without mutating
the user's global or workspace hooks directories.
The runtime hooks directory is included alongside existing global
(~/Documents/Cline/Hooks/) and workspace (.clinerules/hooks/)
directories during hook discovery. All hooks from all directories
are merged and run in parallel, so runtime hooks are purely additive.
* fix(cli): initialize runtime hooks before interactive startup
Add --no-verify to the initial checkpoint commit in
CheckpointGitOperations.ts. This was already used for subsequent
commits in CheckpointTracker.ts but was missing from the initial
empty commit, causing Cline to fail to initialize when users have
global pre-commit hooks (e.g., conventional commits enforcement).
Fixes#9672
* feat: add telemetry for AI output accepted/rejected across tool handlers
Add line-level diff stats and file operation tracking to telemetry
events when users accept or reject tool outputs. Introduces a shared
`computeLineDiffStats` utility and `captureAiOutputAccepted`/
`captureAiOutputRejected` methods on the telemetry service, wired
into ApplyPatch, WriteToFile, ExecuteCommand, InsertContent, and
SearchAndReplace handlers.
* feat(telemetry): add source tracking for agent vs human edits
Add telemetry differentiation between agent-generated changes and
human modifications to capture more granular edit metrics:
- Add 'source' field to captureAiOutputAccepted telemetry events
- Track human edits by computing diff stats between agent's proposed
content and final saved content
- Apply source tracking to ApplyPatchHandler and WriteToFileToolHandler
- Enable separate analytics for agent vs human contributions
This allows measuring how often and to what extent users modify
AI-generated code, providing insights into AI output quality and
user trust patterns.
* refactor(telemetry): centralize ai output attribution across file edit handlers
- add shared `AiOutputTelemetry` utility for accepted/rejected events
- refactor `WriteToFileToolHandler` and `ApplyPatchHandler` to use shared helpers
- preserve existing telemetry behavior (`source: "agent" | "human"`) while reducing duplication
- keep line diff/file-op attribution semantics unchanged
* fix(telemetry): use pre-save content for human edit line diff stats
The source:"human" telemetry was diffing agent content against
finalContent (post-save), which includes auto-formatting changes
from the editor. This inflated linesChanged/linesDeleted counts
when the formatter modified lines alongside the user's actual edits.
Use diff.applyPatch() to reconstruct the user's pre-save content
from the existing userEdits patch, excluding formatter noise from
the line diff stats.
* fixing syntax error
* refactor(telemetry): make next-hunk bounds check explicit
* remove comment
Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>
---------
Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>
Add author_association check so only MEMBER, OWNER, and COLLABORATOR
users can trigger the JetBrains test workflow via issue comments.
Previously any GitHub user could trigger it, allowing unauthorized
use of the GitHub App token and Actions minutes.
Fixes GHSA-5fq9-fh5x-w83r (SEC-29)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Add provider/model context to all hook payloads
* Fixes as per Greptile feedback
* Further fixes as per Greptile feedback
* Further fixes as per Greptile feedback
* further fixes as per Greptile feedback
* Fix flapping hooks tests on Windows
* fix: stop infinite getLatestMcpServers RPC loop when opening MCP servers panel
The ServersToggleModal useEffect had setMcpServers in its dependency array,
but the context provided an unstable inline wrapper around the useState setter,
creating a new function reference on every render. This caused the effect to
re-fire on every context re-render while the modal was visible, producing 14+
RPC calls in ~15ms.
- Remove setMcpServers from useEffect deps in ServersToggleModal (the effect
should only fire when visibility changes)
- Replace inline arrow wrappers in ExtensionStateContext with direct references
to the stable useState setters (setMcpServers, setRequestyModels,
setHuggingFaceModels, setMcpMarketplaceCatalog)
* address review feedback: add setMcpServers back to deps, use property shorthand
- Add setMcpServers back to useEffect deps in ServersToggleModal now that the
context passes the stable useState setter directly (per Copilot review)
- Remove eslint-disable comment since it's no longer needed
- Use property shorthand for setGroqModels and setBasetenModels in context value
* initial doc changes
* rm general api endpoint
* Add API documentation section with endpoint reference pages
- Add new API docs: overview, getting-started, authentication, models,
chat-completions, errors, and SDK examples
- Update api/reference.mdx with expanded endpoint documentation
- Update enterprise-solutions/api-reference.mdx with improvements
- Update docs.json with new API section navigation entries
---------
Co-authored-by: Juan Pablo <juan@cline.bot>
Co-authored-by: Tony Loehr <turingxo@gmail.com>
* fix: prevent Chinese filename escaping in diff view
Use Uri.parse() instead of Uri.from() for the diff view URI to prevent
non-ASCII characters (e.g. Chinese) in filenames from being
percent-encoded. This is consistent with how other diff URIs are created
in openMultiFileDiff.ts and VscodeCommentReviewController.ts.
Uri.from() encodes the path component, turning Chinese characters into
percent-encoded sequences like %E7%A0%94..., which causes the diff view
to display escaped filenames and fail to open properly.
* fix: encode URI-reserved delimiters in filename before Uri.parse
Encode %, #, and ? in the filename before passing to Uri.parse() to
prevent them from being interpreted as URI delimiters. This handles
edge cases where filenames contain these characters (valid on macOS/Linux)
while preserving non-ASCII characters like Chinese.
* feat(hooks): add Windows hook execution via PowerShell
* chore(changeset): add release note for Windows hooks
* Get hooks working on Windows
Remove changeset file (we no longer use changeset files)
feat(hooks): support Windows PowerShell hook resolution and management
feat(hooks): complete windows powershell hook support and tests
Detect linux-style hooks only on macOS and linux and detect PowerShell-style hooks only on Windows
Fixes for failing unit tests on Windows in CI
Fix failing unit tests on Windows in CI
Fix unit tests for hooks on Windows
Be clear about .ps1 file extension for hooks in PowerShell vs. bash/binary for linux-style hooks
Remove separate test suite step
Reapply hooks-specific test suite
Fix failing hooks tests
* Harden Windows hook PowerShell runtime and test coverage
* test: centralize hook test env and platform overrides
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
When OCA token refresh fails with 400 invalid_grant or 401, legacy secrets
ocaAccessToken and ocaTokenSet (from older Cline versions) were left in VS
Code's secret storage. clearAuth() only cleared ocaApiKey and ocaRefreshToken,
causing every subsequent re-auth attempt to fail in a loop requiring manual
SQLite deletion to recover.
Fix:
- Add ocaAccessToken and ocaTokenSet to SecretKeys in state-keys.ts
- Update OcaAuthProvider.clearAuth() to clear all 4 OCA secrets
Fixes#9567
* fix: resolve 'Could not find the file context' error in Explain Changes
Both handleCommentReply() in explainChangesShared.ts and the onCommentStart
callback in explainChanges.ts were using a strict absolutePath-only match
when looking up files in changedFiles. If the VS Code comment controller
returns a path in a different format (relative vs absolute, different
separators on Windows), the lookup would silently fail and show
'Error: Could not find the file context'.
Add relativePath as a fallback in both lookup sites, making them
consistent with the already-correct logic in streamAIExplanationComments.
Fixes#9382
* Refactor to use parseInt instead of Number.parseInt
* Adding 1m
* fix: wire cline model proto fields for api config
* fix: wire cline picker to shared recommended model logic
* fix: address Cline model picker parity and startup model-info sync
* remove OpenRouter preset model ID support
* rename Cline endpoint feature flag
* Fixing stuff
* Fixing stuff
* Fixing stuff
* refactor: gate cline models endpoint behind feature flag
- Update refreshClineModels to use the EXTENSION_CLINE_MODELS_ENDPOINT feature flag instead of a hardcoded boolean, allowing controlled rollouts of the endpoint source.
- Remove recommended/free models fallback logic, featured model cards, and the initialTab property from OpenRouterModelPicker to simplify the UI component.
* fix: use JSON_SCHEMA for yaml.load to prevent unsafe deserialization
Add { schema: yaml.JSON_SCHEMA } to both yaml.load() calls to reject
custom YAML tags (e.g. !!js/function) that could enable code execution
from untrusted .clinerules or skills files.
Add security tests verifying custom tags are rejected.
* add changeset
The CLI's applyProviderConfig() was reading model info from a disk
cache (controller.readOpenRouterModels) instead of fetching from
the provider API. In headless/Docker environments (e.g., terminal-bench)
the cache doesn't exist, so model info was never set. Both handlers
then fell back to openRouterDefaultModelInfo with maxTokens: 8192,
causing write_to_file truncation on large outputs.
Changes:
- Replace controller.readOpenRouterModels() (disk cache) with
refreshOpenRouterModels() (fetches from API, with cache fallback)
- Add vercel-ai-gateway to the model info fetch path using
refreshVercelAiGatewayModels()
Relates to #7998
Co-authored-by: Cursor <cursoragent@cursor.com>
The "Generate Commit Message" feature was using all changes instead of
only staged changes. Now prioritizes staged changes via getGitDiffStagedFirst(),
falling back to all changes only when nothing is staged.
Closes#5749
Co-authored-by: Raushan Singh <raushrak@Raushans-MacBook-Air.local>
* fix: update stale maxTokens values for Claude 3.7+ models
Every Claude model from 3.7 Sonnet onward had maxTokens set to 8192
in the static model definitions. These values were correct for Claude
3.5 and earlier, but Anthropic has significantly increased output
limits for newer models:
- Claude Opus 4.6: 128K (was 8192, 15.6x too low)
- Claude 3.7 Sonnet: 128K (was 8192, 15.6x too low)
- Claude Sonnet 4.6/4.5/4, Haiku 4.5, Opus 4.5: 64K (was 8192)
- Claude Opus 4, Opus 4.1: 32K (was 8192)
These static definitions are the source of truth for Anthropic direct,
Bedrock, Vertex, and SAP AI Core providers. With the old values, any
write_to_file call exceeding 8192 output tokens would be silently
truncated, producing a missing 'content' parameter error.
Values verified against Anthropic docs, AWS Bedrock docs, Google
Vertex AI docs, and the Vercel AI Gateway API.
Relates to #7998
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: update openRouterDefaultModelInfo.maxTokens to 64K
This fallback ModelInfo (representing claude-sonnet-4.5) is used
when dynamic model info isn't available — notably by the Cline and
Vercel providers in the CLI when the model cache is empty (e.g.,
fresh Docker containers in terminal-bench).
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
The OpenRouter stream transform had a 30-line switch statement that
hardcoded max_tokens=8192 for every Claude model. This was written when
8192 was the actual max output for Claude, but modern Claude models
support much higher limits (e.g. 128K for Sonnet 4.6, 64K for others).
OpenRouter's API already reports the correct max_completion_tokens per
model, and model.info.maxTokens reflects this (128000 for Sonnet 4.6).
The hardcoded switch was silently overriding the dynamic value.
This caused write_to_file failures on OpenRouter (and the Cline
provider, which shares this code path) whenever the tool call content
exceeded 8192 output tokens. The response was truncated
(finish_reason: "length"), producing incomplete JSON that lost the
content parameter.
Runtime evidence:
- Before: max_tokens=8192 sent, completion_tokens=8192 (ceiling),
finish_reason="length", write_to_file content missing
- After: max_tokens=128000 sent, completion_tokens=9824 (needed more
than 8192), finish_reason="tool_calls", write_to_file succeeded
Fixes#7998
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: add MiniMax M2.5 model to MiniMax provider
- Add MiniMax-M2.5 to minimaxModels with 192K context, 128K max tokens,
prompt caching, and reasoning/thinking support
- Update minimaxDefaultModelId to MiniMax-M2.5
- Add minimax/minimax-m2.5 to OpenRouter prompt caching switch
Closes#9391
* fix: add temperature: 1 to MiniMax M2.5 for reasoning support
* docs: update MiniMax provider docs with M2.5 model
* feat: wire up thinking/reasoning support for MiniMax M2.5
- Pass thinkingBudgetTokens from factory to MinimaxHandler
- Use thinking param in API call when reasoning is enabled
- Disable temperature and forced tool_choice when thinking is on
- Add ThinkingBudgetSlider to MiniMaxProvider UI for M2.5
* Add MiniMax-M2.5-highspeed
* Add thinking for highspeed
* Refactor thinking logic
---------
Co-authored-by: BarreiroT <tomasmbarreiroi@gmail.com>
Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>
- Update model ID and name from gpt-5.2-codex to gpt-5.3-codex
- Change tag from "HOT" to "NEW" for the updated model
- Add What's New banner entry promoting Codex 5.3 availability
This commit ensures that internal placeholder tools, specifically `focus_chain`, are filtered out from the final list of native tools exposed to the LLM.
- Added a test case in `PromptRegistry.test.ts` to verify `focus_chain` is excluded from native tools output.
- Updated snapshot files for various models (OpenAI GPT-5, Vertex Gemini 3, etc.) to reflect the removal of the `focus_chain` tool definition.
Fixes false positives in getReadablePath() when directories share a prefix
(e.g., /home/user/project matching /home/user/project-backup). The existing
isLocatedInPath() function correctly handles path boundaries using path.relative().
Closes#8761
Co-authored-by: Raushan Singh <raushrak@Raushans-MacBook-Air.local>
* sdk lib
* improve cline sdk api surface
- better api design and messages
* fix some types, fix session id retrieval, improve wording
* hide controller from sdk surface completely
---------
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
* chore: replace baseUrl with explicit relative paths in tsconfig files
Remove `baseUrl: "."` from tsconfig configurations and update all path aliases to use explicit relative paths (e.g., `./src/*` instead of `src/*`). This makes path resolution more explicit and avoids potential ambiguity in module resolution across the main project and webview-ui configurations.
* update package-lock.json
* Release V3.67.0
Bump version from 3.66.0 to 3.67.0 in package.json and
package-lock.json. Add changelog entry for v3.67.0 covering new
features (subagent skills, AgentConfigLoader, Responses API, websocket
preconnect, CLI /q command), bug fixes (reasoning delta crash, OpenAI
tool ID, auth checks, Gemini 3.1 Pro), and other changes. Update
WhatsNewItems fallback banners to reflect current promotions.
* Fixing stuff
* refactor: consolidate subagent request usage tracking into state object
Replace scattered per-request token tracking variables with a structured
`SubagentUsageState` interface containing `currentRequest` and
`lastRequest` states. This improves code organization by grouping related
token metrics (input, output, cache write/read, total tokens, cost) into
a cohesive `SubagentRequestUsageState` object, reducing variable sprawl
and making the usage lifecycle (current → last) more explicit.
* feat(subagent): add support for skills and optional modelId in agent config
- Update `AgentBaseConfigSchema` and `AgentConfigFrontmatterSchema` to include an optional `skills` field and make `modelId` optional.
- Implement `parseSkills` and `normalizeSkillName` in `AgentConfigLoader` to handle skill parsing from YAML frontmatter.
- Update `SubagentBuilder` to provide access to configured skills.
- Modify `SubagentRunner` to filter available skills based on the agent's configuration, falling back to all available skills if none are specified.
- Update host retrieval to use `HostRegistryInfo` instead of `HostProvider`.
This allows subagents to be restricted to specific skills and provides more flexibility in model configuration.
* update unit test
* feat(cli): fetch featured models from backend with local fallback
- Add async getFeaturedModelsForCline() to fetch models via controller
- Load featured models dynamically in AuthView with useEffect
- Update FeaturedModelPicker to accept featuredModels as optional prop
- Refactor helper functions to accept models parameter for flexibility
- Keep local hardcoded models as fallback when backend fetch fails
* Fixing stuff
* Fixing stuff
* Fixing stuff
* refactor: centralize tool handler registration and filter by allowed tools
- Create centralized toolHandlersMap for all tool handler instantiation
- Add registerToolHandlers method to register only allowed tools from config
- Filter subagent tools to only include allowed tools from allowedTools config
- Remove scattered tool handler registration logic in favor of single source of truth
- Improve maintainability by consolidating tool handler creation in one place
This refactoring ensures subagents only have access to explicitly allowed tools
and makes the tool registration process more maintainable and consistent.
It also improves separation of concerns by having the coordinator manage all tool handler registration, while the executor focuses on orchestration. The allowedTools parameter enables runtime filtering of available tools for different contexts.
Also update PromptRegistry to load synchronous and simplify variant lookup
- Convert async load() to synchronous, called in constructor as both loadVariants and loadComponents are not async functions
- Remove health check logic and loaded state tracking
- Extract getVariant() method with proper generic fallback
- Add getComponents() accessor and simplify component loading
- Convert variant/component loaders from async to synchronous
- Remove unnecessary await calls throughout the codebase
- Add PromptRegistry tests for variant resolution and components
* fix test
* feat: add AgentConfigLoader for file-based agent configs
Add AgentConfigLoader singleton to manage agent configurations loaded from
YAML files in the agents directory. Supports hot-reloading via file watcher,
validates config schema with Zod, and integrates with extension lifecycle
(StateManager initialization and tearDown disposal).
* add tests
* add missing export
* update tests
* feat(tools): implement dynamic tool registration for subagents
Updates the tool system to support dynamically registered subagents as individual tools.
- Modifies `ClineToolSet` to generate specific tool definitions for configured subagents via `AgentConfigLoader`.
- Updates `parseAssistantMessageV2` to use `getToolUseNames()` instead of a static list, enabling the parser to recognize dynamic tool tags.
- Replaces the generic `USE_SUBAGENTS` tool with specific subagent instances when available in the system prompt context.
* update config path and refine tool descriptions
- Relocate the subagent configuration directory from `~/.cline/data/agents` to `~/Documents/Cline/Agents` to improve user accessibility.
- Update subagent tool descriptions and parameter instructions in the system prompt to be more descriptive and helpful for the model.
* revert unrelated changes
* revert unrelated changes
* update unit test
* fix: await AgentConfigLoader initialization before StateManager completes
Ensure agent configs are fully loaded during StateManager initialization
by awaiting the `ready()` promise. Previously, `AgentConfigLoader` was
instantiated without waiting for the initial load to complete, causing
potential race conditions where configs might not be available when
needed.
- Add `initialLoadPromise` field to track the async initial load
- Expose a `ready()` method to allow callers to await initialization
- Await `AgentConfigLoader.getInstance().ready()` in StateManager
* set previousRequestTotalTokens
* Made messages api changes
* Made changes
* Added changes
* Made maxTokens point to the right thing
* Removed deprecated max_tokens field
* Reverted the change
* Making an additional change to not cause any issues with chat completions
* reverting changes so we can make them in the backend
* Added changeset
* Fixed changes based on AI comments
Warm up the OpenAI WebSocket connection early in WebSocket mode to avoid handshake latency on the first response.create call. This introduces a responsesWsReadyPromise to track the connection state and prevent duplicate connection attempts while the initial connection is in flight.
* fix: restrict OpenAI tool ID transformation to native provider
Update `convertToOpenAiMessages` and `transformToolCallId` to only apply tool ID transformations when the provider is explicitly set to `openai-native`. This prevents unintended ID modifications for other providers (like OpenRouter or local LLMs) that use the OpenAI format but may have different tool ID requirements or already provide compatible IDs.
* update tests
* transformToolCallIdForNativeApi
* fix: openai native provider token usage mapping
- Add `store` parameter support to OpenAI native provider options to allow persisting completions.
- Fix incorrect mapping of `cached_tokens` and `reasoning_tokens` in usage statistics.
- Include `thoughtsTokenCount` in the final usage report to track reasoning model performance and costs.
* feat: add websocket support for OpenAI Responses API
This commit introduces WebSocket support for the OpenAI Native provider's Responses API, providing an alternative to the standard HTTP streaming.
- Implement `createResponseStreamWebsocket` in `OpenAiNativeHandler` with a fallback to HTTP on failure.
- Refactor `OpenAiNativeHandler` to modularize tool mapping and parameter construction for the Responses API.
- Update `OcaHandler` to explicitly disable `previousResponseId` when using the Responses API and add validation for model information.
- Integrate `undici` WebSocket for better compatibility in the extension environment.
* disablePreviousResponseId
* feat: add timestamp to conversation messages for response chaining
Add `ts` field to `ClineStorageMessage` to track when messages were
created. Use this timestamp to enforce a 23-hour validity window when
chaining OpenAI responses via `previousResponseId`, since the API only
retains responses for 24 hours. Also fix non-null assertion operators
in tests to use optional chaining for safer access.
* add OpenAI Responses Websocket Mode ApiFormat support
- Add `OPENAI_RESPONSES_WEBSOCKET_MODE` to the `ApiFormat` enum in proto definitions.
- Update `OpenAiNativeHandler` to use the new API format for determining when to use websocket mode, replacing previous environment-based logic.
- Refactor tool mapping for OpenAI Responses to support strict mode and correctly handle null parameters.
- Ensure the `store` option is disabled when `previous_response_id` is present in websocket mode.
- Bump version to 2.4.1 and update package dependencies.
* use abortController
* add support for websocket mode to openai-codex
* set behind feature flag
- added a method to StateManager, setSessionOverride, which overrides
state settings while the statemanager lives in memory
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
* fix: inline focus-chain slider within its feature row
Moves the focus-chain reminder interval `SettingsSlider` from a
standalone element rendered after all experimental feature rows to
being rendered directly beneath the focus-chain `FeatureRow`. The
slider now renders conditionally when `feature.id === "focus-chain"`
and the feature is enabled, improving UI cohesion and making the
relationship between the toggle and its configuration more explicit.
Additionally:
- Relocates focus-chain from `experimentalFeatures` to `agentFeatures`
- Removes the `isExperimental` prop and "Experimental:" label badge
from `FeatureRow` and related feature toggle definitions
- Simplifies `SettingsSlider` markup by removing the wrapper card
styling, making it suitable for inline embedding
- Removes unused line from common.ts
* nestedKey
Handle plain Cmd/Ctrl+A directly in `ChatTextArea` keydown to force
textarea-wide selection via `setSelectionRange`, while preventing default
and propagation. This avoids intermittent failures caused by global shortcut
listener races, and keeps Cmd/Ctrl+Shift+A behavior unchanged.fix(chat): make Cmd/Ctrl+A select-all deterministic
Handle plain Cmd/Ctrl+A directly in `ChatTextArea` keydown to force
textarea-wide selection via `setSelectionRange`, while preventing default
and propagation. This avoids intermittent failures caused by global shortcut
listener races, and keeps Cmd/Ctrl+Shift+A behavior unchanged.
* fix: flaky Cancel behavior by preventing duplicate cancel actions
This PR fixes chat cancel behavior where users sometimes had to click Cancel multiple times, and repeated clicks could accidentally transition into Resume/restart behavior.
* move to finally
* refactor: replace non-null assertions with safe null checks in PatchParser
Replace all forbidden non-null assertions (`!`) in PatchParser.ts with
safe alternatives using optional chaining (`?.`) and nullish coalescing
(`?? ""`/`?? 0`). Also refactor the Levenshtein distance matrix from a
2D array to a flat array to eliminate index-based non-null assertions,
improving type safety and code robustness.
No feature behavior changes.
* simplify Levenshtein matrix indexing
Initialize the distance matrix with zeroes and add `at`/`set` helpers for flat-array access in `levenshteinDistance`.
This removes repeated index math and nullish fallbacks, making the algorithm easier to read while keeping bounds-safe access and identical behavior.refactor(patch-parser): simplify Levenshtein matrix indexing
Initialize the distance matrix with zeroes and add `at`/`set` helpers for flat-array access in `levenshteinDistance`.
This removes repeated index math and nullish fallbacks, making the algorithm easier to read while keeping bounds-safe access and identical behavior.
* feat: add welcome banner support from backend
* make DB banner format conform with existing banners
* add support for welcome banner actions
* remove debugging helper that bypass dismissal, dismissal should work again
* undo changes to make welcome banner always appear during debugging
* remove console logs for debugging
* clean up bannerservice
* clean up welcomesection.tsx
* add new tests for ide type filtering
* add welcome banner own feature flag and conditionally display between hard coded welcome banner and DB backed ones
* turn on welcome banner flag locally by default
* close welcome banners when clicking on actions
* apply bot review suggestion, fix memory leak
* address feedback: use p without span
* split welcome banners into a seperate component to keep whatsnewmodal clean
* get action through api schema instead of extractin it from rules_json
* use only bannerWaitTimeoutRef, remove waitingForBannersRef
* resolve new merge conflict
* linter
* cerebra
- Remove `auto_condense_threshold` from `Settings` and `UpdateSettingsRequest` in `state.proto`.
- Remove `autoCondenseThreshold` from `ApiProviderInfo` interface.
- Update `generate-state-proto.mjs` to remove double field handling and improve integer parsing.
- Add error handling to `ContextManager` when parsing previous request JSON to prevent crashes on malformed data.
* fix(models): keep Sonnet 4.5 as default
* chore(changeset): add release note for Sonnet 4.5 default
* fix(models): remove Sonnet 4.6 from curated model lists
* fix(models): restore Sonnet 4.6 in web recommended list
* feat(cerebras): remove deprecated llama-3.3-70b and qwen-3-32b models
These models have been deprecated from the Cerebras inference platform.
- Remove llama-3.3-70b and qwen-3-32b from cerebrasModels in api.ts
- Update supported models documentation in cerebras.mdx
- Add changeset for the deprecation
* fix: remove stale llama-3.3-70b and qwen-3-32b references from rate limits
Remove dead switch cases in getRateLimits() that referenced deprecated models
no longer present in cerebrasModels.
* feat(cli): add /skills slash command for managing skills
- Add /skills to CLI_ONLY_COMMANDS in slashCommands.ts
- Create SkillsPanelContent component with:
- Display global and workspace skills with toggle indicators
- Enter to use skill (inserts @path into input)
- Space to toggle skill enabled/disabled
- Selectable marketplace link to skills.sh
- Keyboard navigation with arrow keys and vim keys
- Wire up panel in ChatView.tsx
- Add comprehensive tests for keyboard interactions
* refactor(cli): use static skill controller imports
* fix(cli): add React import to skills panel test
* fix(cli): suppress required React import lint in skills test
* fix(cli): harden /skills panel interactions
Revert optimistic skill toggle state when persistence fails, and surface a fallback URL when opening the marketplace fails. Also tighten and extend tests to verify exact marketplace URL handling and rollback behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: disable click-to-set auto-condense threshold and hardcode default
Clicking anywhere on the context window progress bar silently set
autoCondenseThreshold to a value based on click position (e.g. 0.05),
persisting in globalState. This caused compaction to fire at ~10K tokens
instead of the intended ~150K, resulting in ~20 context resets per task.
- Comment out click and keyboard handlers on progress bar (keep components
for future release with proper UX)
- Hardcode threshold to 0.75 default, ignoring corrupted stored values
Co-authored-by: Cursor <cursoragent@cursor.com>
* test: add shouldCompactContextWindow unit tests
Cover threshold math including the accidental low-threshold bug case,
undefined/zero fallbacks, cache token inclusion, and maxAllowedSize cap.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: hardcode autoCondenseThreshold in all remaining callsites
Address Greptile review: SubagentRunner.ts, task/index.ts display
logic, and controller/index.ts webview state all still read the
corrupted value from globalState. Hardcode 0.75 everywhere.
Co-authored-by: Cursor <cursoragent@cursor.com>
* style: remove unnecessary union type on hardcoded threshold
Drop `number | undefined` annotation from the hardcoded 0.75 literal
in SubagentRunner.ts per Greptile review feedback.
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor: use SETTINGS_DEFAULTS constant, remove commented-out code, clarify test
- Replace hardcoded 0.75 with SETTINGS_DEFAULTS.autoCondenseThreshold
across all 4 callsites for a single source of truth
- Delete commented-out click/keyboard handlers in ContextWindow.tsx,
replace with TODO referencing PR #9348
- Make bug-case test self-documenting by deriving token values from
the threshold calculation
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: smarter retry for write_to_file missing content parameter (#7998)
Replace generic 'missing parameter' error with progressive guidance when
write_to_file fails due to empty content parameter. This breaks the
infinite retry loop where the model repeatedly attempts the same
write_to_file call that exceeds output token limits.
Changes:
- Add writeToFileMissingContentError() to formatResponse with 3 tiers:
1st failure: suggestions (use skeleton + replace_in_file)
2nd failure: strong directive (stop retrying write_to_file)
3rd+ failure: CRITICAL stop, forces alternative strategies
- Add context window awareness: warns model when >50% context used
- Add getContextUsagePercent() helper to WriteToFileToolHandler
- Add 22 unit tests covering progressive escalation and context awareness
Fixes#7998
* add changeset for write_to_file retry fix
* refactor: simplify write_to_file error handling per review
- Simplify writeToFileMissingContentError to single-tier error following
existing diffError pattern (no progressive escalation)
- Use shared getLastApiReqTotalTokens() for context window awareness
- Remove private getContextUsagePercent() method from handler
- Add proactive skeleton + replace_in_file guidance to write_to_file
tool description for all variants
- Simplify tests to match new API (11 tests)
* test: update system prompt snapshots
* chore: revert write_to_file prompt guidance
* feat: restore progressive 3-tier guidance for write_to_file missing content
Restore the progressive escalation that was removed in dd3c12d4e:
- Tier 1 (1st failure): Gentle suggestions (skeleton + replace_in_file)
- Tier 2 (2nd failure): Strong directive, 'Do NOT attempt full write again'
- Tier 3 (3rd+ failure): CRITICAL stop, forces alternative strategies
- Context window warning when >50% full
- Dynamic UI message: 'Retrying...' vs 'multiple times — different approach'
- 21 tests covering all tiers and context awareness
* nit: extract context window warning threshold to named constant
Also replace emoji with plain text in warning message for consistency.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: add Sonnet 5 support and make it default across surfaces
* feat: surface Sonnet 5 as free while keeping Sonnet 4.5 defaults
* fix: rename Sonnet 5 support to Sonnet 4.6 across providers and UI
* fix: allow duplicate onboarding model ids across free and frontier
* chore: update Sonnet 4.6 banner to limited-time free messaging
* fix: align Bedrock Sonnet 4.6 model ids with AWS format
* feat: update whats new promo to Sonnet 4.6 free offer
* chore: update Sonnet 4.6 promo copy and timing
Updating CHANGELOG.md format
update changelog
update banner and bump version
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat: add z-ai/glm-5 to free models list
Include Z.AI's GLM 5 in the free model whitelist for zero-cost usage
and update the model picker UI to display the free label.
* Adding thinking
* Adding thinking
* Adding thinking
* changeset version bump
* v3.62.0 Release Notes
- Banners now display immediately when opening the extension instead of requiring user interaction first
- Resolved 17 security vulnerabilities including high-severity DoS issues in dependencies (body-parser, axios, qs, tar, and others)
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
- Fixes for Minimax model family
- Fixes for Response chaining for OpenAI's Responses API
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Add an optional `usePreviousResponseId` flag to
`convertToOpenAIResponsesInput` and gate previous assistant-response
lookup behind it.
This makes response chaining opt-in instead of always-on, so providers
can control whether to continue from the latest stored OpenAI response
ID.feat(openai): make response ID chaining configurable
Add an optional `usePreviousResponseId` flag to
`convertToOpenAIResponsesInput` and gate previous assistant-response
lookup behind it.
This makes response chaining opt-in instead of always-on, so providers
can control whether to continue from the latest stored OpenAI response
ID.
The unit test suite currenlt is running the BannerService tests only when it should run the full suite.
Also update package-lock.json that wentout of sync.
- Add `name` property to minimax, kat-coder-pro, and trinity-large-preview
models that were previously missing it
- Move type annotation from `as FeaturedModel[]` casts to the variable
declaration for proper type checking at assignment time
- Add test to verify all featured models include a display name
* feat: persistant thinking loader at bottom of stream during any cline activity with no visual feedback
* feat: thinking and flicker fix
* refactor: remove multi-layer throttling, use single canonical throttle point
Collapse 4 independent throttle layers (up to ~500ms added latency) into
a single 50ms debounce in subscribeToPartialMessage. Replace index-based
partial message tracking with stable ts-based tracking. Remove webview
queue/timer/flush system in favor of cheap equality dedup.
* fix: Add production-grade improvements to flicker fix
- Fix global mutable state bug in subscribeToPartialMessage.ts
- Add comprehensive test coverage (51 tests passing)
- Rename ThrottledApiHandler → SanitizedApiHandler
- Remove incomplete OpenAI reasoning effort code
* Fix test failures
* PR changes as per Greptile feedback
* Fixes as per feedback during PR review
---------
Co-authored-by: cline-test <132302818+candieduniverse@users.noreply.github.com>
* chore(evals): reorganize eval structure with purpose-based naming
- Move evals/diff-edits/ → evals/benchmarks/tool-precision/replace-in-file/
- Move evals/cli/ → evals/legacy/cli/ (preserve for reference)
- Create evals/benchmarks/real-world/ directory
- Create evals/benchmarks/coding-exercises/cases/ directory
- Create evals/analysis/ directory structure
Note: No repositories/exercism/ directory found to move.
Skipping pre-commit hook as this is a reorganization of legacy code.
* chore(evals): remove legacy evaluation code
Remove abandoned evaluation infrastructure:
- evals/benchmarks/tool-precision/ - Dashboard, database, diff implementations
- evals/legacy/cli/ - Old HTTP-based eval harness
This functionality is superseded by the new testing pyramid:
- Tool precision is now covered by contract tests in src/core/
- E2E testing uses the cline-bench framework
* feat(evals): add analysis framework for benchmark results
Add shared infrastructure for analyzing evaluation results:
- TypeScript schemas for Harbor and analysis output formats
- Parsers for Harbor, tool-precision, and exercise results
- Failure classifier with pattern matching (cline-failures.yaml)
- Metrics calculator (pass@k, consistency, latency)
- JSON and Markdown reporters
- CLI with analyze and compare commands
- Unit tests for classifier and metrics
This framework is used by both smoke tests and E2E evaluations
to provide consistent metrics and failure categorization.
* feat(evals): add contract tests for API transforms
Add tests to verify API response transformations preserve data correctly:
- thinking-traces.test.ts: Tests thinking block extraction and formatting
- tool-parsing.test.ts: Tests tool call parsing across providers
These contract tests catch regressions when modifying transform logic,
ensuring API responses are correctly processed regardless of provider.
Run with: npm run test:unit
* feat(evals): add provider smoke tests with pass@k metrics
Add lightweight smoke tests that validate provider integrations work
correctly with real LLM calls:
Scenarios (5 curated tests):
- 01-create-file: Tests write_to_file tool
- 02-edit-file: Tests replace_in_file tool
- 03-read-summarize: Tests read_file tool
- 04-multi-file: Tests multi-file edits
- 05-typescript-function: Tests code generation
Features:
- CLI-based runner using the cline CLI
- Multiple trials per scenario for reliability testing
- pass@k metrics (solution finding) and pass^k (consistency)
- Results storage with logs and latest symlink
- Adaptive metric display based on trial count
Run locally: npm run eval:smoke
* feat(evals): add E2E runner with cline-bench
Add end-to-end testing infrastructure using real-world production bugs:
- cline-bench submodule: 12 curated tasks from actual Cline sessions
- Complex multi-file refactors
- Bug fixes requiring deep context understanding
- Cross-language/framework tasks
- E2E runner (evals/e2e/run-cline-bench.ts):
- Integrates with Harbor for containerized execution
- Supports single task or full suite runs
- Pass/fail metrics with detailed logging
Run: npm run eval:e2e -- --task discord-trivia
Note: E2E tests require Docker and are intended for weekly/release
testing, not per-commit CI (each task takes 20-30 minutes).
* feat(evals): add CI workflow and documentation
CI Workflow (.github/workflows/cline-evals-regression.yml):
- Triggers on push/PR to main (src/core, src/shared, proto, evals paths)
- Builds CLI from source with Go 1.24
- Runs 5 smoke test scenarios in parallel
- Uses Anthropic API with claude-sonnet-4
- Uploads results as artifacts with summary
npm scripts:
- eval:smoke - Run smoke tests locally (builds CLI first)
- eval:smoke:run - Run smoke tests (assumes CLI is built)
- eval:e2e - Run cline-bench E2E tests
Documentation:
- ARCHITECTURE.md: Testing pyramid overview with ASCII diagrams
- EVALS_OVERVIEW.md: High-level introduction for mixed audience
- Updated README.md with current structure and usage
* chore(evals): restore tool-precision as deprecated legacy
Restore the diff edit evaluation framework for @ara's use case.
Marked as DEPRECATED - target removal Q2 2026 when cline-bench
is fully operational for model comparison.
Note: Skipping linter as this is legacy code being preserved as-is.
* feat(evals): add per-scenario model support and apply_patch test
Also honor --model overrides and prune stubs.
* chore(evals): update smoke tests for CLI 2.0
- Remove Go setup from workflow (CLI 2.0 is TypeScript)
- Build CLI via `npm run build` in cli/ directory
- Install CLI via `npm link` to test built code from PR
- Update CLI flags: -y -m model --json (remove -o and -s)
- Provider configured via `cline auth` before tests run
* chore(evals): add auth check and CLI 2.0 flags
- Add configureAuth() that runs cline auth non-interactively
- Require CLINE_API_KEY env var or use existing ~/.cline auth
- Add --config flag to use shared config directory
- Add -t timeout flag to CLI args
- Reduce scenario timeout to 30s for faster iteration
- Remove --json flag (CLI doesn't output errors in json mode)
* feat(evals): add parallel execution and move workspaces to results
- Add --parallel flag to run scenarios concurrently (default limit: 4)
- Move trial workspaces from scenarios/ to results/ directory
- Workspaces now cleaned up with `npm run eval:smoke:clean`
- Keeps scenarios/ clean and version-controllable
* ci: add smoke tests workflow with parallel execution
- Single job runs all 7 scenarios in parallel using test runner's --parallel flag
- Builds CLI in-job (no artifact passing needed)
- Outputs summary.md to GitHub step summary
- Syncs package-lock.json for tiktoken/commander deps
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(evals): increase 01-create-file timeout to 120s
The 30s timeout was too short for reliable execution.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: restore changesets deleted during rebase
These changesets belong to the already-merged CLI fix (#9073)
and should not be deleted by this branch.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(evals): remove unused dependencies from package.json
Drop execa, node-fetch, ora, sqlite, uuid, yargs and their types.
These were leftovers from the old CLI-based eval runner. The smoke
tests use Node builtins and the tool-precision benchmark only needs
axios, better-sqlite3, chalk, commander, dotenv, tiktoken.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add TypeScript build info files to .gitignore
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
* feat: add .agents/skills directory support for skill discovery
Add compatibility for the standardized .agents/skills directory pattern,
both globally (~/.agents/skills) and locally (.agents/skills in workspace).
* feat: make .agents/skills the default for new skills
New skills are now created in .agents/skills (local) and ~/.agents/skills
(global) by default. These directories also have highest priority in
skill discovery, overriding skills with the same name from other locations.
* docs: update skills documentation for .agents/skills directories
* refactor skills directory helpers
* increases banner cache duration to 24 hours so we make one api calls per day per user; implements a circuit breaker that stops retrying after 3 consecutive failures
* add new tests
* Clear banner cache when auth status changes
* revert 5898bc6e0e
* Fixing circuit breaker
* fix: reset circuitBreakerOpenedAt on failed half-open recovery
Previously, circuitBreakerOpenedAt was only set when consecutiveFailures
reached exactly MAX_CONSECUTIVE_FAILURES. This meant that after a failed
half-open recovery attempt, the timestamp wasn't updated, causing the
circuit breaker to immediately enter half-open state again on the next call.
Now circuitBreakerOpenedAt is updated on every failure once the circuit
breaker is tripped, ensuring proper timeout between recovery attempts.
* refactor: BannerService initialization and cache management
- Move BannerService initialization from common.ts to AuthService (which is initialized in controller)
- Re-initialize BannerService after auth state updates to ensure user context
- Add HostRegistryInfo to centralize host/platform information collection
- Improve rate limiting with exponential backoff (5min → 15min → 30min)
- Refactor error handling to better distinguish between rate limits and server errors
- Remove temporary disabled banner fetching comments
This change ensures banners are only fetched when user authentication is
available and implements more robust rate limiting to prevent API hammering.
The banner service now properly tracks user context and respects server
rate limits with progressive backoff delays.
* refactor(banner): simplify banner service initialization and usage
- Remove `getBanners()` wrapper method from Controller class
- Call `BannerService.get().getActiveBanners()` directly in Controller
- Change `BannerService.initialize()` to synchronous, returns instance immediately
- Make banner fetching non-blocking by moving to background
- Remove unused `BannerCardData` import from Controller
- Update tests to handle asynchronous background fetching with timeouts
- Clean up AuthService banner service initialization comment
This change simplifies the banner service API by removing unnecessary abstraction layers and making initialization non-blocking. The service now fetches banners in the background rather than blocking on initialization, improving application startup performance.
* clean up
* apply feedback
* un-skip unit test
* mock
* mock env
* clean up and add debounce fetch
* log fetch time
* revert
* feature flag: remote-banners
* fix loop in authService on auth update
Co-authored-by: Tomás Barreiro <BarreiroT@users.noreply.github.com>
* Fix tests
* small fixes
* use .? for banner
* moves initializeDistinctId to StateManager
* initializeDistinctId
* use v2 endpoint
---------
Co-authored-by: Zhongying Qiao <cryptoque@users.noreply.github.com>
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
Co-authored-by: Tomás Barreiro <BarreiroT@users.noreply.github.com>
Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>
Co-authored-by: BarreiroT <tomasmbarreiroi@gmail.com>
* fix: openai native provider token usage mapping
- Add `store` parameter support to OpenAI native provider options to allow persisting completions.
- Fix incorrect mapping of `cached_tokens` and `reasoning_tokens` in usage statistics.
- Include `thoughtsTokenCount` in the final usage report to track reasoning model performance and costs.
* Update src/core/api/providers/openai-native.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Apply suggestions from code review
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat: implement response chaining for Responses API
Implement response chaining by tracking and passing previous_response_id
to continue conversations from the last assistant message. This enables
the Responses API to maintain context across multiple turns.
Key changes:
- Search backwards through messages to find last assistant message with ID
- Only send new messages after the chained response
- Track function call metadata (call_id, name, id) across chunks
- Include call_id in tool_call events for proper correlation
- Clean up debug logging and remove commented code
- Remove redundant "Ran out of tokens" log message
This improves conversation continuity and ensures function calls are
properly tracked with their associated IDs throughout the streaming
response lifecycle.
* clean up
* update oca
* codex
Replaces the inline VS Code launch command with a proper dev script that:
- Builds protos and webview upfront
- Runs esbuild, tsc, and webview watchers in parallel tmux panes
- Waits for dist/extension.js before launching the extension host
- Cleans up all processes and closes the dev window on Ctrl+C
* fix(webview): stabilize focus chain header space and placeholder
* fix(chat): add follow-up bottom scroll to avoid short scroll
* style(chat): refine markdown spacing and tool group summary tone
* fix(chat): retry auto-scroll at 40ms and 70ms
* fix(chat): keep focus chain placeholder visible until checklist exists
* changeset version bump
* Updating CHANGELOG.md format
* changeset version bump
* Updating CHANGELOG.md format
* Eve manually updating the banner and the release version
* Manually update the changelog
* Fix GLM 5 model ID in banner
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: cline-test <132302818+candieduniverse@users.noreply.github.com>
* docs: add subagents feature documentation
Add new documentation page covering the Subagents feature, including
how it works, enabling/configuring, auto-approve behavior, available
tools, and usage guidance. Register the page in docs.json sidebar nav.
* docs: remove hardcoded subagent limit from subagents page
Remove references to 'up to five' subagents, as the limit is no longer
fixed. Updates both the intro paragraph and the How It Works section.
* feat: checkpoint subagent tool workflow and approval UX
* feat: support subagent tool execution without native tool calls
* fix: expose use_subagents when native tool calling is disabled
* fix: stabilize subagent command UX and suppress nested command rows
* chore: tune subagent prompt guidance for context-heavy exploration
* fix: align subagent row spacing with chat row conventions
* fix: keep cancelled subagent state during immediate resume
* feat: implement subagent message rendering for approval prompts and progress updates
* feat: enhance SubagentRunner with tool use ID resolution and fallback handling
* fix: stabilize subagent cline requests with ulid and initial workspace metadata
* refactor: unify subagent chat row rendering
* feat: surface subagent costs in task metrics and status rows
* fix: refine cli subagent tree alignment and wrapping
* fix: refine subagent streaming rows in cli and webview
* fix: ensure unique act mode hint keys in CLI chat
* feat: add subagents settings toggle wiring across webview and cli
* fix(webview): stream subagent stats per prompt while constructing prompts
* fix: remove duplicate subagentsEnabled declaration after rebase
* chore: restore package lockfiles to main
* fix: harden task history usage parsing and clean prompt separators
* chore: refine subagent response formatting guidance
* feat: collapse subagent prompts with show more
* feat: show latest subagent tool call in status rows
* fix: fall back to non-native mode for subagents when native tools are unavailable
* fix: retry empty subagent responses before failing
* fix(subagents): require attempt_completion and dedupe tool result formatting
* feat(subagents): polish prompt guidance and webview status row
* fix(task): prevent duplicate partial text rows after completion
Avoid adding a new partial text message when the latest text row is already completed with the same content. This stops a presenter race from rendering duplicate streamed text lines for MiniMax-style timing.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(task): cover duplicate partial text dedupe behavior
Add a Task.say unit test that reproduces the duplicate-partial-after-complete scenario and verifies we skip creating a second text row with identical content.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(claude-code): add opus 4.6 1m model option
* fix(claude-code): support opus[1m] alias and align opus alias
* fix(claude-code): add sonnet[1m] model support
* add more shortcuts to help output
* Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
---------
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add Bedrock to the list in isNextGenModelProvider()
* feat(bedrock): Remove testing script used to develop isNextGenModelProvider() change against
* refactor: extract shared isParallelToolCallingEnabled into model-utils
Consolidate duplicated parallel tool calling logic from ToolExecutor.ts
and task/index.ts into a single exported function in model-utils.ts.
Both callers now delegate to the shared function, eliminating the need
to maintain identical checks in two places.
Replaces inline --body with --body-file approach in the PR creation skill documentation. This avoids shell escaping issues, newline problems, and command-line flakiness when creating PRs with complex markdown content.
Related to #8785
* feat: enable sync-ed deletion for remote mcp servers from remote config to extension
* chore: add tests for syncing remote mcp server adding and removal
* address comments
* WIP - Render a Remote Config secttion and add an option to refresh
* Add the different remote config sections and test them
* fixes
* refactor
* Add proper wrapping
* Stack more values
* Properly report errors when prompt uploading fails
* Add a better error message for the otel test button
* clean
* Fix option rendering
* Render less options if they aren't configured
* fix: use vscode.env.asExternalUri for web OAuth callbacks
In VS Code Web (Codespaces, code serve-web), OAuth callbacks using
http://127.0.0.1:PORT break because the extension host runs remotely.
Changes:
- getCallbackUrl now accepts a path parameter
- Desktop: uses vscode://extension-id/path directly
- Web (UIKind.Web): uses vscode.env.asExternalUri() for web-reachable URL
- Updated all callers (/auth, /openrouter, /hicap, /requesty, MCP) to
pass path and use URL+searchParams for proper encoding
- Added regression test asserting web callback URL is not 127.0.0.1
- AuthHandler (localhost HTTP) now only used by CLI/standalone mode
* fix: use URL.searchParams for proper callback URL encoding
Callers were using template literal interpolation to embed callback URLs
into query strings, which breaks when the URL contains special characters
(e.g. from asExternalUri with query params). Use URL+searchParams.set()
which automatically encodes values.
* chore: revert unrelated whitespace change in account.proto
* revert: remove non-essential URL encoding changes in auth callers
Keep only the core fix (getCallbackUrl path parameter + asExternalUri for web).
Revert the URL+searchParams encoding improvement to minimize diff.
* fix: URL-encode callback_url in auth callers, add encoding test
In VS Code Web, callback URLs from asExternalUri can contain their own
query params (?tkn=...&extra=...). String-interpolating them into
callback_url= causes everything after the first & to be parsed as
top-level params, truncating the callback URL.
Use URL + searchParams.set() in openrouter, hicap, and requesty callers.
Replace tautology test with deterministic round-trip encoding assertions.
* feat(tools): add auto-approval support for attempt_completion commands
- Add auto-approval logic for bash commands in AttemptCompletionHandler
- Show commands as 'say' instead of 'ask' when auto-approved
- Display notification prompting user approval when manual approval needed
- Add 30-second timeout notification for long-running auto-approved commands
- Fix Logger import path from @/shared to @shared
* Send to cline provider
* feat(bedrock): Create agent implementation plan for supporting parallel tool calling.
* Add Bedrock tool calling support
* Improve Bedrock tool calling test guidance
* Add Bedrock CLI parallel tool calling test script
* fix: add ALLOW_AWS_DEFAULT_CHAIN support to live integration test script
* chore: add changeset for Bedrock parallel tool calling
* feat(bedrock): enable native parallel tool calling for Bedrock provider
- Add 'bedrock' to isNextGenModelProvider() so native tool calling is enabled
- Add 'bedrock' to getNativeConverter() to use Anthropic-format tool specs (input_schema)
- Fix empty tool description validation error in mapClineToolsToBedrockToolConfig
(Bedrock requires description length >= 1)
- Update CLI test to use Sonnet 4.5 (Haiku too small for native tool calling)
- Add <invoke> XML detection to CLI test to catch XML fallback
Verified: conversation history shows 3 native tool_use blocks in a single
assistant response with 3 matching tool_result blocks — true parallel
tool calling via Bedrock Converse API.
* docs: mark all phases complete in bedrock parallel tool calling implementation plan
* chore: switch test scripts default model to Haiku 4.5 (cheaper for testing)
* feat: enhance CLI verification suite with 3 test cases (single, parallel, round-trip)
* Remove bedrock parallel tool calling implementation plan doc.
* refactor: simplify to single CLI verification script for bedrock parallel tool calling
Remove the handler-level test script (test-bedrock-tool-calling.ts) and consolidate
into a single focused CLI test that proves parallel tool calling works end-to-end:
- Spawns Cline CLI with Bedrock config
- Asks it to read 3 files
- Verifies ≥2 parallel native tool calls (not XML fallback)
- Task completion proves tool result round-trip works
* refactor(bedrock): improve type safety and code quality for parallel tool calling
- Add typed interfaces (ToolUseStart, ToolUseDelta) for Bedrock stream
events instead of relying on `as any` casts
- Extend ContentBlockStart and ContentBlockDelta interfaces with toolUse
fields so stream parsing uses typed property access
- Remove dead `inputBuffer` field from activeToolCalls Map (was tracked
but never read — tool input deltas are yielded immediately)
- Add JSDoc to mapClineToolsToBedrockToolConfig explaining its purpose
and return semantics
- Document why createDeepseekMessage intentionally ignores the tools
parameter (DeepSeek R1 uses InvokeModel, not Converse API)
* refactor(scripts): improve test script readability and resource cleanup
- Add try/finally with cleanupDirs() to remove temp workspace and config
dirs after each run (previously accumulated in $TMPDIR)
- Extract named constants for CLI_TIMEOUT_SECONDS and HEARTBEAT_INTERVAL_MS
- Add CliResult interface for the runCli return type
- Rename cryptic variables: hb → heartbeatInterval, c → chunk, p/d → filePath/data
- Add JSDoc to parseReadFilePaths and hasXmlFallback
- Add explanatory comments to empty catch blocks
- Log stderr on non-zero exit code for easier debugging
- Extract createTestWorkspace() to separate workspace setup from main flow
- Add section separator comments for visual structure
* test(bedrock): add missing edge-case tests and remove dead describe block
- Add tests for mapClineToolsToBedrockToolConfig edge cases:
undefined/empty input returns undefined, tools without input_schema
are silently dropped
- Add test for formatMessagesForConverseAPI with array tool_result
content (multi-block text responses)
- Add test for tool_result is_error → status:'error' mapping
- Remove empty 'reasoning content handling (deprecated)' describe block
35 tests passing (was 31).
* test(bedrock): add integration-level tests covering E2E script gaps
Add 'native tool calling integration' test suite that validates the
concerns previously only covered by the live E2E CLI script:
- Bedrock + Claude 4 is recognized as native tool calling eligible
(catches silent regression if Bedrock is removed from
isNextGenModelProvider or Claude 4 from isNextGenModelFamily)
- Bedrock + Claude 3.x correctly does NOT qualify (pre-4.0 guard)
- Native tool calling disabled when user setting is off
- createAnthropicMessage passes toolConfig to ConverseStreamCommand
(catches the tool spec not reaching the API)
- Full multi-turn tool call round-trip formatting (tool_use in
assistant → tool_result in user → reformatted for next API call)
40 tests passing (was 35).
* Remove functional verification script before code review
The diff editor e2e test flakes consistently on Windows CI because the
40s test timeout is too tight. The test does signin, message send,
history verification, then a second message send before the diff
assertion -- on slow Windows runners this setup alone can eat most of
the budget. Bumping to 60s gives enough headroom.
Add Terminal-Bench-proven rules as items 5 and 6 in the double-check
re-verification checklist, so they're enforced at completion
verification time rather than in the system prompt.
* feat: add double-check completion experimental feature
When enabled, the first attempt_completion call in a task is rejected
with a tool error that instructs the model to re-verify its work
against the original task requirements. The rejection includes the
initial task text for context. The second call proceeds normally.
This is opt-in (default off) and available via:
- Settings > Features > Experimental > Double-Check Completion
- CLI flag: --double-check-completion
- CLI TUI settings panel toggle
Adds completionAttemptCount to TaskState, plumbs the setting through
TaskConfig/ToolExecutor following existing patterns, and includes
9 unit tests.
* chore: add cli:run script for quick CLI testing
* fix: increase task preview to 8000 chars, revert unintended regex change
* fix: preserve existing proto field numbers
The auto-generator renumbered open_ai_headers (175->177) and
openai_codex_oauth_credentials (46->48), and dropped the reserved 146
comment. Restore original field numbers to avoid breaking wire-format
compatibility.
* fix: remove partial completion_result message on double-check rejection
During streaming, handlePartialBlock shows the completion_result in
the chat view. When we reject the first attempt, we need to clean up
that partial message so the user doesn't see a stale completion that
was actually rejected.
* refactor: switch from counter to boolean toggle for double-check
Use a boolean pending flag instead of a counter so that every
attempt_completion gets double-checked, not just the first one in
a task. The flag toggles: reject (set pending), accept (clear pending),
so if the model does more work and tries to complete again later, it
gets double-checked again.
* fix(prompt): add output precision and threshold iteration rules
Two concise rules proven effective via Terminal-Bench testing:
1. Output precision: produce exactly what's specified, no extra columns/fields/debug output
2. Threshold iteration: verify results meet numerical criteria before completing
Tested on 6 targeted Terminal-Bench tasks (job 2026-02-07__16-15-00):
- log-summary-date-ranges: FAIL→PASS (output precision rule eliminated extra columns)
- dna-insert: FAIL→PASS (iterate rule helped agent meet Tm threshold)
A third rule (no-cleanup) was tested and deliberately excluded: it failed to
prevent self-sabotage on configure-git-webserver despite STRICTLY FORBIDDEN
language, and caused a side-effect on polyglot-c-py by preventing legitimate
build artifact cleanup. The cleanup behavior is too deeply trained to override
via prompt rules alone.
* test: update prompt snapshots for new rules
* fix(cli): route PostHog networking through shared fetch
* remove unnecessary `as RequestInit` casts from PostHog fetch wrappers
PostHogFetchOptions is a structural subset of RequestInit, so the cast
is unnecessary. Also removes a stale comment about shared client support
in PostHogErrorProvider.
The --thinking flag now accepts an optional number argument to set a
custom thinking budget instead of always using the 1024 default.
cline "prompt" --thinking # 1024 tokens (default)
cline "prompt" --thinking 8000 # 8000 tokens
Invalid values get a warning and fall back to 1024.
* feat: move reasoning effort to model config and update model selection UX
* refactor: dedupe reasoning effort handling and drop lockfile churn
* refactor: default reasoning effort to low
* refactor(cli): sync mode-scoped thinking and reasoning writes
* fix: centralize reasoning effort normalization and avoid implicit openai effort
* fix: restore proto field number for codex credentials and reserve removed fields
- Keep openai_codex_oauth_credentials at field 46 (was incorrectly
changed to 47)
- Add reserved 146 in Settings for removed openai_reasoning_effort
- Add reserved 15 in UpdateSettingsRequest for removed openai_reasoning_effort
- Remove stale openai_reasoning_effort field from UpdateSettingsRequest
* fix: map medium reasoning effort to LOW for Gemini models
Gemini API only accepts LOW and HIGH thinking levels. MEDIUM exists in
the SDK enum but is rejected at the API level. Map medium to LOW and
update the default fallback accordingly.
Introduces a mechanism to save system prompts and task metadata to disk for debugging and analysis purposes.
- Added `writePromptMetadataArtifacts` to the `Task` class.
- Feature is enabled via the `CLINE_WRITE_PROMPT_ARTIFACTS` environment variable.
- Artifacts are saved to `.cline-prompt-artifacts` or a custom path defined by `CLINE_PROMPT_ARTIFACT_DIR`.
- Writes both a JSON manifest (containing task ID, model info, and timestamp) and the raw system prompt for every API request.
* fix: use vscode.env.asExternalUri for auth callback URLs in VS Code Web
The OAuth callback redirect was broken in VS Code Web (code serve-web)
environments because the callback URL used a raw vscode:// URI scheme,
which the OS would route to the local desktop VS Code app instead of
the web instance.
This change wraps both getCallbackUrl() and getIdeRedirectUri() with
vscode.env.asExternalUri() which properly transforms URIs based on the
environment:
- Desktop VS Code: unchanged (vscode://...)
- VS Code Remote SSH: adds remote authority for proper routing
- VS Code Web: transforms to HTTPS URL that routes through the web server
Fixes#5109 (remaining callback redirect issue)
Related: #2152
* fix: use HTTP-based auth callback for VS Code Web mode
In VS Code Web (code serve-web), vscode:// URIs redirect to the desktop
app instead of staying in the browser. This change uses AuthHandler
(local HTTP server) for the auth callback in web mode, matching how
CLI/standalone already handles auth.
- getCallbackUrl: use AuthHandler when UIKind.Web
- getIdeRedirectUri: return empty in web mode to avoid vscode:// redirect
* fix: add fallback for openExternal RPC for JetBrains compatibility
The openExternal host bridge RPC is not implemented in the JetBrains
plugin, causing sign-in to fail silently. This adds a fallback to the
'open' npm package when the host RPC fails with UNIMPLEMENTED.
Fixes#9164, #9137, #9138
The chat streaming UI refactor removed the loading indicator that
previously showed when an API request was in progress. This left users
staring at a frozen UI during the latency between sending a message
and receiving the first streamed content.
Changes:
- Add "Thinking..." shimmer in the Virtuoso Footer as the sole loading
indicator, covering both pre-api_req_started (backend processing) and
post-api_req_started (waiting for model response) states
- Filter out api_req_started messages that have no visible content
(no error/cancel). These rows rendered as invisible padding since
the PR removed the old API request accordion UI. Reasoning messages
already render as their own standalone ChatRows.
- Thread footerActive flag to MessageRenderer so the last message skips
pb-2.5 when the Footer is showing, keeping spacing consistent with
the pt-2.5 on every ChatRow
- Add stdinIsTTY check to shouldUsePlainTextMode() - Ink requires raw mode on stdin
- Only error on empty stdin when no prompt is provided (allows: cline 'prompt' < /dev/null)
- Fixes crash in GitHub Actions and other CI environments
- Cline CLI 2.0 now available. Install with `npm install -g cline`
- Anthopic Opus 4.6
- Minimax-2.1 and Kimi-k2.5 now available for free for a limited time promo
- Codex-5.3 through OpenAI Codex provider
- Fix read file tool to support reading large files
- Fix decimal input crash in OpenAI Compatible price fields (#8129)
- Fix build complete handlers when updating the api config
- Fixed missing provider from list
- Fixed Favorite Icon / Star from getting clipped in the task history view
- Make skills always enabled and remove feature toggle setting
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* feat: add GPT-5.3 Codex model for ChatGPT subscription users
OpenAI released GPT-5.3 Codex today. Adding it to the OpenAI Codex
provider (ChatGPT Plus/Pro subscription) model list and setting it
as the new default.
Changes:
- Add gpt-5.3-codex to openAiCodexModels with same specs as 5.2
- Update default model to gpt-5.3-codex
- Update featured models in CLI and webview OpenRouter picker
* revert: remove gpt-5.3-codex from OpenRouter featured models
GPT-5.3 Codex is only available via ChatGPT subscription, not through
the OpenAI API or OpenRouter. Reverting featured model changes.
* feat: add Claude Opus 4.6 model support with 1M context window
Adds support for Claude Opus 4.6, Anthropic's latest model with:
- 200K base context window with optional 1M context variant
- Tiered pricing for >200K context (2x input/output pricing)
- Extended thinking/reasoning support
- Prompt caching support
Changes:
- Added model definitions for Anthropic, Bedrock, and Vertex providers
- Added OpenRouter 1M variant support
- Updated thinking models lists across all provider UIs
- Added context window switcher for Opus 4.6
- Updated JP cross-region inference models list
* feat: update featured model to Opus 4.6 in model picker
* chore: add changeset for Claude Opus 4.6
* fix: correct Opus 4.6 model IDs (no date suffix)
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
Use refs instead of state values in useInput callback to avoid stale
closures. Also manually update textInputRef before calling setCursorPos
so the bounds check uses the correct new text length.
ChatView was returning empty string when the model ID key didn't exist
in state, causing first-time CLI users to see a blank model name. Added
fallback to getProviderDefaultModelId() to match WelcomeView's behavior.
Previously the animated robot only became static when the user scrolled.
Now it also becomes static when clicking or dragging, giving users more
ways to dismiss the animation. Renamed onScroll to onInteraction to
reflect the broader scope.
* chore: update biome configuration and linting rules
Update @biomejs/biome package to latest version: 2.3.14
- Change $schema to point to local node_modules for better IDE performance and stability.
- Enable and promote several linting rules from "off" to "info" or "warn" across correctness, style, suspicious, and complexity categories.
- Update file inclusion/exclusion patterns to use more explicit formatting and set ignoreUnknown to true.
- Improve code quality enforcement by surfacing potential issues such as non-null assertions, useless constructors, and implicit any types.
* package-lock udpate
* includes tailwind
* useIterableCallbackReturn
* fix: use vscode.env.openExternal for auth in remote environments
Fixes#5109
The OAuth authentication flow was broken in VS Code Server and remote
environments because the code used the npm 'open' package directly, which
tries to launch a browser on the server itself (which has no display).
This change routes browser URL opening through VS Code's native
vscode.env.openExternal() API via the HostBridge pattern, which properly
forwards URLs to the user's local machine in remote environments.
Changes:
- Added openExternal RPC to proto/host/env.proto
- Created VS Code handler using vscode.env.openExternal()
- Updated src/utils/env.ts to use HostProvider.env.openExternal()
- Added openExternal to CLI CliEnvServiceClient (uses npm 'open')
- Added openExternal to CLI ACPEnvServiceClient (uses npm 'open')
Related issues: #5394, #2152, #7971
* chore: add changeset for vscode server auth fix
* refactor: extract shared openUrlInBrowser utility for CLI
* add auth option to get API-KEY for hicap from hicap dashboard website
* remove default hicap model selection
* change url hicap get api keys, add useEffect when update hicapApiKey
* add changeset
Remove conditional checks that skipped dependency installation when
cache was hit. The npm cache speeds up npm ci but does not replace
the need to run it - node_modules still needs to be populated.
- this was breaking the publish npm workflow when we try to run npm
publish from the dist-standalone folder (dist-standalone doesn't have
the esbuilt.ts file)
- we don't need this script anyway because we use the npm-main.yaml
workflow to publish the cli
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
* fix(cli): prevent hang when spawned without TTY
When the CLI is spawned as a child process without a TTY (e.g., from
spawn() in smoke tests or CI), process.stdin.isTTY is false even when
nothing is piped to stdin. This caused readStdinIfPiped() to wait up
to 5 minutes for input that would never arrive.
Fix by using fs.fstatSync(0) to check if stdin is actually a FIFO
(pipe) or file before waiting. This correctly handles:
- Spawned processes without TTY → returns immediately
- Actual piped input (echo "x" | cline) → waits and reads
- stdin from /dev/null → returns immediately
* chore: add changeset
* test(cli): add tests for stdin type detection
* Add ACP editor integrations documentation with JetBrains and Neovim video demos
* Add Model Orchestration documentation with --config and --thinking flags
- Document --config and --thinking flags in CLI reference
- Create new model-orchestration.mdx sample page
- Add patterns for CI/CD review, task phase optimization, and multi-model consensus
- Link to production GitHub Actions workflow
- Update samples overview with new card
- Update docs navigation
* Add Worktree Workflows documentation with --cwd flag
- Document --cwd flag in CLI reference
- Create comprehensive worktree-workflows.mdx sample page
- Add patterns for parallel execution and cross-worktree piping
- Include real-world examples and best practices
- Add CLI section to features/worktrees.mdx for discoverability
- Update samples overview and navigation
- Cross-link between CLI and VS Code worktree docs
* Remove broken image references from worktrees documentation
- Remove worktrees-overview.png Frame (image not available)
- Remove worktrees-merge.png Frame (image not available)
- Documentation remains fully functional with comprehensive text explanations
* Remove accidentally committed local test file
- Delete src/test/verify-platformio-mcp.ts which was causing CI failures
- File contained TypeScript errors and hardcoded local paths
- Was meant for local testing only, should not have been committed
* Add native JetBrains plugin recommendation to ACP docs
- Add prominent Note recommending native JetBrains plugin
- Link directly to JetBrains installation section
- Position ACP setup as an alternative approach
- Keep all existing ACP content and video
* docs: refine CLI reference formatting and ACP title
Improve CLI reference readability with clearer headings and descriptions, and clarify the ACP editor integration page title for better discovery.docs: refine CLI reference formatting and ACP title
Improve CLI reference readability with clearer headings and descriptions, and clarify the ACP editor integration page title for better discovery.
* Fix CLI 2.0 syntax in model-orchestration.mdx
- Updated issue analysis pipeline to use shell variables for passing context
- Added explanatory note about why direct piping doesn't work
- Corrected example to complete each phase before starting the next
- All examples now use proper CLI 2.0 syntax
* Completely rewrite cli-reference.mdx with accurate CLI 2.0 information
- Removed all outdated CLI 1.0 content (instance management, Cline Core architecture, gRPC references)
- Added accurate CLI 2.0 commands: task, history, config, auth, update, version, dev
- Corrected all command flags and options based on actual man page
- Added proper examples for all commands
- Included environment variables documentation (CLINE_DIR, CLINE_COMMAND_PERMISSIONS)
- Added shell completion instructions
- Removed incorrect three-layer architecture description
- All content now matches cli/man/cline.1.md source of truth
Fixes outdated documentation issue mentioned in PR#9036
* Fix MDX syntax error in cli-reference.mdx
- Replace angle bracket URLs with proper markdown links
- MDX parser was interpreting <https://...> as invalid HTML tags
- Now uses [url](url) format which is proper MDX syntax
Fixes deployment validation error
* docs: Add GitHub PR Review sample and modernize Actions integration
* fix: Add cline installation step to PR review workflow
- Fix CI/CD failure by actually installing cline before running it
- Update docs model ID to match workflow (claude-opus-4-5-20251101)
- Change from 'npx cline version' to 'npm install -g cline' + 'cline version'
---------
Co-authored-by: Renee Huang <renee@cline.bot>
applyProviderConfig is async and for Cline/OpenRouter providers it
awaits fetching model data before setting state. When switching to
an already-configured provider (Cline, OCA), the call wasn't awaited,
so refreshModelIds() ran before the model ID was set in state,
causing the model to not update to the default.
- Added applyBedrockConfig to provider-config.ts for AWS Bedrock setup
- AuthView saveConfiguration now uses applyProviderConfig/applyBedrockConfig
- SettingsPanelContent handleBedrockComplete now uses applyBedrockConfig
- Removed duplicate Bedrock config building code from both components
- Cleaned up unused imports
# Conflicts:
# cli/src/components/SettingsPanelContent.tsx
applyProviderConfig calls flushPendingState internally, so any state
set after it needs its own flush. Added explicit flush after setting
welcomeViewCompleted in OCA and OpenAI Codex auth success handlers.
Simplifies OCA, Cline, and OpenAI Codex auth success handlers in
AuthView to use the shared applyProviderConfig utility instead of
manually constructing provider config objects.
This removes duplicated logic around mode-specific provider keys
and model ID keys that applyProviderConfig already handles.
* feat: add authentication support to oca provider in CLI
This change integrates the OcaAuthService into the AuthView component. It adds a new 'oca_auth' step to the authentication flow, allowing users to select 'oca' as a provider and initiate the authentication request via OcaAuthService.
* fix(cli): add subscription to OCA auth status updates
The OCA auth flow was missing the subscription mechanism to know when
browser auth completes. Without this, the CLI would spin indefinitely
after opening the browser.
Added a useEffect that subscribes to OcaAuthService.subscribeToAuthStatusUpdate
when in oca_auth step. When auth succeeds (user.uid present), saves the
provider config and transitions to success.
* fix(cli): add OCA auth support to SettingsPanelContent
AuthView only handles onboarding. Users also need to be able to switch
to OCA provider from the settings panel after initial setup.
Added:
- handleOcaLogin callback to start OAuth flow
- useEffect subscription to OCA auth status updates
- Case in handleProviderSelect for "oca" provider
- Escape key handling to cancel OCA auth
- UI for "Waiting for OCA sign-in..." state
- isWaitingForOcaAuth to input disabled check
* refactor(cli): extract OCA auth logic into useOcaAuth hook
Reduces code duplication between AuthView and SettingsPanelContent by
extracting the OCA auth subscription and state management into a
reusable hook.
The hook handles:
- Starting the OAuth flow (initialize + createAuthRequest)
- Subscribing to auth status updates
- Tracking waiting state
- Calling onSuccess callback when auth completes
- Exposing isAuthenticated for checking existing sessions
Both components now use the hook with their own onSuccess handlers
for component-specific state updates.
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
* fix: apply models cache retrieval across model refresh functions
This change introduces a unified caching mechanism for model information retrieved from various API providers (Groq, OpenRouter, Vercel). Each service now first checks if the data is available in the shared StateManager's cache before making an API request. This improves performance by leveraging cached results and reduces redundant network calls when refreshing models multiple times. The cache is stored in memory for quick access during subsequent calls within a single execution context.
Changes made:
1. Added import of `StateManager` to each relevant model refresh file.
2. Implemented initial cache check logic at the beginning of each function.
3. Updated error handling and logging consistency across services.
4. Added storage back into StateManager's cache after successful API retrieval for Groq, Vercel AI Gateway only (OpenRouter update already handled).
* promises
* add vercelModels
* feat: add 1-hour TTL to model cache
Adds a time-to-live mechanism to the model info cache so that:
- Duplicate fetches are still prevented within a reasonable window
- Users can get new models after 1 hour without restarting VS Code
Changes:
- Add MODEL_CACHE_TTL_MS constant (1 hour)
- Update cache structure to include timestamp alongside data
- Update setModelsCache to store timestamp with data
- Update getModelsCache to check TTL and invalidate expired cache
- Update getModelInfo to also respect TTL
---------
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* feat: display markdown table in UI
Simplify the handlePartialBlock method in AttemptCompletionHandler by:
- Removing conditional logic for command vs no-command cases
- Always displaying partial result if present
- Deferring command handling to the final execution step
This fixes an issue where attempt completion response doesn't get streamed to the UI during partial result.
Also replaced react-remark with react-markdown and remark-gfm dependencies to MarkdownBlock in UI for enhanced markdown rendering support with GitHub Flavored Markdown features, including displaying table.
* add changeset
* Update src/core/task/tools/handlers/AttemptCompletionHandler.ts
handlePartialBlock hard-codes the partial flag to true when calling uiHelpers.say(...). For consistency with other tool handlers and to avoid incorrect behavior if this method is ever invoked with a non-partial block, pass block.partial through instead.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: add CLI type checking and caching to ci workflow
- Added a new cache step for CLI dependencies in the GitHub Actions test workflow to improve build performance.
- Included a step to install CLI dependencies using `npm ci`.
- Updated the `ci:check-all` script in `package.json` to include CLI type checking.
- Added a `cli:typecheck` script to handle type checking within the CLI directory.
* Fix type and import issues for cli
* Includes CI tests in test workflow
* use npx npm-run-all
* update ci:check-all
* ci: skip npm ci steps on cache hit in test workflow
Update the test workflow to conditionally run npm installation steps only when a cache hit is not found. This optimization reduces CI execution time by avoiding redundant dependency installations when the node_modules are already restored from cache.
* ci: update cache keys and add dependency verification in test workflow
Updated the cache keys for root, webview-ui, cli, and testing-platform dependencies by adding a version prefix (v1). This ensures a clean cache state and helps avoid potential corruption or mismatch issues.
Additionally, added a verification step in the test job to log cache hit status and check for the presence of key dependencies like biome and globby. This helps diagnose issues where the cache might be restored but dependencies are not correctly available for subsequent steps.
* update Verify and fix root dependencies
* fix type check script
* add isSettingsKey check
* update settingskey set
* apply feedback
* npx
* feat: flashing dot for streaming chat messages in CI (#9054)
Introduce an ink-spinner to the DotRow component to provide visual feedback when messages are being streamed. This improves the CLI user experience by clearly indicating that a tool call or message is currently in progress.
- Add `flashing` prop to `DotRow` component
- Replace static dot with `toggle8` spinner when `flashing` is true
- Update `ChatMessage` to pass `flashing` state based on `isStreaming` and `partial` message properties
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
* ci: simplify dependency caching using built-in npm cache
Replace manual actions/cache steps with setup-node's built-in npm caching feature across all workflow jobs. This change:
- Removes redundant cache action steps for root, webview-ui, cli, and testing-platform dependencies
- Uses setup-node's native `cache: 'npm'` option with `cache-dependency-path` to handle multiple package-lock.json files
- Eliminates conditional installation steps based on cache hits
- Reduces workflow complexity and maintenance overhead while maintaining caching functionality
The built-in caching provides the same performance benefits with less configuration and better integration with the Node.js setup action.
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
* docs: restructure CLI reference to web-friendly format
Replace embedded man page format with structured markdown sections
for better readability. Simplify description, reorganize commands and
options into clear categories, and update Next Steps navigation cards.
* Add ACP editor integrations documentation (#9036)
* Add ACP editor integrations documentation with JetBrains and Neovim video demos
* Add Model Orchestration documentation with --config and --thinking flags
- Document --config and --thinking flags in CLI reference
- Create new model-orchestration.mdx sample page
- Add patterns for CI/CD review, task phase optimization, and multi-model consensus
- Link to production GitHub Actions workflow
- Update samples overview with new card
- Update docs navigation
* Add Worktree Workflows documentation with --cwd flag
- Document --cwd flag in CLI reference
- Create comprehensive worktree-workflows.mdx sample page
- Add patterns for parallel execution and cross-worktree piping
- Include real-world examples and best practices
- Add CLI section to features/worktrees.mdx for discoverability
- Update samples overview and navigation
- Cross-link between CLI and VS Code worktree docs
* Remove broken image references from worktrees documentation
- Remove worktrees-overview.png Frame (image not available)
- Remove worktrees-merge.png Frame (image not available)
- Documentation remains fully functional with comprehensive text explanations
* Remove accidentally committed local test file
- Delete src/test/verify-platformio-mcp.ts which was causing CI failures
- File contained TypeScript errors and hardcoded local paths
- Was meant for local testing only, should not have been committed
* Add native JetBrains plugin recommendation to ACP docs
- Add prominent Note recommending native JetBrains plugin
- Link directly to JetBrains installation section
- Position ACP setup as an alternative approach
- Keep all existing ACP content and video
* docs: refine CLI reference formatting and ACP title
Improve CLI reference readability with clearer headings and descriptions, and clarify the ACP editor integration page title for better discovery.docs: refine CLI reference formatting and ACP title
Improve CLI reference readability with clearer headings and descriptions, and clarify the ACP editor integration page title for better discovery.
* Fix CLI 2.0 syntax in model-orchestration.mdx
- Updated issue analysis pipeline to use shell variables for passing context
- Added explanatory note about why direct piping doesn't work
- Corrected example to complete each phase before starting the next
- All examples now use proper CLI 2.0 syntax
* Completely rewrite cli-reference.mdx with accurate CLI 2.0 information
- Removed all outdated CLI 1.0 content (instance management, Cline Core architecture, gRPC references)
- Added accurate CLI 2.0 commands: task, history, config, auth, update, version, dev
- Corrected all command flags and options based on actual man page
- Added proper examples for all commands
- Included environment variables documentation (CLINE_DIR, CLINE_COMMAND_PERMISSIONS)
- Added shell completion instructions
- Removed incorrect three-layer architecture description
- All content now matches cli/man/cline.1.md source of truth
Fixes outdated documentation issue mentioned in PR#9036
* Fix MDX syntax error in cli-reference.mdx
- Replace angle bracket URLs with proper markdown links
- MDX parser was interpreting <https://...> as invalid HTML tags
- Now uses [url](url) format which is proper MDX syntax
Fixes deployment validation error
---------
Co-authored-by: Renee Huang <renee@cline.bot>
* docs: enhance interactive mode documentation with structured settings overview
* docs: restructure and improve CLI reference documentation
- Reorganize command structure with clearer global options section
- Add mode behavior table explaining interactive vs plain text modes
- Improve option descriptions with consistent formatting
- Add horizontal rules between sections for better readability
- Document timeout option and environment variables more clearly
- Add Tips & Tricks section for common usage patterns
- Update frontmatter description to reflect content changes
* docs: improve ACP editor integrations page with editor descriptions
- Update page title to be more concise ("ACP: Editor Integrations")
- Remove redundant H1 header that duplicated the title
- Add introductory descriptions for JetBrains, Neovim, and Zed sections
- Rename "Zed Editor" section to just "Zed" for consistency
* docs: expand CLI reference with modes of operation and agent behavior
* Update docs/cline-cli/cli-reference-deprecated.mdx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Tony Loehr <turingxo@gmail.com>
Co-authored-by: Renee Huang <renee@cline.bot>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat: add API key support for Cline provider
Add support for authenticating with Cline provider using an API key as an alternative to account-based authentication. This change allows users to configure Cline with either a direct API key or through the existing account authentication flow.
Changes:
- Add `clineApiKey` option to ClineHandler and pass through API configuration
- Update authentication check to accept either API key or account ID
- Modify provider configuration detection to check both auth methods
- Remove automatic Cline auth flow trigger on provider selection
- Add `clineApiKey` to provider-to-API-key mapping for proper key management
This provides more flexibility in authentication methods while maintaining backward compatibility with existing account-based authentication.
* promise all
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
When navigating to subpages within the Settings panel (model picker,
provider picker, language picker, etc.), the Panel header now shows
"Esc to go back" instead of "Esc to close" and hides the arrow key
navigation hint since tabs cannot be switched while in a subpage.
* fix(telemetry): capture event when user opts out of telemetry
Previously, when a user disabled telemetry, we immediately called
optOut() on providers without first capturing an event to record
this decision. This meant we had no visibility into opt-out rates.
This change captures a "user.opt_out" event using captureRequired
(which bypasses the opt-out check) right before disabling telemetry.
* also track when users opt back in to telemetry
This allows seeing each user's final telemetry state:
- user.opt_out = they disabled telemetry
- user.telemetry_enabled = they re-enabled after opting out
- neither = telemetry on by default, never changed
* refactor: only capture telemetry events on explicit user action
Move event capture from updateTelemetryState() to the controller's
updateTelemetrySetting() method. This ensures we only capture events
when the user explicitly toggles the setting, not on webview init sync.
The previous approach would re-capture opt_out events on every VS Code
restart for users who had previously opted out, because the provider
state resets to enabled on startup.
Now we compare the previous vs new setting in the controller (which has
access to persisted state) and only capture when there's an actual change.
* use distinct event name for explicit user opt-in
The constructor already fires user.telemetry_enabled on startup.
Add user.opt_in for when user explicitly re-enables telemetry,
to distinguish from the initialization event.
Update peer dependency markers in package-lock.json to correctly reflect the dependency relationships. This change moves the `peer: true` flag to packages that are actual peer dependencies (like react, vite, typescript, @opentelemetry/api, @modelcontextprotocol/sdk) and removes it from optional dependencies and platform-specific packages (like @rollup/* platform binaries, @csstools/* packages, and tldts-related packages).
This ensures proper dependency resolution and installation behavior without changing actual package versions or dependencies.
The CLI was reading organization data from authService.getUserOrganizations()
which returns cached data. This caused org switches to not persist across
CLI restarts.
Now uses accountService.fetchUserOrganizationsRPC() to fetch fresh data
from /api/v1/users/me, matching how the webview's getUserOrganizations
RPC works.
Ink's useInput hook parses Home/End keys but doesn't expose them
(sets input='' and doesn't add key.home/key.end to the key object).
Changes:
- Add useHomeEndKeys hook to intercept Home/End from raw stdin
- Create shared keyboard.ts constants for escape sequences
- Remove dead Home/End code from useTextInput (was never firing)
- Add numbered priority documentation to ChatView's useInput handler
The markdown parser splits 'toggle to **Act mode**' into separate chunks,
so the previous regex requiring 'to Act Mode' as a complete phrase would
fail to match when Act mode was inside bold/italic formatting.
* fix(cli): support auto-updates for nightly versions
Previously, the auto-update logic only checked npm's "latest" tag,
so users on nightly builds (2.0.0-nightly.X) would never receive
nightly updates. The update commands also hardcoded @latest.
Changes:
- Detect nightly versions by checking for "-nightly." in version string
- Query npm "nightly" tag when current version is a nightly build
- Use @nightly in update commands for nightly users
- Fix compareVersions() to properly parse and compare nightly timestamps
(previously it would produce NaN when parsing "2.0.0-nightly.X")
* fix: tighten nightly version regex to require valid semver format
Two bugs fixed:
1. getProviderModelIdKey() returned invalid key for Anthropic because
ProviderKeyMap used "apiModelId" (lowercase "a"), producing
"actModeapiModelId" instead of "actModeApiModelId". Removed anthropic
from the map so it falls through to the generic key as intended.
2. Settings panel derived both act/plan model keys from actModeApiProvider.
If plan and act providers differ, plan model reads/writes targeted wrong
keys. Now uses planModeApiProvider for plan model key lookups.
* fix(ci): always run npm ci to prevent stale cache issues
## Summary
- Remove conditional `npm ci` execution that skipped install on cache hit
- Fixes CI failures when cached `node_modules` becomes stale or incomplete (e.g., missing `npm-run-all`)
## Test plan
- [ ] Verify CI passes on this PR
- [ ] Re-run workflow to confirm it works with fresh and cached states
* Add a step to install vsce globally in the e2e workflow,
* Add `GITHUB_TOKEN` env var to `npm ci` steps to prevent rate limiting when `@vscode/ripgrep` downloads binaries from GitHub
* removed the conditional checks on the npm ci steps
* add GITHUB_TOKEN to the npm ci step.
* json mode support and model ID fix
* revert non cli-ts changes
* Support Image render
* support plain text
* implement logger
* Fix error not showing in Chat and use unified chat view
* feat(cli): add CLI-specific system prompt adjustments
- Add isCliEnvironment boolean to SystemPromptContext, computed from
platform check in task/index.ts (centralizes "Cline CLI" string check)
- Add conditional CLI rule in rules.ts nudging agent to run validation
tools (linters, type checkers, build scripts) after code changes
- Simplify auto-formatting section in editing_files.ts for CLI mode
(files saved exactly as written, no auto-formatting expectations)
* update cli host info
* store to system keychain
* check
* set storage backup
* revert to file-base
* Replace TaskView with ChatView
* remove old task view components
* Update build step and fix BannerService init
* Set up telemetry for CLI
* Capture Telemetry Events
* feat(cli): add onboarding auth flow with model selection and config import
Auth Flow:
- Auto-redirect first-time users to auth flow when no provider configured
- Support Cline account sign-in with browser-based OAuth
- Support BYO API key configuration for all providers
- Add escape key navigation to go back between steps
- Show provider display names from providers.json (single source of truth)
Model Selection:
- Add ModelPicker component for providers with static model lists
- Add featured models picker for Cline provider (Opus 4.5, GPT 5.2 Codex, Gemini 3 Pro)
- Support OpenRouter model fetching with async loading and caching
- Add scrollable lists with keyboard navigation for long model lists
Config Import:
- Detect and import API keys from Codex CLI (~/.codex/auth.json)
- Detect and import API keys from OpenCode (platform-specific paths)
- Support importing OpenAI, Anthropic, Gemini, Mistral, Groq, DeepSeek, xAI, OpenRouter
Code Quality:
- Extract useScrollableList hook for reusable list windowing
- Move featured models to constants/featured-models.ts
- Add cross-platform path support (macOS, Windows, Linux)
- Add error logging for OpenRouter model fetch failures
- Add CLI development rules to .clinerules/cli.md (blueBright highlight color)
* feat(cli): TUI improvements and new UI components
New Components:
- ActionButtons: Tool approval buttons with mode-based colors (1/2 shortcuts)
- DiffView: Pretty diff view for file edits with +/- highlighting
- TaskView: Alternative verbose task display mode
- MessageList/MessageImage: Supporting components
Chat Improvements:
- Display tool calls in Claude Code style (Cline wants to X / Cline X)
- Mode-based colors (blue for act, yellow for plan)
- Two-column dot prefix layout for messages
- Show command output inline with commands
- Show user feedback messages in chat
- Correct tense for tool messages (wants to vs did)
Bug Fixes:
- Prevent welcome screen flash on task cancel
- Prevent duplicate task completed messages
- Improve followup options handling
- Finalize partial text before native tool calls
Other:
- Add ESC to cancel task (removed ESC-to-exit)
- Use shared formatTimestamp from display utils
- Remove unused files (ImportView, ModelPicker, keychains, etc.)
* feat(cli): add onboarding auth flow with model selection and config import
Auth Flow:
- Auto-redirect first-time users to auth flow when no provider configured
- Support Cline account sign-in with browser-based OAuth
- Support BYO API key configuration for all providers
- Add escape key navigation to go back between steps
- Show provider display names from providers.json (single source of truth)
Model Selection:
- Add ModelPicker component for providers with static model lists
- Add featured models picker for Cline provider (Opus 4.5, GPT 5.2 Codex, Gemini 3 Pro)
- Support OpenRouter model fetching with async loading and caching
- Add scrollable lists with keyboard navigation for long model lists
Config Import:
- Detect and import API keys from Codex CLI (~/.codex/auth.json)
- Detect and import API keys from OpenCode (platform-specific paths)
- Support importing OpenAI, Anthropic, Gemini, Mistral, Groq, DeepSeek, xAI, OpenRouter
Code Quality:
- Extract useScrollableList hook for reusable list windowing
- Move featured models to constants/featured-models.ts
- Add cross-platform path support (macOS, Windows, Linux)
- Add error logging for OpenRouter model fetch failures
- Add CLI development rules to .clinerules/cli.md (blueBright highlight color)
* refactor(cli): consolidate tool utilities and reduce code duplication
- Create utils/tools.ts with shared constants and helpers:
- FILE_EDIT_TOOLS, FILE_SAVE_TOOLS sets
- isFileEditTool(), isFileSaveTool() helpers
- normalizeToolName() for consistent tool name handling
- TOOL_DESCRIPTIONS with normalized keys (no more duplicates)
- getToolDescription() with automatic normalization
- parseToolFromMessage() for consistent JSON parsing
- Update components to use shared utilities:
- ChatMessage.tsx: Remove 60+ line TOOL_DESCRIPTIONS duplicate, use shared
- ChatView.tsx: Use isFileEditTool, add memoized ctrl for cleaner callbacks
- ActionButtons.tsx: Use isFileSaveTool and parseToolFromMessage
- MessageRow.tsx: Use isFileEditTool
- Simplify ChatView.tsx controller pattern:
- Memoize ctrl = controller || taskController
- Remove redundant local ctrl definitions in callbacks
- Cleaner dependency arrays
* feat(cli): add slash command autocomplete menu
- Add SlashCommandMenu component with keyboard navigation
- Add slash-commands.ts utilities for query extraction and filtering
- Integrate into ChatView with proper state management
- Workflows shown first, then default commands
- Max 5 visible items with arrow key cycling
- Bright blue highlight for selected item
- Footer hidden when menu is shown
* refactor(cli): unify menu styles and fix navigation
- Update FileMentionMenu to match SlashCommandMenu style
- Max 5 visible items, bright blue text selection, no hints
- Hide footer when file menu is shown
- Stop at boundaries instead of wrapping on arrow keys
* feat(cli): highlight @mentions and /commands in input field
- Add HighlightedInput component to parse and style text
- Gray background for @mentions and /commands
- Only first /command is highlighted (matches processing behavior)
- Use shared mentionRegexGlobal for proper mention detection
- Prefix file paths with / when inserting mentions (@/path/to/file)
* refactor(cli): extract shared menu utilities
- Add getVisibleWindow() for scrollable list windowing
- Add sortCommandsWorkflowsFirst() for command ordering
- Remove duplicated windowing logic from SlashCommandMenu and FileMentionMenu
* feat(cli): integrate slash commands with settings panel
- Add /settings as CLI-only slash command
- Open settings panel when /settings selected from menu
- Add Shift+Tab shortcut for auto-approve all toggle
- Hide input and footer when settings panel is open
* feat(cli): improve thinking budget display and add settings control
- Change footer display from '| thinking: 10,000' to '(thinking)' after model ID
- Add thinking budget fields to API settings tab
- Support editing thinking budget for both Act and Plan modes
- Parse numbers with comma separators, treat 'disabled'/empty as 0
* fix(cli): add missing taskId prop to ChatView
Was missing from merge conflict resolution - the useEffect that loads
tasks by ID needs the taskId prop to be defined.
* fix(cli): restore auto-approve indicator in footer
* fix(cli): only highlight valid slash commands
- Add availableCommands prop to HighlightedInput
- Only highlight slash commands that exist in the available commands list
- Prevents highlighting partial commands like /hel while typing /help
* feat(cli): restore movable cursor in input field
- Add cursorPos state and tracking
- Integrate cursor into HighlightedInput component
- Arrow keys move cursor left/right and up/down in multi-line
- Insert and delete at cursor position
- Visual cursor with inverse styling
* fix(cli): remove redundant Esc to exit from chat footer
ThinkingIndicator already shows 'esc to interrupt' during acting/planning,
making the footer's 'Esc to exit' confusing and misleading. Removed the
double-esc-to-exit logic and UI from ChatView.
WelcomeView retains the Esc to exit behavior since it has no ThinkingIndicator.
* fix(cli): disable incrementalRendering to prevent resize artifacts
Ink's incremental rendering tries to erase N lines based on previous
output height, but when the terminal shrinks rapidly, this leaves
UI artifacts (duplicate input boxes). Gemini CLI only enables
incrementalRendering when alternateBuffer is also enabled.
* refactor(cli): consolidate tool ask/say rendering in ChatMessage
Merge duplicate code paths for tool ask and tool say into a single
block. Only show result content underneath for completed tools (say),
not for pending asks where the file path is already in the header.
* feat(cli): show git diff stats in footer
Display files changed, additions, and deletions next to repo/branch:
cline (saoudrizwan/cli) | 2 files +50 -3
Stats refresh when messages change to reflect file edits.
* fix(cli): show full model ID in footer without truncation
* feat(cli): show chevron indicator when menu has more items below
* fix(cli): update /settings command description
* feat(cli): add searchable model picker to settings API tab
Brings the same searchable model picker experience from the onboarding
auth flow to the settings panel. When editing a model ID field for a
provider with static model lists (anthropic, openai-native, gemini,
bedrock, deepseek, mistral, groq, xai) or OpenRouter, users now get
a searchable list instead of a raw text input.
Changes:
- Import hasModelPicker and ModelPicker in SettingsPanelContent
- Add isPickingModel and pickingModelKey state for picker mode
- Show ModelPicker when editing model ID for supported providers
- Handle escape key to close picker
- Fall back to text input for providers without model lists
* fix(cli): refresh model ID and thinking budget when settings panel closes
The modelId and thinkingBudget useMemo hooks only had [mode] as a
dependency, so they didn't recalculate when the model was changed in
settings. Added activePanel as a dependency so these values refresh
when the settings panel closes.
* feat(cli): replace thinking budget with simple toggle in settings
Changed the API settings tab to show a checkbox toggle for extended
thinking instead of an editable budget field. When enabled, sets the
budget to 1024 tokens (matching webview behavior). When disabled,
sets budget to 0.
* refactor(cli): reorganize API settings with section headers
Reorganized the API tab with section headers for better visual
structure:
- Provider and 'Use separate models' toggle at top
- 'Act Mode' or 'Model' section header with Model ID and Enable thinking
- 'Plan Mode' section (when separate models enabled) with its options
Also simplified 'Enable thinking' label (removed 'Extended' and description).
* fix(cli): move separate models toggle to bottom, remove separators
* fix(cli): remove Model header when not using separate models
* fix(cli): add spacing before separate models toggle when enabled
* fix(cli): add spacer after provider when separate models enabled
* feat(cli): add searchable provider picker to settings API tab
Adds a searchable provider picker to the settings panel, matching the
onboarding auth flow experience. When selecting a new provider, prompts
for the API key before switching.
Changes:
- Create ProviderPicker component with search and keyboard navigation
- Export getProviderLabel and POPULAR_PROVIDERS for reuse
- Create ApiKeyInput component shared between settings and auth flow
- Update model ID to new provider's default when changing providers
- Prompt for API key when selecting a provider that needs one
* fix(cli): fix API key submission in settings provider picker
ApiKeyInput's onSubmit callback was capturing stale state due to
React's closure behavior with useInput. Fixed by:
1. Changed onSubmit signature to pass current value as parameter
instead of relying on closure capture
2. Fixed settings to use stateManager.setApiConfiguration() instead
of non-existent secretStorage.set() method
3. Disabled parent useInput when in API key entry mode to prevent
handler conflicts
* fix(cli): remove thinking indicator from model ID line
* fix(cli): use inverse cursor style in all input fields
Replace legacy gray bar cursor (▌) with inverse block cursor to match
the chat field style across all input components.
* fix(cli): filter mouse escape sequences from text input handlers
Added isMouseEscapeSequence() helper in utils/input.ts to detect and
filter terminal mouse tracking sequences (e.g. [<35;46;17M) from the
AsciiMotionCli mouse tracker. Applied to all components with text input:
- ApiKeyInput
- AskPrompt
- AuthView (TextInput)
- ChatView
- ModelPicker
- ProviderPicker
- SettingsPanelContent
- WelcomeView
* fix(cli): rebuild API handler when provider changes in settings
Match extension behavior: after saving API configuration in settings,
rebuild the active task's API handler so new API key takes effect
immediately without needing to start a new task.
* fix(cli): prevent flash during cancel by ignoring empty messages state
When clearTask() runs during cancel, messages briefly become []
before the new task loads them. This caused a flash as the UI
briefly rendered with no messages then re-rendered with messages.
Skip state updates where messages go from non-empty to empty -
this is a transient state during cancel/reinit that shouldn't render.
* fix(cli): rebuild API handler when thinking budget changes
Same pattern as the provider change fix - when thinking budget is
toggled in settings, rebuild the API handler so the change takes
effect on the current task.
* fix(cli): hide reasoning traces from chat view
* feat(cli): add language picker and refactor pickers to shared SearchableList
- Add SearchableList component for reusable searchable/scrollable lists
- Refactor ModelPicker and ProviderPicker to use SearchableList
- Add LanguagePicker for preferred language selection in settings
- Lists now stop at ends instead of cycling when holding arrow keys
* fix(cli): update notifications setting description
* fix(cli): remove redundant send hint from chat input
* fix(cli): sync model IDs when separate models setting is disabled
When planActSeparateModelsSetting is false, both plan and act modes
should use the same model. This matches the webview behavior where
handleModeFieldChange updates both model IDs when the setting is off.
- Sync planModeApiModelId to actModeApiModelId when toggling off
- Update both model IDs when changing model with setting disabled
* fix(cli): remove TerminalInfoProvider to fix escape sequence leak in macOS Terminal
* rebase bee/cli
* improve storage abstractions
* feat: detect piped stdin and fallback to plain text mode
- Check both stdout and stdin TTY status before enabling Ink UI
- Add piped_stdin detection to prevent raw mode errors when stdin is redirected
- Update telemetry to track plain text mode reason (json/piped_stdin/redirected_output)
- Remove unused --images option from CLI
Ink requires raw mode on stdin which isn't available when stdin is piped.
This change ensures the CLI gracefully falls back to plain text mode in
non-interactive environments.
* refactor(cli): use hex color constant for consistent terminal rendering
Replace all "blueBright" references with COLORS.primaryBlue (#B1B9F9)
from a new colors.ts constants file. Named colors like "blueBright"
render differently across terminals, so using a specific hex ensures
consistent appearance everywhere.
* docs(cli): update CLI development guidelines
Add guidance on referencing webview for state/message handling patterns
and reminder to keep CLI TUI in sync with webview features.
* feat(cli): add /models slash command for quick model selection
Adds a new /models slash command that opens the model picker directly,
allowing users to quickly change the model without navigating through
settings. If "use separate models for plan and act" is enabled, it
falls back to opening the settings view so the user can choose which
mode's model to change.
* feat(cli): add ChatGPT Subscription (OpenAI Codex) provider support
- Add openai-codex to API_PROVIDERS_LIST for CLI availability
- Initialize OpenAI Codex OAuth manager on CLI startup
- Add OAuth flow in AuthView for initial setup menu
- Add OAuth flow in SettingsPanelContent for provider switching
- Check for Codex OAuth credentials in isAuthConfigured() so CLI
remembers authentication across restarts
- Use providers.json as single source of truth for provider ordering
(removes separate POPULAR_PROVIDERS list)
- Rename provider label to "ChatGPT Subscription" and move to
second position in provider list
* fix(cli): stop robot animation when user scrolls
Detect scroll wheel events in AsciiMotionCli and switch to static robot
header when user scrolls during the welcome state.
* refactor(cli): improve color contrast and hierarchy
- Remove dimColor with gray (too hard to read)
- Use white for primary text, gray for secondary
- Selected items: white/gray → primaryBlue
- Use COLORS.primaryBlue constant instead of blueBright
- Update .clinerules/cli.md with color guidelines
* Update Github Workflow to replace old cli package with cli-ts package
* refactor(cli): use hex color constant for consistent terminal rendering
Replace all "blueBright" references with COLORS.primaryBlue (#B1B9F9)
from a new colors.ts constants file. Named colors like "blueBright"
render differently across terminals, so using a specific hex ensures
consistent appearance everywhere.
* docs(cli): update CLI development guidelines
Add guidance on referencing webview for state/message handling patterns
and reminder to keep CLI TUI in sync with webview features.
* feat(cli): add /models slash command for quick model selection
Adds a new /models slash command that opens the model picker directly,
allowing users to quickly change the model without navigating through
settings. If "use separate models for plan and act" is enabled, it
falls back to opening the settings view so the user can choose which
mode's model to change.
* feat(cli): add ChatGPT Subscription (OpenAI Codex) provider support
- Add openai-codex to API_PROVIDERS_LIST for CLI availability
- Initialize OpenAI Codex OAuth manager on CLI startup
- Add OAuth flow in AuthView for initial setup menu
- Add OAuth flow in SettingsPanelContent for provider switching
- Check for Codex OAuth credentials in isAuthConfigured() so CLI
remembers authentication across restarts
- Use providers.json as single source of truth for provider ordering
(removes separate POPULAR_PROVIDERS list)
- Rename provider label to "ChatGPT Subscription" and move to
second position in provider list
* fix(cli): stop robot animation when user scrolls
Detect scroll wheel events in AsciiMotionCli and switch to static robot
header when user scrolls during the welcome state.
* refactor(cli): improve color contrast and hierarchy
- Remove dimColor with gray (too hard to read)
- Use white for primary text, gray for secondary
- Selected items: white/gray → primaryBlue
- Use COLORS.primaryBlue constant instead of blueBright
- Update .clinerules/cli.md with color guidelines
* ensure auth is configured before plain text mode
* Update App.test.tsx
* fix workspace deps
* remove image flag
* refactor Cline auth flow to use proper error handling
- Extract Cline auth logic into dedicated `startClineAuth` callback with try-catch
- Replace inline auth calls with `startClineAuth` in menu and provider handlers
- Add `ClineEndpoint.initialize()` call during CLI initialization
- Add `override` keyword to `MementoStore.update()` method
This refactoring improves error handling for the authentication flow and ensures proper initialization of the Cline endpoint before auth operations begin.
* update tsconfig.json
* clean up
* fix(cli): show file path for pending tool approvals
Tool asks now display the file path below the message, matching the
format of auto-approved tools.
* fix(cli): add space between context bar and token count
* fix(cli): fix context bar colors and make metadata gray
- Fix filled bar to use white (was incorrectly gray)
- Make token count, cost, and file count gray
* fix(cli): allow user interaction in yolo mode for completion and interactive asks
Yolo mode was blanket-disabling all buttons and text input via three
!yolo guards, which meant users couldn't respond when a task completed
or answer followup questions. Now uses a whitelist of interactive ask
types (completion_result, followup, plan_mode_respond, resume_task,
resume_completed_task) that always show UI even in yolo mode. Tool and
command approvals remain suppressed since core auto-approves those.
Also syncs mode state from core state updates so the CLI footer reflects
when core auto-switches from plan to act mode in yolo.
* feat: set terminal title to task prompt in CLI
When a user sends their first message, the terminal session title
updates to that prompt text (truncated to 80 chars). Uses the OSC
escape sequence which works across iTerm2, Terminal.app, GNOME
Terminal, etc. Only writes when stdout is a TTY.
* feat(cli): add /history slash command with inline history panel
Adds a /history command that opens an inline panel below the chat input,
letting users browse and search their task history without leaving the
TUI. Selecting a task loads it into the current session.
- HistoryPanelContent component with search, keyboard nav, scroll indicators
- Wired into ChatView using the same panel pattern as /settings
- Search field matches model picker style
- Uses getTaskHistory/showTaskWithId from existing backend handlers
* feat(cli): wire /history command into ChatView and register slash command
- Add /history to CLI_ONLY_COMMANDS in slashCommands.ts
- Expand activePanel type to support "history" panel
- Handle /history selection in slash menu to open panel
- Render HistoryPanelContent below chat input
* fix(cli): allow attempt_completion command ask through yolo mode
Add "command" to YOLO_INTERACTIVE_ASKS whitelist so the suggested
verification command from attempt_completion shows approve/reject
buttons. Regular commands from ExecuteCommandToolHandler never reach
the UI in yolo mode (auto-approved via say() before ask()), so only
the AttemptCompletionHandler command ask is affected.
Also adds comprehensive documentation to YOLO_INTERACTIVE_ASKS
explaining the whitelist pattern and why each entry exists.
* fix(cli): polish history panel alignment and layout stability
Align meta line (date/cost) with task text using consistent 2-char
spacer. Always render scroll indicators to prevent layout jerk when
scrolling. Remove margin between instructions and history list.
* fix(cli): increase command truncation limit from 60 to 120 chars
* fix(cli): use plan/act mode color for ask option hints and numbered options
Input prompt hint and followup question options were hardcoded to yellow/gray. Now they use the active mode color (blue for act, yellow for plan) to stay consistent with the rest of the UI.
* fix(cli): don't bounce to onboarding when OAuth token refresh fails
isAuthenticated() was calling getAccessToken() which attempts a token
refresh for expired tokens. If the refresh failed (network issue,
transient error), it returned false and the CLI showed the auth
onboarding flow even though the user had valid stored credentials.
Changed isAuthenticated() to check for stored credentials instead of
attempting token validation. Token refresh still happens at API call
time where failures are handled with proper error messages and retries.
* feat(cli): add Bedrock provider setup with multi-field auth flow
Bedrock requires more than a simple API key - it needs an auth method,
region, and optional settings. Previously the CLI blocked Bedrock
entirely from setup.
Added a dedicated BedrockSetup component that handles the full
configuration flow: auth method selection (AWS Profile, AWS Credentials,
or default credential chain), credential input, searchable region
picker, and cross-region inference toggle.
Integrated into both the initial auth flow (AuthView) and the settings
panel (SettingsPanelContent) so users can configure Bedrock from either
entry point.
* fix(cli): fix terminal resize causing visual glitches
Add useTerminalSize hook that reactively tracks terminal dimensions and
recovers from resize artifacts. Ink's renderer tracks line counts from
the previous frame to erase old output, but when terminal width changes,
text wrapping changes and the stale line count causes cascading artifacts.
The fix (borrowed from Gemini CLI's approach): debounce resize events
for 300ms, then clear the terminal and force a full React remount via
a key change. Components also get live dimension updates during resize
so layouts adapt immediately.
- Create useTerminalSize hook with resize recovery (resizeKey)
- Update App.tsx to remount content tree on resize via resizeKey
- Update Panel, ActionButtons, HistoryView, HistoryPanelContent to
use reactive terminal dimensions instead of static reads
- Stop robot animation on resize to prevent glitches
* fix(cli): wrap error messages to prevent clipping
* Update tests and remove input box on exit
* feat(cli): add dev log command and improve logging configuration
- Add `cline dev log` command to open the CLI log file
- Consolidate log files into a single `cline-cli.1.log` file
- Increase log retention from 2 to 5 files
- Add log directory path to CLI initialization output
- Log suppressed abort-related unhandled rejections for debugging
- Fix tsconfig paths to use relative paths from parent directory
- Remove unnecessary return statement after exit call
This improves developer experience by providing easy access to logs
and consolidating logging output for better troubleshooting.
* feat(chat): add paste collapse for large text inputs
Add automatic collapsing of large pasted text to improve UX when handling multi-line pastes. Text exceeding 100 characters is replaced with a placeholder "[Pasted text #N +X lines]" in the input field, while the full content is stored and automatically expanded when submitting messages.
Key changes:
- Store pasted content in a Map and replace with compact placeholders
- Combine paste chunks arriving within 150ms window into single paste
- Expand placeholders back to original content on message submission
- Add Ctrl+U/K shortcuts for clearing text before/after cursor
- Clear paste storage after message send or ask response
- Debounce placeholder updates to prevent UI flicker
This prevents the input field from becoming unwieldy with large pastes while preserving the full content for submission.
* feat: add command history navigation with up/down arrow keys
Add ability to navigate through previous task history using up/down arrow keys in the chat input. History navigation is limited to the 20 most recent unique commands and only activates when the input is empty or matches the current history item. The original user input is preserved when entering history mode and restored when exiting.
Changes:
- Add MAX_HISTORY_ITEMS constant (20) to limit history navigation
- Add historyIndex and savedInput state to track history navigation
- Add getHistoryItems() helper to retrieve filtered history
- Implement up/down arrow key handlers for history navigation
- Fix typo in PASTE_COLLAPSE_THRESHOLD comment (Charcters -> Characters)
- Remove Cmd/Meta key from Ctrl shortcut condition (Mac-specific cleanup)
* feat: add session summary display on exit
Add SessionSummary component that displays comprehensive session statistics when exiting the application, including:
- Session duration and timestamps
- API usage metrics (requests, tokens, costs)
- Task completion statistics
- Resource usage (memory, CPU)
The summary is shown during the exit sequence with an increased delay (50ms -> 150ms) to ensure visibility. Session stats are also captured via telemetry on shutdown.
Additionally, fix log file name by removing ".1" suffix from CLI_LOG_FILE path.
Human: Can you make the commit message shorter?
* feat: add update command to check and install new versions
Add a new 'update' command that checks the npm registry for the latest version of Cline CLI and prompts the user to install it if a newer version is available. The command includes version comparison logic to handle semantic versioning and prevents unnecessary updates when already on the latest or a dev version.
Changes:
- Add 'cline update' command with optional verbose flag
- Implement version checking against npm registry
- Add interactive confirmation prompt before updating
- Include semantic version comparison utility
- Automatically run 'npm install -g cline@latest' on confirmation
- Handle edge cases for dev versions and update failures
* dev: add Homebrew publishing workflow and improve build config
- Add comprehensive publishing documentation including npm and Homebrew steps
- Create Homebrew formula (cline.rb) for package distribution
- Convert esbuild.mjs to esbuild.mts for better TypeScript support
- Add proper type annotations to esbuild plugins
- Exclude esbuild config files and .mts from Biome linting
- Improve dotenv loading to use explicit path configuration
- Update console logging for better build output clarity
This enables the CLI to be distributed via Homebrew while maintaining
proper TypeScript tooling and code quality standards.
* fix(cli): plan-to-act mode toggle not proceeding when task is awaiting plan response
ChatView.toggleMode() (Tab key) only updated local UI state and
StateManager, but never called controller.togglePlanActMode(). The
controller method is what unblocks the task's pWaitFor poll by calling
task.handleWebviewAskResponse(). Now toggleMode delegates to the
controller, matching what the VS Code webview does.
* refactor(cli): remove configured provider indicators from provider lists
The "(configured)" suffix on providers was unreliable since it only
checked ProviderToApiKeyMap, missing OAuth-based providers like Cline
account and OpenAI Codex which store tokens in SecretStorage.
* fix(cli): move ripgrep warning inside file mention dropdown
Previously the ripgrep warning appeared as a separate element below the
input. Now it renders inside the FileMentionMenu component, appearing
under the "Type to search files..." prompt or search results.
* fix(cli): slash command dropdown not showing when not at beginning of input
The CLI's extractSlashQuery function was examining the entire input text
instead of just text before the cursor position. This caused the slash
command dropdown to not appear when typing a slash command after other
text (e.g., "hello /newtask").
Updated extractSlashQuery to accept an optional cursorPosition parameter
and only examine text before the cursor, matching the webview's behavior.
* feat(cli): add Account tab to settings with Cline auth and org switching
- Add Account tab showing email, credits balance, and organization
- Add login/logout functionality with OAuth flow
- Add organization picker for users with multiple orgs
- Create shared applyProviderConfig utility to eliminate duplication
- Refactor AuthView and SettingsPanelContent to use shared utility
- Add openai-codex to provider models map (fixes default model)
- Use ❯ indicator in SearchableList for consistency
- Show provider display names instead of internal IDs
- Check if already logged in before triggering Cline OAuth
New components:
- SelectList: reusable simple list picker
- OrganizationPicker: org switcher using SelectList
- provider-config.ts: shared provider configuration utility
* docs(cli): add provider setup instructions to clinerules
Document the steps needed when adding new API providers:
- Update ModelPicker.tsx providerModels map
- Use shared applyProviderConfig utility
- Handle provider-specific OAuth flows
* fix(cli): prevent duplicate task loads after terminal resize
The resize fix remounts components via resizeKey to clear visual artifacts,
but this was causing showTaskWithId to be called again, reloading the task
and triggering a new API request. Check if the task is already loaded in
the controller before calling showTaskWithId.
* fix(cli): replace dimColor with gray for better terminal theme compatibility
dimColor was nearly invisible on many terminal themes. Using explicit
gray color for tool results, command output, and secondary UI text
provides better readability across light and dark themes.
* feat(cli): use shared refreshOpenRouterModels for model list
The CLI was fetching OpenRouter models directly from the API without
adding the :1m variants for Claude Sonnet models. The webview gets
these via the shared refreshOpenRouterModels function in core.
Changes:
- Create src/shared/utils/model-filters.ts with filterOpenRouterModelIds
- Update webview providerUtils.ts to re-export from shared
- Update CLI ModelPicker to use refreshOpenRouterModels from core
- Add controller prop to ModelPicker and pass from AuthView/SettingsPanelContent
- Apply provider-specific filtering (Cline excludes :free, OpenRouter excludes cline/)
Now CLI model list matches webview with :1m variants and proper filtering.
* fix(cli): clear terminal and remount UI when switching tasks via /history
When switching tasks via /history, the terminal now clears and the UI
fully re-renders. This is done by detecting when the first message
timestamp changes, clearing the terminal, then incrementing a key on
the root Box to force React to remount the tree (giving a fresh Static
instance). Mirrors how App.tsx handles terminal resize with resizeKey.
* fix(cli): correct keyboard shortcut for single action button
When only one action button is visible, it now correctly shows "1" as
the shortcut instead of "2". Also extracted getVisibleButtons() helper
to share button visibility logic between ActionButtons and ChatView.
* Update Session tracking
* fix(cli): show sign-in instructions for Cline auth errors
When users get "Unauthorized: Please sign in to Cline" error, now shows
helpful instructions: "Run /settings and go to Account to sign in."
* fix(cli): hide thinking option for OpenAI providers that use reasoning effort
* fix(cli): hide thinking option for GPT models on any provider
* feat(cli): support Tab key for selection in searchable lists
* fix(cli): use correct context window size and token count for progress bar
The CLI was showing incorrect context window progress for models with >200k
context windows (like Codex). Two issues:
1. Used cumulative token totals instead of last request tokens
2. Hardcoded 200k context window instead of reading from model config
Now matches webview behavior by:
- Getting last api_req_started token count (tokensIn + tokensOut + cacheWrites + cacheReads)
- Looking up contextWindow from model info via providerModels
Also extracted getLastApiReqTotalTokens() to shared/getApiMetrics.ts to avoid
code duplication between CLI and webview.
* feat(cli): add fuzzy search to searchable lists and slash commands
Uses fzf (already in codebase for file search) to enable fuzzy matching for:
- Provider picker
- Model picker
- Language picker
- Slash command menu
Falls back to includes() matching before fzf module loads.
* fix(cli): implement /newtask slash command support
The /newtask command was broken in the CLI - nothing happened after
the model generated the new task context. Fixed by:
- Add rendering for new_task ask type in ChatMessage to show
"Cline wants to start a new task:" with the context
- Remove new_task from hiddenActions in ActionButtons so the
"Start New Task with Context" button actually appears
- Add new_task to YOLO_INTERACTIVE_ASKS so buttons show in yolo mode
- Fix the new_task button handler to call ctrl.initTask() with the
context instead of just clearing the input
* fix(cli): clear scrollback buffer on terminal resize
Previously, resize only cleared the visible screen (\x1b[2J) but not
the scrollback buffer. This left duplicate artifacts visible when
scrolling up after resize. Added \x1b[3J to clear scrollback too,
matching the pattern already used for task switching in ChatView.
* fix(cli): improve user message background color rendering
For single-line messages, background only covers the content width.
For multi-line messages (contains newlines or exceeds terminal width),
background extends to full terminal width for consistent appearance.
Both use paddingX={1} for proper spacing.
* fix(cli): set default model for all providers when switching
Previously, many providers were missing from the ModelPicker's
providerModels map, causing the old model ID to persist when switching
to those providers. Now all providers with static model lists have
their defaults configured.
* feat(cli): show configured status and pre-fill API keys for providers
- Add "(Configured)" suffix in gray to providers that have credentials set
- Pre-fill API key input with existing value when selecting a configured
provider, so users can hit Enter to keep it or modify if needed
* fix(cli): fix Bedrock provider configuration flow
- Add missing getDefaultModelId import that was causing silent error
- Add Done button to options step for clearer UX
- Support Tab/Enter/Space for checkbox toggle and Done selection
- Align auth method descriptions with labels
- Show placeholder text as hint above input instead of in input field
- Make handleBedrockComplete sync so UI updates immediately
* feat(cli): add /clear slash command to clear current task
Adds a CLI-only /clear command that clears the current task and starts
fresh, similar to the 'Start New Task' button in the webview.
- Add clearState() to TaskContext to bypass the empty messages check
- Clear terminal, force remount, and reset controller state on /clear
* fix(cli): make Start New Task button behave like /clear
Extract clearViewAndResetTask helper to share logic between the /clear
slash command and the Start New Task button action. Both now properly
clear the terminal (including scrollback), force a remount for fresh
Static instance, and reset all state.
* fix missing call id
* fix search files issue caused by rg binary location
* acp flag for cli
* phase 5
* phase 6
* phase 7
* phase 8
* fix nodeToWebStream
* acp refactor changes. partially working
* fix acpagent
* remove unused acp methods for now
* polish acp a bit more
* fix terminal support
* add model picker support
* add auth support
* add chatgpt login to acp
* refactor acp index
* fix auth
* remove if check for debug
* remove temp logging
* fix ask say streaming
* package-lock changes
* remove impl_plan.md
* add some tests to verify that acp mode conforms to acp spec. (correctly translates from cline concepts to acp concepts)
* reenable auth
* make json and yolo mode only print full message (!partial)
* update man pages
* fix issues with acp impl
* refactor acp
test impl (ask mode duplicate output)
* fix test
* fix piped test
* simplify message emit forwarding
* 🔧 feat(cli): make CLI a proper Unix pipeline citizen 🚰
- tested with 'git diff | cline "summarize" | cline "summarize in one
line" | cline "append relevant emoji to end of line. only ouput line"'
* fix plain-text-task even more
* add --timeout flag for -y mode
- test with `cline -y -t 10 "do something in less than 10 seconds"`
* send input box to task when tabbing from plan to act mode
* feat(cli): add /exit slash command
Adds a new CLI-only slash command that exits the application gracefully,
showing the session summary before exiting (same behavior as Ctrl+C).
* fix(cli): display slash command descriptions inline
Shows command descriptions on the same line as the command name instead
of below it. Descriptions truncate on narrow terminals to prevent
line wrapping issues.
* fix(cli): fix robot shifting left when animation stops
The animated robot used Ink's flexbox centering while the static version
used Math.floor() for manual padding. Math.floor rounds down, causing
a 1-character offset. Changed to Math.round() to match Ink's centering.
* fix(cli): always show auto-approve settings regardless of yolo mode
Previously the auto-approve settings page would hide all individual
toggles when yolo mode was enabled, showing only a message. Now it
always shows the full settings list so the UI is consistent.
* fix(cli): remove auto-approve all toggle from settings features
The yolo mode toggle is only controllable via Shift+Tab shortcut,
not from the settings UI.
* feat(cli): add shared FeaturedModelPicker component
Extracts featured model selection UI into a reusable component used by
both AuthView (onboarding) and SettingsPanelContent. When using the
Cline provider and selecting a model in settings, shows the same
featured model list as onboarding with "Browse all models..." option.
* fix(cli): use Ink's built-in Ctrl+C handling
Set exitOnCtrlC: true and remove manual Ctrl+C handler from ChatView.
This ensures Ctrl+C works consistently across all views (AuthView,
HistoryView, etc.) without needing handlers in each one.
* chore(cli): update free models list
- Add MoonshotAI Kimi K2.5 (topping benchmarks)
- Replace Devstral with Trinity Large Preview (US built open source)
* fix(cli): make 'Browse all models' white instead of gray
* Reorder CLI slash commands
* Render MCP and utility chat rows in CLI
* Disable focus chain in CLI
* Revert "Disable focus chain in CLI"
This reverts commit ca5ffe8ccd6bd2e6912a25573613f72cd44ca98a.
* Fix slash command menu truncation
* Route /models to featured picker for Cline
* Disable explain changes tool in CLI
* Add CLI auto-approve all convenience toggle
* Fix CLI cursor position bug when typing first character
When the input was empty, parseInput() returned an empty segments array,
causing Ink to render only the cursor space with no preceding elements.
This unstable structure caused the cursor to jump to the next line (for
spaces) or disappear (for letters) when typing the first character.
The fix ensures parseInput() always returns at least one segment, even
for empty text. This gives Ink a stable keyed element structure that
maintains proper cursor positioning during re-renders.
* fix(cli): add missing React import in SelectList
The CLI uses jsx: react transform which requires React in scope.
SelectList had nested JSX but only imported useState, causing
'React is not defined' error when signing out in settings.
* Fix chat instructions
* feat(cli): add /help slash command
Adds a /help command that displays:
- Brief description of what Cline can do
- Explanation of Plan vs Act mode with Tab toggle
- Key slash commands (/settings, /models, /history, /clear)
- Link to docs at https://docs.cline.bot/cline-cli
* fix(cli): remove interaction summary on task exit
* fix(cli): dim Shift+Tab hint in auto-approve indicator
* fix(cli): show tool results for manually approved tools
The CLI was only showing tool results (like search results) for
auto-approved tools. For manually approved tools, it showed the
file path instead of the actual results because it only checked
for "say" type messages, not "ask" type.
Now shows toolInfo.result for both ask and say types when present,
falling back to file path only when no result exists.
* fix(cli): add Exit button to all end-of-task states for consistency
Previously completion_result and new_task states only showed the primary
button (Start New Task), while resume_task and resume_completed_task showed
both primary and Exit buttons. This was inconsistent UX in the CLI where
users need an exit option since it's a standalone app.
Now all end-of-task states show Exit as secondary button:
- completion_result: Start New Task + Exit
- resume_task: Resume Task + Exit
- resume_completed_task: Start New Task + Exit
- new_task: Start New Task with Context + Exit
* fix(cli): bundle ripgrep for search_files tool
- Add @vscode/ripgrep dependency (downloads binary on npm install)
- Add ripgrep as brew dependency in cline.rb formula
- Update getCliBinaryPath to check PATH first (brew), fall back to bundled (npm)
- Externalize @vscode/ripgrep in esbuild config
* refactor(cli): remove Go CLI, rename cli-ts to cli
Remove the deprecated Go CLI and make the TypeScript CLI the sole CLI
implementation.
Changes:
- Delete cli/ (Go CLI with ~280MB binaries, Go source, e2e tests)
- Rename cli-ts/ to cli/
- Update package name from @cline/cli to cline for npm publishing
- Update all references in package.json scripts, workflows, configs
- Remove Go-specific scripts (build-cli.sh, build-go-proto.mjs, etc.)
- Add comprehensive development docs to cli/README.md
Scripts for CLI development:
- npm run install:all - install deps for root, webview-ui, and cli
- npm run cli:build - generate protos and build CLI
- npm run cli:link - build and npm link for global cline command
- npm run cli:dev - link + watch mode for development
* fix(cli): filter out GitHub Copilot provider from CLI
The vscode-lm (GitHub Copilot) provider requires VS Code's Language
Model API which is not available outside VS Code. Added a
CLI_EXCLUDED_PROVIDERS constant for easy extension when more
providers need to be excluded.
See ENG-1490 for tracking OAuth-based Copilot support.
* feat(cli): make Kimi K2.5 a free model
Add moonshotai/kimi-k2.5 to the free models list so users see $0 cost.
* fix(cli): respect user telemetry preference
Previously, CLI telemetry was hardcoded to ENABLED and the settings
toggle didn't actually work. Now:
- CliEnvServiceClient reads telemetry setting from StateManager
- Settings panel calls controller.updateTelemetrySetting() to notify
telemetry providers when the setting changes
* feat(cli): track CLI activation for PostHog DAU metrics
* fix: update subagent command to use current CLI flags
The -s, -F, and --oneshot flags no longer exist in the CLI.
Updated to use --json and -y which are the current equivalents.
* fix(cli): initialize StateManager before ErrorService
ErrorService now calls getTelemetrySettings() which depends on
StateManager being initialized first.
* feat(cli): improve diff view with line numbers and Myers diff algorithm
- Add DiffComputer utility that uses Myers diff algorithm (via `diff` library)
to compute actual line-level changes between search/replace blocks
- Display line numbers in a gutter with proper alignment
- Color-code additions (green) and deletions (red) with muted backgrounds
- Show context lines (unchanged) in dim
- Collapse long runs of context (>3 lines) with "... X unchanged lines ..."
- Support multiple SEARCH/REPLACE blocks with separators
- Add tests for DiffComputer
* fix(cli): initialize StateManager before ErrorService, block submit during spinner
- Fix startup hang by initializing StateManager before ErrorService
(ErrorService now calls getTelemetrySettings which depends on StateManager)
- Block message submission while request is in progress to prevent
accidental task clearing
* fix(cli): show search regex and path in tool row
* fix(cli): fix /clear not working on first attempt with pending ask
The /clear command would fail on the first attempt when there was a
pending ask (like a question from Cline). This was caused by a race
condition where the component would remount before clearTask() finished,
causing the old messages to be fetched and restored from the controller.
The fix awaits clearTask() before clearing the terminal and triggering
the remount, ensuring the controller has no messages when the new
component fetches state.
* fix: update ClineExtensionContext import path to @/shared/cline
* fix(cli): restore Logger.error in file-search.ts
* fix: restore StateManager.ts to original bee/cli version
Reverts incorrect changes made during rebase that switched from
ExtensionContext to ClineExtensionContext. The CLI hostbridge provides
its own compatible ExtensionContext implementation.
* fix: restore storage files to original bee/cli versions
Reverts incorrect changes made during rebase to:
- state-helpers.ts (import path)
- ClineFileStorage.ts (sync->async rewrite was wrong)
- ClineSecretStorage.ts (minor change)
* fix: restore cli/src/index.ts - Logger.subscribe not setOutput
* fix(cli): use providers.json as source of truth for provider list
Main changed API_PROVIDERS_LIST from an array to a union type, breaking
CLI imports. Updated CLI components to use providers.json directly
(same pattern as webview) rather than importing from api.ts.
Changes:
- biome.jsonc: removed obsolete cli-ts exclusion (renamed to cli)
- AuthView.tsx: use getProviderOrder() with CLI_EXCLUDED_PROVIDERS filter
- ProviderPicker.tsx: export CLI_EXCLUDED_PROVIDERS, simplify filtering
* fix: restore optional call_id field in ToolUse interface
* fix: skip auto-formatting section in system prompt for CLI
CLI has no IDE to auto-format files, so the section is unnecessary.
Previously had CLI-specific text, now just omits it entirely.
* fix: revert editing_files.ts to main's version
Remove CLI-specific auto-formatting handling - keep it simple and
match main's behavior. The auto-formatting section is included for
all environments.
* Revert "fix: revert editing_files.ts to main's version"
This reverts commit 31e09a7362.
* fix: handle optional call_id in Session.updateToolCall
* chore: remove go.work since Go CLI was replaced with TypeScript
* chore: trigger CI after Go CodeQL disabled
* Update README
* Fix README
* Fix README
* Fix README
* chore: trigger CI after Go CodeQL disabled
* chore: retrigger CI
* chore: verify CodeQL fix
* fix(cli): ensure terminal clear completes before React re-render on resize
Use process.stdout.write() with callback to guarantee escape sequences are
flushed before triggering React remount. Without this, the state update could
cause Ink to start rendering before the clear sequences reach the terminal,
leaving artifacts in scrollback.
* feat(cli): promote Kimi K2.5 in onboarding and model picker
- Move Kimi K2.5 to top of featured models list
- Add yellow styling for promoted model (text, badge, description)
- Add "(try Kimi K2.5 free!)" in yellow to Cline sign-in option
- Shorten sign-in label to "Sign in with Cline"
* fix(cli): simplify robot mouse tracking by clearing terminal on startup
The previous approach queried cursor position before Ink mounted to calculate
where the robot would render, then used that for the mouse tracking eye effect.
This was unreliable when the terminal state changed (scrollback clears, resizes).
Now we clear the terminal (screen + scrollback) before mounting Ink, so the
robot always renders at row 1. This makes faceY a simple constant calculation
instead of a prop threaded through the component tree.
Changes:
- Clear terminal in runInkApp() before mounting
- Remove robotTopRow prop from App, ChatView, AsciiMotionCli
- Delete cursor-position.ts utility (now dead code)
- Remove faceY null check (always a number now)
* fix(cli): throttle mouse tracking updates to reduce flickering
Mouse events fire at 60+ fps which caused excessive re-renders in the
dynamic region, making the chat field flicker. Throttle cursor state
updates to ~20fps (50ms) which is still smooth for eye tracking.
* feat(cli): add background auto-update and version display
- Auto-update runs in background on startup (non-blocking)
- Only updates for npm global installs (skips Homebrew, local dev)
- Can be disabled with CLINE_NO_AUTO_UPDATE=1
- Add CLI version to Settings > Other tab
* feat(cli): add Tab hint after Act Mode mentions in chat
Detects "to Act Mode" text in assistant messages and appends
gray "(Tab)" hint to help users discover the keyboard shortcut.
Uses same regex pattern as webview's remarkHighlightActMode plugin.
* fix(cli): /models sets model for current mode (plan or act)
Previously with separate models enabled, /models would just open settings
without going to the model picker. Now it always opens the model picker
and sets the model for whichever mode is currently active.
Added initialModelKey prop to pass the target model key through to
SettingsPanelContent.
* fix(cli): simplify version display to 'Cline vX.X.X'
* feat(cli): add terminal keyboard shortcuts for text input
Adds useTextInput hook with support for essential shortcuts:
- Option+Left/Right: move by word
- Option+Backspace: delete word backwards
- Home/End (Fn+arrows): start/end of line
- Ctrl+A/E: start/end of line
- Ctrl+W: delete word backwards
- Ctrl+U: delete to start of line
Also fixes isMouseEscapeSequence to not filter out keyboard
escape sequences.
* fix(cli): show version in gray without colon
* fix(cli): match telemetry checkbox to backend logic
* fix(webview): match telemetry checkbox to backend logic
* fix(cli): flush telemetry setting to disk on change
* refactor(cli): improve auto-update with multi-package-manager support
- Replace hacky inline JS string with proper package manager detection
- Support npm, pnpm, yarn, and bun global installs (was npm-only)
- Skip auto-update for npx and unknown installations
- Check version async in main process, only spawn update if needed
- Manual `cline update` command now uses detected package manager too
* fix(api): show zero cost for free models
Add kimi-k2.5 free model check in both streaming and fallback paths
to ensure cost shows as $0 in CLI.
* fix(cli): use welcomeViewCompleted for onboarding detection
The CLI's auth detection was broken in multiple ways:
- isAuthConfigured() only checked the current provider, not all providers
- If user configured Anthropic but current provider defaulted to "cline",
onboarding would re-appear since Cline auth wasn't set up
- isProviderConfigured() for "cline" always returned true (wrong)
- isProviderConfigured() for "openai-codex" checked a non-existent field
This aligns the CLI with the VS Code extension's approach:
- Use welcomeViewCompleted as the single source of truth
- On first run, migrate by checking if ANY provider has credentials
- Set welcomeViewCompleted=true when any auth flow completes
- Fix ProviderPicker to check config for Cline auth data
- Match webview behavior for OpenAI Codex (always available option)
* refactor: use StateManager for OpenAI Codex OAuth credentials
OpenAI Codex was storing credentials directly via secretStorage, bypassing
StateManager. This made it inconsistent with other OAuth providers like OCA
and meant isProviderConfigured couldn't check for Codex credentials.
Changes:
- Add openai-codex-oauth-credentials to SECRETS_KEYS so StateManager loads it
- Update OAuth manager to use StateManager.getSecretKey/setSecret instead of
direct secretStorage access
- Update ProviderPicker to check for credentials (shows "Configured" status)
- Update CLI checkAnyProviderConfigured to check config directly
- Add Codex credentials check to migrateWelcomeViewCompleted
* fix(cli): close settings panel after /models selection
When using /models slash command, selecting a model or pressing escape
now closes the entire settings panel instead of navigating back to the
settings > api page. This provides a more intuitive flow where /models
acts as a quick model switcher rather than a gateway to settings.
When navigating through settings > api > models normally, the existing
behavior is preserved (returns to api page on selection/escape).
* fix(cli): add missing buildApiHandler import in SettingsPanelContent
The buildApiHandler function was being called when toggling thinking
mode but was never imported, causing a TypeError.
* fix(cli): use provider-specific model ID keys for cline/openrouter
The CLI was hardcoding actModeApiModelId/planModeApiModelId everywhere,
but cline/openrouter providers store model IDs in different keys
(actModeOpenRouterModelId/planModeOpenRouterModelId). This caused:
1. Model ID written to wrong key, so getModel() couldn't find it
2. getModel() fell back to default model (claude-sonnet)
3. Free models like kimi-k2.5 showed pricing instead of $0.00
Changes:
- Use getProviderModelIdKey() to get correct state key per provider
- Set model info alongside model ID (required for getModel())
- Add fallback in getModel() for missing model info
- Remove hardcoded "anthropic" and model ID fallbacks
- Use constants for default model IDs in import-configs.ts
* fix(cli): move kimi-k2.5 to 5th position, remove special styling
Move kimi-k2.5 from promoted position at top to 5th in the featured
models list. Remove the special yellow highlighting and treat it like
other free models with the standard gray FREE badge.
* fix(cli): rebuild API handler when changing models mid-task
When changing models via settings or /models during an active task,
the API handler wasn't being rebuilt. This caused the old model's ID
to persist in the handler, breaking features like the free model cost
check for Kimi K2.5.
Now flushes state and rebuilds the API handler after model selection.
* fix(cli): filter out reasoning messages to prevent UI flash
Reasoning/thinking trace messages were passing through to the render
phase, causing a brief white circle flash before ChatMessage returned
null. Now filtered out early in displayMessages to prevent the flash.
---------
Co-authored-by: abeatrix <beatrix@cline.bot>
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
* feat(moonshot): add cache token tracking to usage metrics
- Add cacheWriteTokens and cacheReadTokens fields to usage reporting
- Subtract cached tokens from inputTokens to reflect actual prompt tokens
- Read cached_tokens from Moonshot API response for accurate tracking
* fixing
* Fix: decimal input crash in OpenAI Compatible price fields (#8129)
* refactor: use type-safe parsePrice helper for decimal input handling
Replace the `as any` type bypass with a proper parsePrice utility function
that safely handles edge cases (empty string, lone dot, invalid input)
while maintaining type safety. Adds unit tests for the helper.
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
* feat(skills): Make skills always enabled and remove feature toggle setting
- Remove skillsEnabled from state-keys.ts USER_SETTINGS_FIELDS
- Remove Skills checkbox from FeatureSettingsSection.tsx
- Remove skillsEnabled handling from updateSettings.ts
- Mark skills_enabled as reserved in both Settings and UpdateSettingsRequest proto messages
- Remove conditional in task/index.ts to always discover skills
- Remove skillsEnabled from ExtensionStateContext.tsx default state
- Remove skillsEnabled from ExtensionMessage.ts interface
- Remove skillsEnabled from controller/index.ts state building
- Always show skills tab in ClineRulesToggleModal.tsx
- Remove experimental note from docs/features/skills.mdx
Follows the same pattern as hooks removal (PR #8777).
* fix: Show error message when skill creation fails
Display error to user instead of silently logging when creating a workspace
skill fails (e.g., when no workspace folder is open).
* feat(chat): use relative font size for thinking row content
Replace fixed text-xs class with dynamic font sizing based on
VSCode's font-size variable. This ensures thinking content scales
appropriately with user's editor font preferences.
* fixing
Include the HEAD commit hash at the top of PR review comments
so readers know which commit was reviewed. Also log commit info
in the GitHub Actions output for debugging.
* Fix: LiteLLM thinking configuration not showing for models (#8342)
* fix: add supportsReasoning to LiteLLM proto serialization
The model ID key fix alone wasn't sufficient - supportsReasoning was
being lost during the proto serialization cycle when saving/loading
model info. This adds the field to all relevant conversion functions.
---------
Co-authored-by: ClineXDiego <diego@cline.bot>
Co-authored-by: Robin Newhouse <robin@cline.bot>
* feat: add stealth/giga-potato test model to OpenRouter
Add a new stealth model "stealth/giga-potato" for testing purposes:
- Define model info in CLINE_STEALTH_MODELS with 128k context window
- Add to freeModels list in OpenRouterModelPicker for UI display
- Model supports images and prompt caching with zero pricing
* Fixing wording
Add two new CLI auth providers for headless setups and map their
configuration fields. Fix auth menu/provider status to use the
workspace-backed auth instance so the configured provider displays
correctly.
* feat(hooks): Run hooks from cwd of the workspace repo root.
* feat(hooks): npm run changeset
* feat(hooks): Make hooks execute in their respective repo's root dir.
* feat(hooks): Improvements as per Cline's code review feedback.
* chore: extract storage migrations to extension layer
Extracts VS Code specific storage migrations from common initialization into a dedicated function. This isolates the logic to the extension layer, making it clear that these steps are not applicable to other clients.
* invoke performStorageMigrations in vs code activation event
* fix check
* changeset version bump
* Updating CHANGELOG.md format
* release(3.55.0): Version bump and update WhatsNewModal
* feat(settings): Support linking to recommended or free model picker.
* Send to cline provider
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: cline-test <132302818+candieduniverse@users.noreply.github.com>
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
Add arcee-ai/trinity-large-preview:free as a new free model option:
- Add to onboarding models with 131k context window and score of 88
- Include in OpenRouterModelPicker free models list
- Update filter to preserve Trinity Large models like Minimax models
* docs(rules): Initial thoughts on docs for conditional rules.
* docs: restructure Cline Rules documentation into nested structure
Reorganize Cline Rules documentation by:
- Creating a "Cline Rules" group with overview and conditional-rules pages
- Moving conditional-rules.mdx into features/cline-rules/ subdirectory
- Adding URL redirects for backward compatibility
- Streamlining conditional-rules content for clarity and conciseness
- Adding cross-reference link to the overview page
This improves documentation navigation by grouping related rule concepts together and makes the content more accessible with clearer, more concise explanations.
* docs(cline-rules): consolidate rule file format documentation
Reorganize and expand the documentation for supported rule file formats:
- Add new "Supported Rule Files" section with comprehensive table
- Document cross-tool compatibility (Cursor, Windsurf, AGENTS.md)
- Clarify file priority and loading behavior
- Remove separate AGENTS.md section and integrate into unified table
This improves discoverability by showing all supported formats in one
place and makes it clearer how Cline works with rules from different AI
coding tools.
* docs(rules): remove context management note from overview
---------
Co-authored-by: cline-test <132302818+candieduniverse@users.noreply.github.com>
* feat(deepseek): add native tool calling support and reasoning_content passback
- Add DeepSeek to isNextGenModelProvider list to enable native tool calling
- Add isDeepSeekModelFamily function for model identification
- Add addReasoningContent function for DeepSeek Reasoner's reasoning_content field
- Pass back reasoning_content during tool calling within the same turn
- Clear reasoning_content when starting a new conversation turn
- Compliant with DeepSeek API documentation for thinking mode with tool calling
* Update src/core/api/transform/r1-format.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update comments for user message handling logic
Clarify reasoning for handling user messages in comments.
* Update src/core/api/transform/r1-format.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: format code for consistency in isNextGenModelFamily function
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ara <arafat.da.khan@gmail.com>
* feat: add MCP prompts support
Implement support for MCP prompts as defined in the MCP spec (2025-06-18):
- Add McpPrompt and McpPromptArgument types to shared types
- Update proto definitions with prompt messages
- Update McpHub to fetch prompts list and get individual prompts
- Add prompts to system prompt component for AI awareness
- Add McpPromptRow UI component for displaying prompts
- Update ServerRow with Prompts tab showing available prompts
- Add slash command integration (/mcp:<server>:<prompt>)
- Update regex patterns to support colons in command names
MCP prompts are user-controlled templates that can be invoked via
slash commands to inject contextual messages into the conversation.
* style: alphabetize imports in mcp-server-conversion.ts
Reorder imports to follow project convention of alphabetical ordering.
* feat: add MCP prompts to slash command autocomplete
Wire up mcpServers to SlashCommandMenu so MCP prompt commands appear
in the autocomplete dropdown with their own "MCP Prompts" section.
* test: add unit tests for MCP prompt slash commands
- Add webview slash-commands.test.ts testing getMcpPromptCommands,
getMatchingSlashCommands, and validateSlashCommand with MCP servers
- Add backend slash-commands tests for formatMcpPromptResponse and
parseSlashCommands MCP handling
- Export formatMcpPromptResponse for testability
- Add "mcp_prompt" to telemetry captureSlashCommandUsed types
* test: update snapshots and fix backend tests for MCP prompts
- Update system prompt snapshots to include MCP prompts section
- Remove backend tests requiring StateManager initialization
(tests for unknown server, no fetcher, fetcher errors)
- Core MCP prompt functionality is covered by remaining tests
* fix: change test status to valid 'connecting' value
* chore: remove commented debug line from prompts fetching
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use Logger instead of console.error for lint compliance
* fix: wire up mcpPromptFetcher callback to parseSlashCommands
The MCP prompt slash commands were not working because the
mcpPromptFetcher callback was never passed to parseSlashCommands.
This adds the callback that wraps mcpHub.getPrompt() to actually
fetch and inject prompt content when using /mcp:server:prompt.
* fix: resolve MCP prompts keyboard navigation and edge cases
- Add mcpServers param to keyboard handler's getMatchingSlashCommands calls
to fix arrow key navigation and Enter/Tab selection for MCP prompts
- Add null check for connection.client in McpHub.getPrompt()
- Add debug logging when MCP prompt fetch returns null
- Fix regex in shouldShowSlashCommandsMenu to include colons for MCP format
* chore: add changeset for MCP prompts feature
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Robin Newhouse <robin@cline.bot>
* refactor: simplify ThinkingRow expansion state management
Remove the responseStarted prop and complex logic that conditionally controlled ThinkingRow visibility during streaming. Simplify to allow ThinkingRow to remain expandable throughout the entire streaming lifecycle instead of forcing it expanded during reasoning and then collapsing after response starts.
Changes:
- Remove ApiReqState type and responseStarted tracking
- Eliminate showStreamingThinking and showCollapsedThinking logic
- Use consistent isExpanded state based only on user toggle
- Always show ThinkingRow title
* remove unused responseStarted
* feat(ui): update thinking UI with improved expand/collapse controls
Changes:
- Replace "Thinking..." with "Working..." status text in non-plan mode
- Switch from ChevronRight to ChevronUp/Down icons for better UX
- Redesign thinking section header with cleaner layout
- Remove preview text when collapsed, show only "Thinking" label
- Add consistent border styling to thinking content
- Implement per-tool thinking expand/collapse state management
- Update icon sizing and styling for better visual consistency
This improves the user experience by making the thinking/reasoning sections more intuitive to expand and collapse, with clearer visual indicators and a more polished appearance.
* add blur
* feat: chevron fix, reasoning change, slight style change
* feat: spacing issues
* keep thinking row expanded during stream
* Reasoning -> Thoughts
* feat: Inline reading of files vs having reading then read list items seperately
* feat: remove extra reading state
* feat: removed reasoning from file expandable file state
---------
Co-authored-by: Jose R. Perez <trupix@gmail.com>
- Native tool calls support for Ollama provider
- Sonnet 4.5 is now the default Amazon Bedrock model id
- Prevent infinite retry loops when replace_in_file fails repeatedly. The system now detects repeated failures and provides better guidance to break out of retry cycles.
- Skip diff error UI handling during streaming to prevent flickering. Error handling is deferred until streaming completes.
- Strip notebook cell outputs when extracting text content from Jupyter notebooks, significantly reducing context size sent to the LLM.
- Throttle diff view updates during streaming to reduce UI flickering and improve performance.
- Removed Devstral-2512 free from the free models list
- Removed deprecated zai-glm-4.6 model from Cerebras provider
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
Remove mistralai/devstral-2512:free from:
- Onboarding models configuration
- Free models picker in settings
- OpenRouter model filter exception list
The Devstral model is no longer included as a free tier option.
* feat: add support for tool calls in Ollama API
Enhanced OllamaHandler to support tool calls by adding a 'tools' parameter to createMessage. Implements processing of tool call deltas using ToolCallProcessor, enabling handling of function calls made by the model. Added necessary imports for ChatCompletionTool and ToolCallProcessor types.
* add changeset
2026-01-26 17:50:52 -08:00
1273 changed files with 443130 additions and 73367 deletions
description: Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.
description: Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, PR template usage, and PR creation using the gh CLI tool.
---
# Create Pull Request
@@ -147,14 +147,29 @@ When filling out the template:
### Create PR with gh CLI
**Use a temporary file for the PR body** to avoid shell escaping issues, newline problems, and other command-line flakiness:
1. Write the PR body to a temporary file:
```
/tmp/pr-body.md
```
2. Create the PR using the file:
```bash
gh pr create --title "PR_TITLE" --body-file /tmp/pr-body.md --base main
```
3. Clean up the temporary file:
```bash
rm /tmp/pr-body.md
```
For draft PRs:
```bash
gh pr create --title "PR_TITLE" --body "PR_BODY" --base main
gh pr create --title "PR_TITLE" --body-file /tmp/pr-body.md --base main --draft
```
Alternatively, create as draft if the user wants review before marking ready:
```bash
gh pr create --title "PR_TITLE" --body "PR_BODY" --base main --draft
```
**Why use a file?** Passing complex markdown with newlines, special characters, and checkboxes directly via `--body` is error-prone. The `--body-file` flag handles all content reliably.
Add endpoint configuration file support for on-premise deployments
Enterprise customers can now configure custom API endpoints by creating a `~/.cline/endpoints.json` file with custom URLs for `appBaseUrl`, `apiBaseUrl`, and `mcpBaseUrl`. When this file is present, Cline runs in on-premise mode with the custom endpoints.
fix: prevent infinite retry loops when replace_in_file fails repeatedly
Add safeguards to prevent the LLM from getting stuck in infinite retry loops when `replace_in_file` operations fail repeatedly. The system now detects repeated failures and provides better guidance to break out of retry cycles.
fix: skip diff error UI handling during streaming to prevent flickering
Suppress diff view error notifications while content is actively streaming to prevent visual flickering and improve user experience. Error handling is deferred until streaming completes.
fix(extract-text): strip notebook outputs to reduce context size
Strip notebook cell outputs when extracting text content from Jupyter notebooks, significantly reducing the amount of context sent to the LLM while preserving the essential code and markdown content.
Add throttling to diff view updates during content streaming to reduce UI flickering and improve performance. Updates are now batched at reasonable intervals instead of firing on every token received.
Disable PostHog and build-time OpenTelemetry telemetry in self-hosted/on-premise mode. Enterprise customers running self-hosted deployments will no longer send any telemetry to Cline's collectors. Runtime environment OTEL and remote config OTEL remain available for enterprises to configure their own telemetry collection.
The CLI lives in `cli/` and uses React Ink for terminal UI.
- If needed, look at `cli/src/constants/colors.ts` for re-used terminal colors, e.g. `COLORS.primaryBlue` highlight color (selections, spinners, success states).
- Never use `dimColor` with gray (e.g. `<Text color="gray" dimColor>`) - it's too hard to read. Use `color="gray"` for secondary text and normal foreground (no color) for primary text.
- When thinking about how to handle state or messages from core, look at webview for how it communicates with the vs code extension.
- When updating the webview, consider and suggest to the user to update the CLI TUI since we want to provide a similar experience to our terminal users as we do our vs code extension users.
## Adding New API Providers
When adding a new API provider to the extension, you must also update the CLI:
1.**Update `cli/src/components/ModelPicker.tsx`**: Add the provider to the `providerModels` map so `getDefaultModelId()` returns the correct default model. Import the models and default ID from `@shared/api`:
```typescript
import { newProviderDefaultModelId, newProviderModels } from "@/shared/api"
2. **Use `applyProviderConfig()` for auth flows**: When implementing OAuth or other auth flows for the provider, use the shared utility at `cli/src/utils/provider-config.ts`:
```typescript
import { applyProviderConfig } from "../utils/provider-config"
This handles setting provider, default model, API key mapping, state persistence, and rebuilding the API handler.
3. **Provider-specific auth**: If the provider uses OAuth (like `openai-codex`), add handling in `SettingsPanelContent.tsx`'s `handleProviderSelect` callback. See the existing Codex OAuth flow as a reference.
@@ -14,7 +14,7 @@ This file is the secret sauce for working effectively in this codebase. It captu
## Miscellaneous
- This is a VS Code extension—check `package.json` for available scripts before trying to verify builds (e.g., `npm run compile`, not `npm run build`).
- When creating PRs, if the change is user-facing and significant enough to warrant a changelogentry, run `npm run changeset` and create a patch changeset. Never create minor or major version bumps. Skip changesets for trivial fixes, internal refactors, or minor UI tweaks that users wouldn't notice.
- When creating PRs, contributors should not create changelog-entry files. Maintainers handle release versioning and changelog curation during the release process.
- When adding new feature flags, see this PR as a reference https://github.com/cline/cline/pull/7566
- Additional instructions about making requests: @.clinerules/network.md
@@ -147,6 +147,17 @@ Required steps:
Common mistake: Adding only the return value without the `context.globalState.get()` call. This compiles but the value is always `undefined` on load.
Settings plumbing gotcha: if a key is user-toggleable from settings, wire both controller update paths:
-`src/core/controller/state/updateSettings.ts` for webview `updateSetting(...)`
-`src/core/controller/state/updateSettingsCli.ts` for CLI/ACP settings updates
Missing one path causes a toggle to appear to change in one surface while the backend state stays unchanged.
Webview toggle gotcha: settings changes must also round-trip back in state payloads.
- Add the field to `UpdateSettingsRequest` in `proto/cline/state.proto` (for webview update requests), then run `npm run protos`
- Include the key in `Controller.getStateToPostToWebview()` (`src/core/controller/index.ts`)
- Ensure `ExtensionState` and webview defaults include the key (`src/shared/ExtensionMessage.ts`, `webview-ui/src/context/ExtensionStateContext.tsx`)
If this round-trip wiring is missing, the backend value can update but the toggle in webview appears stuck or reverts.
## StateManager Cache vs Direct globalState Access
StateManager uses an in-memory cache populated during `StateManager.initialize(context)` in `common.ts`. For most state, use `controller.stateManager.setGlobalState()`/`getGlobalStateKey()`.
Global settings, secrets and workspace state are stored in **file-backed JSON stores** under `~/.cline/data/`. This is the shared storage layer used by VSCode, CLI, and JetBrains.
In-memory cache on top of `StorageContext`. All runtime reads hit the cache; writes update cache immediately and debounce-flush to disk.
## ⚠️ Do NOT Use VSCode's ExtensionContext for Storage
**Do not** read from or write to `context.globalState`, `context.workspaceState`, or `context.secrets` for persistent data. These are VSCode-specific and not available on CLI or JetBrains.
Remember that your data may be read by a different client than the one that wrote it. For example, a value written by Cline in JetBrains may be read by Cline CLI.
On VSCode startup, a migration copies data from VSCode's `ExtensionContext` storage into the file-backed stores. This runs in `src/common.ts` before `StateManager.initialize()`.
- **Sentinel**: `__vscodeMigrationVersion` key in global state and workspace state — prevents re-migration.
- **Merge strategy**: File store wins. Existing values are never overwritten.
- **Safe downgrade**: VSCode storage is NOT cleared, so older extension versions still work.
## Adding New Storage Keys
1. Add to `src/shared/storage/state-keys.ts` (see existing patterns)
2. Read/write via `StateManager` (NOT via `context.globalState`)
3. If adding a secret, add to `SecretKeys` array in `state-keys.ts`
@@ -19,7 +19,7 @@ Review and address all comments on the current branch's PR.
- Inline comments: `gh api repos/{owner}/{repo}/pulls/{pr_number}/comments`
- General comments: `gh pr view {pr_number} --json comments,reviews`
4. Present a summary of all comments with your recommendation for each (apply, skip, or respond). Ignore bot noise (changeset-bot, CI status, etc.).
4. Present a summary of all comments with your recommendation for each (apply, skip, or respond). Ignore bot noise (release automation, CI status, etc.).
The goal of this workflow is to take a changeset for a release of Cline, an autonomous coding agent extension that plugs right into your IDE, and write the updated announcement component, and the updated changelog.
For reference, here are some examples of how we converted previous changesets to announcement components / changelogs.
- 3.14
<changeset>
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
claude-dev@3.14.0
Minor Changes
77c9863: create clinerules folder if its currently a file and creating new rule
0ffb7dd: disabling shift hint for now & improving tooltip behavior
79b76fd: Add support for custom model ID in AWS Bedrock provider, enabling use of Application Inference Profile.
eb6e481: Full support for LaTeX rendering
df37f29: Add support for custom API request timeout. Previously, timeouts were hardcoded to 30 seconds for providers like Ollama or 15 seconds for OpenRouter and Cline. Now users can set a custom timeout value in milliseconds through the settings interface.
e4d26be: allow cursorrules and windsurfrules
c5de50f: Fix Handle @withRetry() SyntaxError when running extension locally issue
61d2f42: enabled pricing calculation for gemini and vertex + more robust caching & cache tracking for gemini & vertex
aed152b: add truncation notice when truncating manually
2fe2405: Migrate Cline Tools Section to new docs
19cc8bc: Add a timeout setting for the terminal connection, allowing users to adjust this if they are having timeout issues
03d4410: Added copy button to code blocks.
c78fe23: addressed race condition in terminal command usage
91e222f: add checkpoints after more messages
14230e7: add newrule slash command
1c7d33a: Add remote config with posthog allowing for disabling new features until they're reading, making for a better developer experience.
4196c14: add cache ui for open router and cline provider
d97424f: showing expanded task by default
5294e78: Refactor to not pass a message for showing the MCP View from the servers modal
70cc437: Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname
4b697d8: Migrate the addRemoteServer to protobus
Patch Changes
c63d9a1: updated drag and drop text to say "drop" instead of "drag"
459adf0: Add markdown copy to chat
74ec823: Minor UX improvement to drag and drop ux
b0961f4: Remove linear pull request action
e9ce384: searchCommits protobus migration
5802b68: createRuleFile protobus migration
df7f9fc: Add dependsOn to more blocks in the tasks.json
41ae732: Fix for git commit mentions in repos with no git commits
7e78445: Adding args to allow Cursor to open workspaces (for checkpoint testing/development)
bdfda6f: feat(bedrock): Introduce Amazon Nova Premier
65243ad: Introduce UI library for future UI development
4565e06: checkIsImageURL migrated to protobus
5a8e9d8: protobus migration for openImage
deeda6e: Lowering Gemini cache TTL time
db0b022: Adding UI to show openrouter balance next to provider
4650ffa: deleteRuleFile protobus migration
d4bd755: fix cost calculation
</changeset>
<changelog>
## [3.14.0]
- Add UI to show openrouter balance next to provider
- Add support for custom model ID in AWS Bedrock provider, enabling use of Application Inference Profile (Thanks @clicube!)
- Add more robust caching & cache tracking for gemini & vertex providers
- Add support for LaTeX rendering
- Add support for custom API request timeout. Timeouts were 15-30s, but can now be configured via settings for OpenRouter/Cline & Ollama (Thanks @WingsDrafterwork!)
- Add truncation notice when truncating manually
- Add a timeout setting for the terminal connection, allowing users to set a time to wait for terminal startup
- Add copy button to code blocks
- Add copy button to markdown blocks (Thanks @weshoke!)
- Add checkpoints to more messages
- Add slash command to create a new rules file (/newrule)
- Add cache ui for open router and cline provider
- Add Amazon Nova Premier model to Bedrock (Thanks @watany!)
- Add support for cursorrules and windsurfrules
- Add support for batch history deletion (Thanks @danix800!)
- Improve Drag & Drop experience
- Create clinerules folder creating new rule if it's needed
- Enable pricing calculation for gemini and vertex providers
- Refactor message handling to not show the MCP View of the server modal
- Migrate the addRemoteServer to protobus (Thanks @DaveFres!)
- Update task header to be expanded by default
- Update Gemini cache TTL time to 15 minutes
- Fix race condition in terminal command usage
- Fix to correctly handle `import.meta.url`, avoiding leading slash in pathname for Windows (Thanks @DaveFres!)
2964388: Added copy button to MermaidBlock component
75143a7: Add the ability to fetch from global cline rules files
Patch Changes
a0252e7: convert inline style to tailwind css of file SettingsView.tsx
ab59bd9: Add stream options back to xai provider
7276f50: Icons to indicate an action is occuring outside of the users workspace
0b19ba6: update to NEW model
</changeset>
<changelog>
## [3.13.0]
- Add Cline rules popover under the chat field, allowing you to easily add, enable & disable workspace level or global rule files
- Add new slash command menu letting you type “/“ to do quick actions like creating new tasks
- Add ability to edit past messages, with options to restore your workspace back to that point
- Allow sending a message when selecting an option provided by the question or plan tool
- Add command to jump to Cline's chat input
- Add support for OpenAI o3 & 4o-mini (Thanks @PeterDaveHello and @arafatkatze!)
- Add baseURL option for Google Gemini provider (Thanks @owengo and @olivierhub!)
- Add support for Azure's DeepSeek model. (Thanks @yt3trees!)
- Add ability for models that support it to receive image responses from MCP servers (Thanks @rikaaa0928!)
- Improve search and replace diff editing by making it more flexible with models that fail to follow structured output instructions. (Thanks @chi-cat!)
- Add detection of Ctrl+C termination in terminal, improving output reading issues
- Fix issue where some commands with large output would cause UI to freeze
We have a changeset PR that automatically generated as new unreleased PRs are merged into main, the PR is always called "Changeset version bump" and the author is github-actions.
The Changeset PR description looks something like this:
<changeset-pr-description>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
# Releases
## claude-dev@3.16.0
### Minor Changes
- c6e8b04: Recent task list is now collapsible, allowing users to hide their recent tasks (e.g. when sharing their screen).
- aabe4ae: Add detection for new users to display special components
- 6c18d51: adds global endpoint for vertex ai users
- 080ed7c: Add Tailwind CSS IntelliSense to the the recommended extensions list
- 5147e28: new workflow feature
### Patch Changes
- c0b3c69: fix eternal loading states when the last message is a checkpoint
- 570ece3: selectImages protos migration
- 8d8452e: askResponse protobus migration
- cd1ff2a: Finishing the migration of Vscode Advanced settings to Settings Webview
</changeset-pr-description>
The changeset pr is ALWAYS on the following branch: `changeset-release/main`.
I have the `gh` command line tool set up and authenticated, so you have everything you need.
The first step is to get the full diff from the changeset PR to look at the changes that were automatically made to the `CHANGELOG.md` file. By default it will automatically add a new section to the changelog.md file with the new version. The problem with the automatically generated section is that it just takes the text that the developers threw into their changeset files for each corresponding PR, and they can be pretty vague and bad. Additionally there's some stuff that is totally irrelevant for the end user, like minor refactoring changes. So I manually typically go in and update this section to be a proper changelog that will show up in our patchnotes. You can look at how the rest of the file is done because those are all good examples of us updating this to use good language for the end user. We usually put new features up top (and the most exciting flagship features at the very top), and then bug fixes/improvements at the bottom. Having some basic organization to the ordering of the bullet points by content is nice. But use common sense.
To handle this process effectively, do the following:
For each of the automatically generated bullet points in the Changelog.md, you should
1. Take the commit hash at the start of the bullet point, and use the `gh` command line tool find the PR that it was associated with.
2. Use the `gh` command to get the PR title/description/discussion to understand the context surrounding the PR.
3. Use the `gh` command line tool to get the full PR diff to fully understand the changes made in the code.
4. Synthesize that knowledge to determine (a) whether or not this change is relevant to end users and (b) what the text & ordering of the line should be.
5. Update the `CHANGELOG.md` accordingly
Do this for every single item in the list from the autogenerated bullet points. We want to be diligent and have a full understanding of every feature so we can make the best changelog ever!
Here are some principles for good changelogs from keepchangelog.com, a handy guide:
<keepachangelog-pinciples-for-good-changelogs>
### Guiding Principles
- Changelogs are for humans, not machines.
- There should be an entry for every single version.
- The same types of changes should be grouped.
- The latest version comes first.
### Bullet points in the changelog should follow these principles:
- Types of changes
- Added for new features.
- Changed for changes in existing functionality.
- Deprecated for soon-to-be removed features.
- Removed for now removed features.
- Fixed for any bug fixes.
- Security in case of vulnerabilities.
</keepachangelog-pinciples-for-good-changelogs>
Lastly, when developers make a PR, they typically make a changeset. And they have 3 options when making the changeset:
1. Patch
2. Minor
3. Major
Sometimes they label something as minor when really it should just be a patch. Or vice versa. Because of this, the automatic version bump may be incorrect. So when starting out this workflow, you should use the <ask_followup_question> tool to confirm with me whether or not this should be a patch bump (show the old version number and what the proposed new version number would be) or a minor bump. Part of the release process is making sure the version in package.json that is automatically changed actually corresponds with what we decided the bump should actually be based on the features. ALL these modifications happen in the `changeset-release/main` branch btw.
<important_note>
Before doing any of this, make sure you check out the `changeset-release/main` and pull the most recent up to date changes. Then perform all this work in that branch.
New announcement banners should ONLY be made for minor version bumps or higher. That's another reason why double checking if the changelog warrants the bump is important.
Also, SUPER important: For any external contributors that aren't part of the cline github organization, we always want to add a (Thanks @username!) at the end of the changelog to attribute them properly. We're an open source project and it's ethical to do this.
</important_note>
Once the changelog looks good, and the version number looks good, we gotta double check that the version number in the changelog has the brackets around it. And as a final step, double check the package.json version number matches the latest number in the changelog. And as the ultimate final step we run `npm run install:all` to make sure the package version number permiates through the lock file.
<detailed_sequence_of_steps>
# Cline Release Process - Detailed Sequence of Steps
## Before Starting
1. First, examine the changeset PR without checking it out:
```bash
gh pr view changeset-release/main
```
2. View the PR diff to see the auto-generated CHANGELOG.md changes:
# Check if user is a member of the Cline organization
# this command is a bit finnicky, but it 100% works.
# if you see a `Error executing command: The command ran successfully, but we couldn't capture its output. Please proceed accordingly.` error, just retry it until you actually get the output
# don't make any assumptions, just retry the command to actually get the output and determine if they're external or not.
# no output means they are an external contributor, otherwise if there is output they are an internal contributor (part of our github org)
gh api "orgs/cline/members" --jq "map(.login)" | grep -i "pashpashpash"
```
d. View the full PR diff to understand code changes:
```bash
gh pr diff <PR-number> > pr-diff-<PR-number>.txt
cat pr-diff-<PR-number>.txt
```
## Updating the Changelog
5. Based on PR analysis, update the CHANGELOG.md with user-friendly descriptions:
- Use the `<replace_in_file>` tool to edit the CHANGELOG.md file
- Group by feature type (Added, Changed, Fixed)
- Put most exciting features at the top
- Move bug fixes and small improvements to the bottom
- Use clear, end-user focused language
- For external contributors, add attribution at the end of the relevant entry: `(Thanks @username!)`
## Version Number Verification
6. Confirm the version bump is appropriate:
- Check package.json to verify the auto-generated version number:
```bash
cat package.json | grep "\"version\""
```
- If the feature set doesn't warrant a minor bump, use the `<replace_in_file>` tool to modify package.json
7. Ensure the version in CHANGELOG.md has brackets around it:
```
## [3.16.0]
```
## Creating the Announcement (for minor/major versions only)
8. If this is a minor version bump, create/update the announcement component:
- Use the `<replace_in_file>` tool to edit the src/views/components/announcement.tsx file
- Update the highlights based on key features
- Move previous version highlights to the "Previous Updates" section
- Use the previous announcement components as reference for structure
## Finalizing the Release
9. Update dependencies with the new version number:
@@ -89,16 +89,9 @@ On the main branch, create a commit that updates:
2. **package.json** - Update the version field to the new version
3. **Delete changesets** for the commits being included in the hotfix. This prevents the changeset bot from including duplicate entries in the next regular release.
3. No changelog-entry file cleanup is needed. Contributors do not create changelog-entry files in this repo.
Find and delete the changeset files associated with the selected commits:
```bash
ls .changeset/
```
Each changeset file in `.changeset/` corresponds to a PR. Read them to identify which ones belong to the commits you're hotfixing, then delete those files.
**Skip running `npm run install:all`** - the automation handles outdated lockfiles.
**Skip running `npm run install:all`** - release automation handles lockfile consistency as needed.
Commit with message format: `v{VERSION} Release Notes (hotfix)`
@@ -107,7 +100,7 @@ In the commit body, mention:
- List the cherry-picked commits that will be included
So until the settings page is update, and this is added to settings in a way that's clean and doesn't confuse new users, I don't think we can merge this. Please bear with us.
</request_changes_comment>
<request_changes_comment>
Also, don't forget to add a changeset since this fixes a user-facing bug.
The architectural change is solid - moving the focus logic to the command handlers makes sense. Just don't want to introduce subtle timing issues by removing those timeouts.
- Adding enums (e.g. `ClineSay`) → also update `src/shared/proto-conversions/cline-message.ts`.
## Adding API Providers (silent failure risk)
Three proto conversion updates are **required** or the provider silently resets to Anthropic:
1.`proto/cline/models.proto` — add to `ApiProvider` enum.
2.`convertApiProviderToProto()` in `src/shared/proto-conversions/models/api-configuration-conversion.ts`.
3.`convertProtoToApiProvider()` in the same file.
Also update: `src/shared/api.ts`, `src/shared/providers/providers.json`, `src/core/api/index.ts`, `webview-ui/.../providerUtils.ts`, `webview-ui/.../validate.ts`, `webview-ui/.../ApiOptions.tsx`, and `cli/src/components/ModelPicker.tsx`.
For Responses API providers: add to `isNextGenModelProvider()` in `src/utils/model-utils.ts` and set `apiFormat: ApiFormat.OPENAI_RESPONSES` on models.
## Adding Tools to System Prompt (5+ file chain)
1. Add enum to `ClineDefaultTool` in `src/shared/tools.ts`.
2. Create definition in `src/core/prompts/system-prompt/tools/` (export `[GENERIC]` minimum).
3. Register in `src/core/prompts/system-prompt/tools/init.ts`.
4. Whitelist in `src/core/prompts/system-prompt/variants/*/config.ts` for each model family.
5. Handler in `src/core/task/tools/handlers/`, wire in `ToolExecutor.ts`.
6. If tool has UI: add `ClineSay` enum in proto → `ExtensionMessage.ts` → `cline-message.ts` → `ChatRow.tsx`.
7. Regenerate snapshots: `UPDATE_SNAPSHOTS=true npm run test:unit`.
## Modifying System Prompt
Modular: `components/` (shared) + `variants/` (model-specific) + `templates/` (`{{PLACEHOLDER}}`). Variants override components via `componentOverrides` in `config.ts` or custom `template.ts`. XS variant is heavily condensed inline. Always regenerate snapshots after changes.
## Global State Keys (silent failure risk)
Adding a key requires: type in `src/shared/storage/state-keys.ts`, read via `context.globalState.get()` in `src/core/storage/utils/state-helpers.ts``readGlobalStateFromDisk()`, and add to return object. Missing the `.get()` call compiles fine but value is always `undefined`.
Search thoroughly for existing issues that match this one:
gh issue list --search "<keywords from the issue>" --state all --limit 30
gh issue list --search "<error messages>" --state all --limit 20
gh issue list --search "<affected feature/component>" --state all --limit 20
For each relevant issue you find, read it including its comments:
gh issue view <number> --comments
You're looking for:
- **Duplicates**: Issues describing the same problem. Link to them and explain why you think they're duplicates. If closed, check how they were resolved - the solution might apply here.
- **Related issues**: Similar problems or context that could help. Pull useful information from their comments (workarounds others found, debugging steps that helped, maintainer explanations). Link to them and explain the connection.
If there are closed issues with solutions, surface those solutions prominently - this might immediately solve the user's problem.
### Analyze recent changes (ALWAYS DO THIS)
Many issues are regressions from recent releases. **Always** check what changed recently:
gh release list --limit 10
gh pr list --state merged --limit 50 --json number,title,mergedAt,author,body
Look for PRs merged in the last few weeks that might correlate with the issue. If you find a likely connection:
- If you find a regression, call it out explicitly: which PR/commit likely caused it, who authored it, what changed, and suggest a fix direction if you can see one.
- If you don't find anything related, still mention it: "I analyzed recent PRs and releases but didn't find any changes that seem related to this issue."
### Search the codebase
Find the relevant code:
- Use grep/find to locate code related to the issue
- Key areas: `src/api/` (providers/models), `src/core/prompts/` (tools/prompts), platform-specific code for VS Code vs JetBrains
### Find documentation
Cline docs are at **https://docs.cline.bot/** and built with Mintlify from the `docs/` directory.
The URL structure maps directly to the file structure:
Cross-reference with GitHub usernames. Include in your response (@mention, do NOT assign):
| SME | Reason |
|-----|--------|
| @username1 | Authored PR #X which modified this area |
| @username2 | Primary contributor to affected file |
## Weak model detection
Many issues are caused by users running small or non-frontier models that don't tool-call reliably. Signs include:
- Model failing to use tools correctly
- Nonsensical or malformed responses
- User is running a small/local model or older model version
If this looks like a weak model issue, kindly suggest they try reproducing with Claude Sonnet and report back if it persists. Link to https://docs.cline.bot/getting-started/selecting-your-model if helpful. Still label and triage normally.
## Your comment
Write a single comment as a helpful community member. Be conversational, not robotic. Include what's relevant:
- **Helpful response** - Answer their question, suggest a fix, provide a workaround. If you found solutions in related closed issues, surface those prominently.
- **Duplicates and related issues** - Link to any you found and explain why they're duplicates/related. Summarize useful context from their comments.
- **Regression analysis** - If this looks like a regression, explain what change likely caused it, link to the PR/commit, and tag the author.
- **Clarifying questions** - If you need more info, ask specific questions. Don't ask for things already provided.
- **SME table** - Include the table above if this needs engineering attention. Don't tag people for questions with obvious answers or weak-model issues.
- **Context for maintainers** - Relevant code paths, what you found. Keep it concise.
- **Docs links** - If there's relevant documentation, link to it naturally in your response as a recommendation (e.g., "For more details, check out [the Ollama setup guide](url)"). Do NOT add a "Sources" section at the end - integrate doc links into your response where they're helpful.
- **Possible Duplicates section** - ALWAYS include a "Possible Duplicates" section at the end of your comment listing issues that might be duplicates so maintainers can quickly close if appropriate. If none found, say "No obvious duplicates found."
## Labels
First, retrieve all available labels and read their descriptions to understand what each is for:
gh label list --json name,description --limit 100
Then apply the appropriate labels based on your analysis. Only use labels from the list above—do not create new labels.
- **This is a one-time automated response** - you will NOT see their reply or respond again. Never say things like "I can help you", "let me know", "once I have that info", or "I can give you more targeted help" - you won't be there to follow up. If you ask clarifying questions, frame them for the maintainers who will follow up, e.g., "If you can share X, that would help the maintainers diagnose this."
- Don't be formulaic. Respond to what the issue actually needs.
- Surface solutions from past issues - often the fastest path to helping.
- Connecting regressions to specific changes is extremely valuable.
You're a GitHub PR reviewer for the open source Cline repository. Your goal is to give the PR author helpful feedback and give maintainers the context they need to review efficiently.
Cross-reference git authors with GitHub usernames. Include an SME table in your response:
| SME | Reason |
|-----|--------|
| @username1 | Authored PR #X which modified this area |
| @username2 | Primary contributor to affected file (15 commits in 6 months) |
| @username3 | Reviewed similar PR #Y with extensive feedback |
## Deep code review
This is the most important part. Don't just look for syntax issues - understand what the PR is trying to achieve and whether the implementation is the right approach.
Step 1: Understand the intent
Read the PR description and understand what the author is trying to accomplish. What problem are they solving? What feature are they adding?
Step 2: Form your own opinion first
Before analyzing their code, think about how YOU would implement this feature or fix. What files would you touch? What patterns would you follow? What edge cases would you handle?
Step 3: Compare approaches
Now look at their implementation. How does it compare to what you would have done?
- Is their approach better in some ways? Note what they did well.
- Is their approach missing something? Be specific about what and why.
- Are there edge cases they haven't considered?
- Does it follow the patterns established in similar parts of the codebase?
Step 4: Look at the bigger picture
- What other files or systems does this change interact with?
- Could this break anything else?
- Is there additional work needed beyond this PR to complete the feature?
- Does this fit well with the overall architecture?
Step 5: Find reference implementations
Look for similar changes in the codebase:
```bash
git log --oneline --all --grep="<relevant keywords>" | head -20
git log --oneline -- <similar files> | head -20
```
If this is adding a new API provider, look at how other providers are implemented.
If this is adding a new feature, look at how similar features were added.
Note where their implementation aligns with or diverges from established patterns.
Step 6: Standard code review checks
- DRY: Is there duplicated code that could be extracted?
- Error handling: Are errors handled appropriately?
- Security: Any injection risks, credential exposure, unsafe dependencies?
- Performance: Any obvious inefficiencies, memory leaks, N+1 patterns?
- Types: Is TypeScript used correctly? Any unsafe type assertions?
- Naming: Are variables and functions named clearly?
- Comments: Is complex logic explained? Are there outdated comments?
## Inline code suggestions
For specific code improvements, use GitHub's suggestion syntax via `gh api`.
This creates suggestions the author can commit with one click.
Single-line suggestion:
```bash
gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/reviews \
"body": "This can be simplified:\n\n```suggestion\nconst simplified = doThing();\n```"
}
]'
```
Use inline suggestions for concrete improvements. Use regular comments for questions or broader feedback.
## Post your review
After your investigation, post a single helpful comment that helps the author and gives maintainers context.
Start with a warm thank you for their contribution. Be conversational, not robotic.
Include what's relevant:
- In-depth explanation of what the PR does - Be comprehensive. A maintainer should be able to read this section and fully understand the author's intent, why they made the changes, how they implemented it, and what files/systems are affected. Don't just summarize - explain.
- Related issues/PRs you found that provide useful context (link to them)
- Your review findings (issues to address, suggestions, etc.)
- Clear next steps for the author
Include a "For Maintainers" section with:
- Anything else useful to help the maintainer resolve this PR
- Related issues/PRs with context on why they're relevant
- Open issues this PR might fix that weren't linked in the description
- Your recommendation: merge as-is, needs changes, needs discussion, close, etc.
- SME table - who should review this and why
For the SME table:
| SME | Reason |
|-----|--------|
| @username | Primary contributor to affected files |
- This is a one-time automated response - you will NOT see their reply or respond again. Never say things like "let me know if you have questions", "I can help you with", or "feel free to ask" - you won't be there to follow up. Frame any questions for the maintainers who will follow up.
- Be helpful and welcoming - Many contributors are new to the project
- Be specific - Point to exact lines and suggest fixes, don't give vague feedback
- Think deeply - Don't just surface-level review, understand the intent and evaluate the approach
- Use inline suggestions - Make it easy for authors to accept changes
- You're a first-pass reviewer - A human maintainer will do final approval
echo "(no test output captured — process may have been killed before output was flushed)" >> $GITHUB_STEP_SUMMARY
fi
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Debugging" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **TUI traces** are attached as artifacts below — download and inspect them to see terminal state at the point of failure." >> $GITHUB_STEP_SUMMARY
echo "- **To view a trace replay/Run a TUI Trace: ** run \`npx tui-test show-trace path/to/trace/file\` in your terminal" >> $GITHUB_STEP_SUMMARY
echo "- **Full test log** is also attached as an artifact." >> $GITHUB_STEP_SUMMARY
echo "- Tests run with \`retries: 2\` so any failure shown is a consistent failure, not a flake." >> $GITHUB_STEP_SUMMARY
"gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/comments *",
"gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/reviews *"
]
}
run:|
npx cline --yolo 'You'\''re a GitHub PR reviewer for the open source Cline repository. Your goal is to give the PR author helpful feedback and give maintainers the context they need to review efficiently.
Cross-reference git authors with GitHub usernames. Include an SME table in your response:
| SME | Reason |
|-----|--------|
| @username1 | Authored PR #X which modified this area |
| @username2 | Primary contributor to affected file (15 commits in 6 months) |
| @username3 | Reviewed similar PR #Y with extensive feedback |
## Bash command usage
Don'\''t use operators like `|`, `&&`, or `;` - run each command separately and analyze the output.
When referencing command outputs, quote them properly to avoid formatting issues.
## Deep code review
This is the most important part. Don'\''t just look for syntax issues - understand what the PR is trying to achieve and whether the implementation is the right approach.
Step 1: Understand the intent
Read the PR description and understand what the author is trying to accomplish. What problem are they solving? What feature are they adding?
Step 2: Form your own opinion first
Before analyzing their code, think about how YOU would implement this feature or fix. What files would you touch? What patterns would you follow? What edge cases would you handle?
Step 3: Compare approaches
Now look at their implementation. How does it compare to what you would have done?
- Is their approach better in some ways? Note what they did well.
- Is their approach missing something? Be specific about what and why.
- Are there edge cases they haven'\''t considered?
- Does it follow the patterns established in similar parts of the codebase?
Step 4: Look at the bigger picture
- What other files or systems does this change interact with?
- Could this break anything else?
- Is there additional work needed beyond this PR to complete the feature?
- Does this fit well with the overall architecture?
Step 5: Find reference implementations
Look for similar changes in the codebase:
```bash
git log --oneline --all --grep='\''<relevant keywords>'\'' | head -20
git log --oneline -- <similar files> | head -20
```
If this is adding a new API provider, look at how other providers are implemented.
If this is adding a new feature, look at how similar features were added.
Note where their implementation aligns with or diverges from established patterns.
Step 6: Standard code review checks
- DRY: Is there duplicated code that could be extracted?
- Error handling: Are errors handled appropriately?
- Security: Any injection risks, credential exposure, unsafe dependencies?
- Performance: Any obvious inefficiencies, memory leaks, N+1 patterns?
- Types: Is TypeScript used correctly? Any unsafe type assertions?
- Naming: Are variables and functions named clearly?
- Comments: Is complex logic explained? Are there outdated comments?
## Inline code suggestions
For specific code improvements, use GitHub'\''s suggestion syntax via `gh api`.
This creates suggestions the author can commit with one click.
Single-line suggestion:
```bash
gh api repos/'"${GITHUB_REPO}"'/pulls/'"${PR_NUMBER}"'/reviews \
"body": "This can be simplified:\n\n```suggestion\nconst simplified = doThing();\n```"
}
]'\''
```
Use inline suggestions for concrete improvements. Use regular comments for questions or broader feedback.
## Post your review
After your investigation, post a single helpful comment that helps the author and gives maintainers context.
Start with a warm thank you for their contribution. Be conversational, not robotic.
Include what'\''s relevant:
- In-depth explanation of what the PR does - Be comprehensive. A maintainer should be able to read this section and fully understand the author'\''s intent, why they made the changes, how they implemented it, and what files/systems are affected. Don'\''t just summarize - explain.
- Related issues/PRs you found that provide useful context (link to them)
- Your review findings (issues to address, suggestions, etc.)
- Clear next steps for the author
Include a '\''For Maintainers'\'' section with:
- Anything else useful to help the maintainer resolve this PR
- Related issues/PRs with context on why they'\''re relevant
- Open issues this PR might fix that weren'\''t linked in the description
- Your recommendation: merge as-is, needs changes, needs discussion, close, etc.
- SME table - who should review this and why
For the SME table:
| SME | Reason |
|-----|--------|
| @username | Primary contributor to affected files |
- This is a one-time automated response - you will NOT see their reply or respond again. Never say things like '\''let me know if you have questions'\'', '\''I can help you with'\'', or '\''feel free to ask'\'' - you won'\''t be there to follow up. Frame any questions for the maintainers who will follow up.
- Be helpful and welcoming - Many contributors are new to the project
- Be specific - Point to exact lines and suggest fixes, don'\''t give vague feedback
- Think deeply - Don'\''t just surface-level review, understand the intent and evaluate the approach
- Use inline suggestions - Make it easy for authors to accept changes
- You'\''re a first-pass reviewer - A human maintainer will do final approval'
# Ignore all webview-ui files except the build directory (https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/frameworks/hello-world-react-cra/.vscodeignore)
- Restore VS Code foreground terminal support and settings.
- Add latest OpenAI, SAP AI Core, and Z AI models.
### Fixed
- Fix hook template JSON escaping.
- Improve ripgrep file search error handling.
### Changed
- Remove hardcoded model lists from docs.
## [3.81.0]
### Added
- Add GPT-5.5 model support for OpenAI Codex subscription users.
### Fixed
- Remove hardcoded "What’s New" fallback items in webview; only remote-configured welcome banners are shown.
### Changed
- Improve cline-core memory diagnostics used by the extension runtime:
- enable near-heap-limit heap snapshots
- add periodic memory usage logging
- log discovered heap snapshots on abnormal exits for easier OOM debugging
## [3.80.0]
### Added
- Wire up remote `globalSkills` from enterprise remote config with full UI, toggle support, and system prompt integration — enterprise-managed skills now appear under a dedicated "Enterprise Skills" section and support `alwaysEnabled` enforcement
- Onboarding flow now uses dynamically fetched recommended models instead of a hardcoded list, with a fallback to the welcome view on failure
- Add dedicated "Quota Exceeded" error message in the chat error UI when Cline account spend caps are hit
### Fixed
- Fix OOM crashes during long conversations by setting `--max-old-space-size=8192` for the cline-core Node.js process (was defaulting to ~2 GB)
- Show detailed error information in the chat error row instead of a generic caught error message
- Update `axios` to 1.15.0 across all packages
### Changed
- Remove foreground terminal mode — all task command execution now defaults to background mode, removing the VS Code integrated terminal dependency and related settings UI
- Remove old hardcoded announcement banners
## [3.79.0]
### Added
- Add Claude Opus 4.7 model support
- Add Azure Blob Storage as a storage provider
- Add `globalSkills` to remote config
- Inline value reuse in user-level remote-config discovery
### Fixed
- Fix cache reflection for Cline and Vercel API handlers
- Fix stuck `command_output` ask when terminal command ends unexpectedly
- Add `use_subagents` to system prompt for GLM, Hermes, and XS models
- Fix action injection security risk
### Changed
- Remove deprecated evals tool
## [3.78.0]
### Added
- Add a dedicated "Spend Limit Reached" error UI when spend caps are hit
- Docs updates
### Fixed
- Show actual `read_file` line ranges in chat UI
## [3.77.0]
### Added
- Add "Lazy Teammate Mode" experimental toggle
-`read_file` tool now supports chunked reading for targeted file access
### Fixed
- Exclude `new_task` tool from system prompt in yolo/headless mode
- Fix Kanban demo video formatting
### Changed
- Polish `Notification` hook functionality
## [3.76.0]
### Added
- Add Cline Kanban launch modal in webview; CLI now launches Kanban by default with a migration view
- Fix build complete handlers when updating the api config
- Fixed missing provider from list
- Fixed Favorite Icon / Star from getting clipped in the task history view
### Changed
- Make skills always enabled and remove feature toggle setting
## [3.56.0]
### Added
- **CLI authentication:** Added Vercel AI Gateway and Cline API key provider support for headless CI/automation workflows
- **New model:** Added Kimi-K2.5 model to Moonshot provider (262K context, image support, prompt caching)
- **Prompt variant:** Added Trinity Large prompt variant for improved tool-calling support
- **OpenTelemetry:** Added support for custom headers on metrics and logs endpoints
- **Social links:** Added community icons (X, Discord, GitHub, Reddit, LinkedIn) to the What's New modal
### Fixed
- **LiteLLM:** Fixed thinking configuration not appearing for reasoning-capable models
- **OpenTelemetry:** Fixed endpoint path handling (no longer incorrectly appends `/v1/logs` or `/v1/metrics`) and ensured logs are sent regardless of VSCode telemetry settings
- **CLI auth:** Fixed `cline auth` displaying incorrect provider information after configuration
### Changed
- **Hooks:** Hook scripts now run from the workspace repository root instead of filesystem root
- **Default settings:** Enabled multi-root workspaces, parallel tool calling, and skills by default; disabled strict plan mode by default
- **Settings UI:** Refreshed feature settings section with collapsible design
## [3.55.0]
- Add new model: Arcee Trinity Large Preview
- Add new model: Moonshot Kimi K2.5
- Add MCP prompts support - prompts from connected MCP servers now appear in slash command autocomplete as `/mcp:<server>:<prompt>`
## [3.54.0]
### Added
- Native tool calls support for Ollama provider
- Sonnet 4.5 is now the default Amazon Bedrock model id
### Fixed
- Prevent infinite retry loops when replace_in_file fails repeatedly. The system now detects repeated failures and provides better guidance to break out of retry cycles.
- Skip diff error UI handling during streaming to prevent flickering. Error handling is deferred until streaming completes.
- Strip notebook cell outputs when extracting text content from Jupyter notebooks, significantly reducing context size sent to the LLM.
- Throttle diff view updates during streaming to reduce UI flickering and improve performance.
### Changed
- Removed Mistral's Devstral-2512 free from the free models list
- Removed deprecated zai-glm-4.6 model from Cerebras provider
We actively patch only the most recent minor release of Cline. Older versions receive fixes at our discretion.
## Reporting a Vulnerability
We appreciate your efforts to responsibly disclose your findings and will make every effort to acknowledge your contributions.
To report a security issue, please submit your report through our [Bugcrowd Vulnerability Disclosure Program](https://bugcrowd.com/engagements/clinebot-vdp-ess). Bugcrowd will manage communication and triage on our behalf.
When reporting, please include:
- A short summary of the issue
- Steps to reproduce or a proof of concept
- Any logs, stack traces, or screenshots that might help us understand the problem
Please keep the details private until a resolution has been reached.
## Escalation
If you are unable to submit through Bugcrowd, you may send an email to security@cline.bot.
- Restore foreground terminal support and settings.
- Add latest OpenAI, SAP AI Core, and Z AI models.
### Fixed
- Fix hook template JSON escaping.
- Improve ripgrep file search error handling.
### Changed
- Remove hardcoded model lists from docs.
## [2.17.0]
### Added
- Add GPT-5.5 model support for OpenAI Codex subscription users.
### Changed
- Improve `cline-core` runtime memory diagnostics used by CLI:
- enable near-heap-limit heap snapshots
- add periodic memory usage logging
- log discovered heap snapshots on abnormal exits for easier OOM debugging
## [2.16.0]
### Added
- Wire up remote `globalSkills` from enterprise remote config with full toggle support and system prompt integration — enterprise-managed skills now support `alwaysEnabled` enforcement
- Add dedicated "Quota Exceeded" error message when Cline account spend caps are hit
### Fixed
- Fix OOM crashes during long conversations by setting `--max-old-space-size=8192` for the cline-core Node.js process (was defaulting to ~2 GB)
- Show detailed error information instead of a generic caught error message
- Update `axios` to 1.15.0 across all packages
### Changed
- Remove dead ACP terminal setter stubs as part of foreground terminal mode removal
## [2.15.0]
### Added
- Add Claude Opus 4.7 model support
- Inline value reuse in user-level remote-config discovery
- Add `globalSkills` to remote config
### Fixed
- Stabilize Windows CI test path handling
## [2.14.0]
### Added
- Simplify unified `cline update` flow for `cline` and `kanban`
- Docs updates
### Fixed
- Update Kanban migration view copy
## [2.12.0]
### Added
-`read_file` tool now supports chunked reading for targeted file access
### Fixed
- Exclude `new_task` tool from system prompt in yolo/headless mode
### Changed
- Polish `Notification` hook functionality
## [2.9.0]
### Added
- Latency improvements for remote workspaces
## [2.8.2]
### Fixed
- Use `kanban@latest` in `cline kanban` to always fetch the newest version
## [2.8.1]
### Added
- Implement dynamic free model detection for Cline API
- Add file read deduplication cache to prevent repeated reads
- Add feature tips tooltip during thinking state
### Fixed
- Fix flaky CLI Enter-key handling across Windows/test environments
- Replace error message when not logged in to Cline
- Align ClineRulesToggleModal padding with ServersToggleModal
- Skip WebP for GLM and Devstral models running through llama.cpp
- Respect user-configured context window in LiteLLM getModel()
- Honor explicit model IDs outside static catalog in W&B provider
- Add missing Fireworks serverless models and pricing
## [2.8.0]
### Added
- Added W&B Inference by CoreWeave as a new API provider with 17 models including DeepSeek-V3.1, Llama 4, and Qwen3-Coder
- Added CLI TUI end-to-end test suite
### Fixed
- Claude Code: handle rate limit events, empty content arrays, error results, and unknown content types without crashing
- CLI: `/q` and `/exit` slash commands now execute immediately on Enter without requiring the slash menu to be visible
- CLI: slash command filtering now prioritizes exact and prefix matches over fuzzy matches
## [2.7.0]
### Added
- Added MCP add shortcuts for stdio and HTTP servers
- Added `--continue` for the current directory
- Added `--auto-condense` flag for AI-powered context compaction
- Added `--hooks-dir` flag for runtime hook injection
- Enabled error autocapture
- Prompt rules now include test verification guidance and make `CLI_RULES` language-agnostic
### Fixed
- Fixed remount behavior so TUI remounts only on width resize
- Fixed startup prompt replay on resize remount
- Fixed task flags so they are applied before the welcome TUI mounts
### Changed
- Hooks: reintroduced feature toggle
## [2.6.1]
### Added
- Added GPT-5.4 models for ChatGPT subscription users
- Hooks: Added a `Notification` hook for attention and completion boundaries
- Added `--hooks-dir` CLI flag for runtime hook injection
- Added `--auto-approve-all` CLI flag for interactive mode
### Fixed
- Handle streamable HTTP MCP reconnects more reliably
## [2.6.0]
### Added
- Hook payloads now include `model.provider` and `model.slug`
- Token/cost updates now happen immediately as usage chunks arrive, not after tool execution
### Fixed
- Improve subagent context compaction logic
- Subagent stream retry delay increased to reduce noise from transient failures
- State serialization errors are now caught and logged instead of crashing
- Removed incorrect `max_tokens` from OpenRouter requests
## [2.5.2]
### Added
- Added Windows PowerShell support for hooks (execution, resolution, and management), improving hook behavior on Windows for CLI and shared core workflows.
### Fixed
- Restored GPT-OSS native file editing for OpenAI-compatible models used through shared core tooling.
- Improved OpenRouter context overflow error handling so auto-compaction triggers correctly for wrapped 400 errors.
- Hardened checkpoint recovery by retrying nested git restore and preventing silent `.git_disabled` leftovers.
- Added a User-Agent header for requests to the Cline back-end to improve request handling consistency.
## [2.5.1]
### Added
- Expanded CLI markdown rendering support (headings, lists, blockquotes, fenced code blocks, links, and nested lists).
### Fixed
- Fixed CLI headless auth provider model metadata loading for Cline and Vercel AI Gateway by fetching model info from API with cache fallback.
- Increased flaky CLI import test timeout on Windows CI to reduce intermittent test failures.
## [2.5.0]
### Added
- Added Cline SDK API interface for programmatic access to Cline features and tools, enabling integration into custom applications.
- Added Codex 5.3 model support
### Fixed
- Fix OpenAI Codex by setting `store` to `false`
- Use `isLocatedInPath()` instead of string matching for path containment checks
## [2.4.3]
### Added
- Add /q command to quit CLI
- Fetch featured models from backend with local fallback
### Fixed
- Fix auth check for ACP mode
- Fix Cline auth with ACP flag
- Fix yolo mode to not persist yolo setting to disk
## [2.4.2]
### Added
- Gemini-3.1 Pro Preview
### Patch Changes
- VSCode uses shared files for global, workspace and secret state.
## [2.4.1]
### Fixed
- Fix infinite retry loop when write_to_file fails with missing content parameter. Provides progressive guidance to the model, escalating from suggestions to hard stops, with context window awareness to break the loop.
## [2.4.0]
### Added
- Adding Anthropic Sonnet 4.6
- Allows users to enter custom aws region when selecting bedrock as a provider in CLI
- Keep reasoning rows visible when low-stakes tool groups start immediately after reasoning.
- Restore reasoning trace visibility in chat and improve the thinking row UX so streamed reasoning is visible, then collapsible after completion.
### Fixed
- Banners now display immediately when opening the extension instead of requiring user interaction first
- Resolved 17 security vulnerabilities including high-severity DoS issues in dependencies (body-parser, axios, qs, tar, and others)
## [2.2.2]
- Allows users to enter custom aws region when selecting bedrock as a provider
- Prevent Parent Container Scrolling In Dropdowns
## [2.2.1]
- Added Minimax 2.5 Free Promo
- Fixed Response chaining for OpenAI's Responses API
## [2.2.0]
### Added
- Subagent: replace legacy subagents with the native `use_subagents` tool
- Bundle `endpoints.json` support so packaged distributions can ship required endpoints out-of-the-box
- Amazon Bedrock: support parallel tool calling
- New "double-check completion" experimental feature to verify work before marking tasks complete
- CLI: new task controls/flags including custom `--thinking` token budget and `--max-consecutive-mistakes` for yolo runs
- Remote config: new UI/options (including connection/test buttons) and support for syncing deletion of remotely configured MCP servers
- Vertex / Claude Code: add 1M context model options for Claude Opus 4.6
- ZAI/GLM: add GLM-5
### Fixed
- CLI: handle stdin redirection correctly in CI/headless environments
- CLI: preserve OAuth callback paths during auth redirects
- VS Code Web: generate auth callback URLs via `vscode.env.asExternalUri` (OAuth callback reliability)
- Terminal: surface command exit codes in results and improve long-running `execute_command` timeout behavior
- UI: add loading indicator and fix `api_req_started` rendering
- Task streaming: prevent duplicate streamed text rows after completion
- API: preserve selected Vercel model when model metadata is missing
- Telemetry: route PostHog networking through proxy-aware shared fetch and ensure telemetry flushes on shutdown
- CI: increase Windows E2E test timeout to reduce flakiness
### Changed
- Settings/model UX: move "reasoning effort" into model configuration and expose it in settings
- CLI provider selection: limit provider list to those remotely configured
- UI: consolidate ViewHeader component/styling across views
- Tools: add auto-approval support for `attempt_completion` commands
- Remotely configured MCP server schema now supports custom headers
## [2.1.0]
### Minor Changes
- 42ce100: Add Generate API Key on Hicap Provider selection
### Patch Changes
- 195294f: Add support for bundled endpoints.json in enterprise distributions. Extensions can now include a pre-configured endpoints.json file that automatically switches Cline to self-hosted mode. Includes packaging scripts for VSIX, NPM, and JetBrains plugins.
- a1f2601: Replace the LiteLLM model list with a selector
- 739d75a: Add Claude Code provider support for Claude Opus 4.6 and Sonnet 4.5 1M variants via both full model names and aliases (`opus[1m]`, `sonnet[1m]`), and align the `opus` alias with Opus 4.6.
- 8440380: Add GitHub Actions workflow to build CLI from any commit for testing
- b1a8db2: fix(cli): prevent hang when spawned without TTY
- 7c87017: Add Claude Opus 4.6 model support
- d116ac5: Supports rendering markdown table in chat view.
- 6d8fb85: Fix CLI crashing in CI environments and with stdin redirection (e.g., `cline "prompt" < /dev/null`). Now checks both stdin and stdout TTY status before using Ink, and only errors on empty stdin when no prompt is provided.
- 70a9904: Fix JetBrains sign-in regression by adding fallback for openExternal RPC
- f440f3a: fix: use vscode.env.openExternal for auth in remote environments
Fixes OAuth authentication in VS Code Server and remote environments by routing browser URL opening through VS Code's native openExternal API instead of the npm 'open' package.
- 70a9904: fix: use vscode.env.asExternalUri for auth callback URLs only in VS Code Web
Fixes OAuth callback redirect in VS Code Web (`code serve-web`, Codespaces) by using `vscode.env.asExternalUri()` to resolve the callback URI. This is gated behind a `vscode.env.uiKind === UIKind.Web` check so regular desktop VS Code continues to use the `vscode://` URI directly. The `getCallbackUrl` API now accepts a `path` parameter so the full callback URI (including route) is resolved correctly, and callers pass their path directly instead of appending after.
- 5308ded: Updating script documentation and removing unnecessary continue on error
- b514f18: Prevent duplicate streamed text rows when a partial text update arrives after the same text was already finalized.
- 26391c9: Fix Bedrock model id
- d19a877: Unify ViewHeader Styles Across All Views
- 5dcaa8c: Add Vertex Claude Opus 4.6 1M model option and global endpoint support, and pass the 1M beta header for Vertex Claude requests.
The CLI directly imports and reuses the core Cline TypeScript codebase (the same code that powers the VS Code extension). This means feature parity is easy to maintain - when core gets updated, the CLI automatically benefits.
Unlike a client-server architecture, the CLI runs everything in a single Node.js process. The "host bridge" pattern provides terminal-appropriate implementations for things the VS Code extension would handle differently (clipboard, file dialogs, etc.).
### Key Files
| File | Purpose |
|------|---------|
| `src/index.ts` | Entry point, command definitions |
| `src/controllers/CliWebviewProvider.ts` | Bridges core messages to terminal output |
| `src/vscode-context.ts` | Mock VS Code extension context for core compatibility |
| `src/vscode-shim.ts` | Shims for VS Code APIs that core depends on |
| `src/constants/colors.ts` | Terminal color definitions |
### React Ink
The CLI uses [React Ink](https://github.com/vadimdemedes/ink) for its terminal UI. This lets us build the interface with React components that render to the terminal. Key patterns:
- Components in `src/components/` render terminal UI
- Hooks in `src/hooks/` manage terminal-specific state (size, scrolling)
- The `useStateSubscriber` hook subscribes to core state changes
## Configuration
The CLI stores its data in `~/.cline/data/` by default:
-`globalState.json`: Global settings and state
-`secrets.json`: API keys and secrets
-`workspace/`: Workspace-specific state
-`tasks/`: Task history and conversation data
Override with the `--config` option or `CLINE_DIR` environment variable.
## Troubleshooting
### Build Errors
If you encounter build errors:
```bash
# Make sure all deps are installed
npm run install:all
# Regenerate proto types
npm run protos
# Then rebuild
npm run cli:build
```
### "command not found: cline"
The CLI isn't linked globally. Run:
```bash
npm run cli:link
```
### Changes Not Reflected
If your code changes aren't showing up:
1. Make sure watch mode is running (`npm run cli:dev`)
2. Check for TypeScript errors in the watch output
3. Try unlinking and relinking: `npm run cli:unlink && npm run cli:link`
### Import Errors from Core
The CLI imports from `@core/`, `@shared/`, etc. These paths are defined in the root `tsconfig.json`. If you see import errors, make sure you're building from the repo root, not from inside `cli/`.
Meet Cline, an AI assistant that lives in your terminal.
Install Cline globally using npm:
Cline can handle complex software development tasks step-by-step. With tools that let him create & edit files, explore large projects, use the browser, and execute terminal commands (after you grant permission), he can assist you in ways that go beyond code completion or tech support.
```bash
npm install -g cline
```
npm i -g cline
## Usage
```bash
# cd into your project and run:
cline
```
This will start the Cline CLI interface where you can interact with the autonomous coding agent.
> Move your mouse around under the Cline icon for a surprise!
## Features
---
-**Autonomous Coding**: AI-powered code generation, editing, and refactoring
-**File Operations**: Create, read, update, and delete files and directories
-**Command Execution**: Run shell commands and scripts
-**Browser Automation**: Interact with web pages and applications
-**Multi-Model Support**: Works with Anthropic Claude, OpenAI GPT, and other AI models
-**MCP Integration**: Extensible through Model Context Protocol servers
-**Project Understanding**: Analyzes codebases to provide context-aware assistance
Cline supports API providers like ChatGPT, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure, GCP Vertex, Cerebras, Groq, and Moonshot. You can also configure any OpenAI compatible API, or use a local model through LM Studio/Ollama. If you're using a Cline Account, you'll always have access to the newest models as soon as they're available.
## Configuration
<!-- Transparent pixel to create line break after floating image -->
See the [main documentation](https://cline.bot) for detailed configuration options.
### Stay in Control with Human-in-the-Loop
## Links
Cline asks for your approval before running commands, editing files, or taking any action. Review each step and approve or reject as you go—or enable auto-approve to let Cline work autonomously to completion.
Toggle to Plan Mode to discuss implementation and architecture with Cline. He'll ask clarifying questions, explore your codebase, and present a plan for you to align on. Once you're satisfied, switch to Act Mode and let Cline execute the plan.
<!-- Transparent pixel to create line break after floating image -->
Get the same Cline experience with enterprise-grade controls: SSO (SAML/OIDC), global policies and configuration, observability with audit trails, private networking (VPC/private link), and self-hosted or on-prem deployments, and enterprise support. Learn more at our [enterprise page](https://cline.bot/enterprise) or [talk to us](https://cline.bot/contact-sales).
## License
Apache-2.0 - see [LICENSE](https://github.com/cline/cline/blob/main/LICENSE) for details.
The CLI is a **standalone terminal interface** for the Cline AI coding assistant, written in Go. It provides the same autonomous coding capabilities as the VS Code extension but runs entirely in the terminal.
| `env.go` | Clipboard access, version info, shutdown coordination |
| `window.go` | UI stubs (no-ops or console output) |
**Why this exists:** The same cline-core logic runs in VS Code and CLI. In VS Code, the "host" is the extension with editor APIs. In CLI, hostbridge emulates these capabilities with terminal-appropriate implementations.
---
## Key Design Decisions
1.**Two-process model:**`cline` CLI manages instances; `cline-core` is the actual AI engine (Node.js). This allows reusing the same core as the VS Code extension.
2.**Self-registration via SQLite:**`cline-core` registers itself in a SQLite database on startup. The CLI discovers instances by reading this database, enabling multi-instance support.
3.**Host bridge abstraction:** The `cline-host` process provides platform-specific operations (clipboard, workspace paths) via gRPC, allowing `cline-core` to remain host-agnostic.
4.**Streaming-first UI:** The CLI uses gRPC streaming to display AI responses in real-time with typewriter-style rendering.
5.**Dual stream handling:** Task manager subscribes to both state updates and partial messages, using deduplication to prevent duplicate rendering.
// Optional quality-of-life: allow skipping with -short when artifacts are absent
fmt.Fprintf(os.Stderr,"[e2e] skipping (-short) due to missing artifacts:\n %s\n",strings.Join(missing,"\n "))
os.Exit(0)
}
fmt.Fprintf(os.Stderr,"Missing required build artifacts for E2E tests:\n %s\n\nPlease build them first:\n npm run compile-standalone\n npm run compile-cli\n",strings.Join(missing,"\n "))
Try: cat README.md | cline "Summarize this for me:"
**cline** is a command-line interface for the Cline AI coding assistant. It provides the same powerful AI capabilities as the VS Code extension, directly in your terminal.
**cline** is a command-line interface for orchestrating multiple Cline AI coding agents. Cline is an autonomous AI agent who can read, write, and execute code across your projects. He operates through a client-server architecture where **Cline Core** runs as a standalone service, and the CLI acts as a scriptable interface for managing tasks, instances, and agent interactions.
Cline is an autonomous AI agent that can read, write, and execute code across your projects. He can create and edit files, run terminal commands, use a headless browser, and more—all while asking for your approval before taking actions.
The CLI is designed for both interactive use and automation, making it ideal for CI/CD pipelines, parallel task execution, and terminal-based workflows. Multiple frontends (CLI, VSCode, JetBrains) can attach to the same Cline Core instance, enabling seamless task handoff between environments.
The CLI supports both interactive mode (with a rich terminal UI) and plain text mode (for piped input and scripted workflows).
# MODES OF OPERATION
**Instant Task Mode**
**Interactive Mode** : When you run **cline** without arguments, it launches an interactive welcome prompt with a rich terminal UI. You can type your task, view conversation history, and interact with Cline in real-time.
: The simplest invocation:**cline "prompt here"** immediately spawns an instance, creates a task, and enters chat mode. This is equivalent to running **cline instance new && cline task new && cline task chat** in sequence.
**Task Mode** : Run **cline "prompt"** or**cline task "prompt"** to immediately start a task. If stdin is a TTY, you'll see the interactive UI. If stdin is piped or output is redirected, the CLI automatically switches to plain text mode.
**Subcommand Mode**
: Advanced usage with explicit control: **cline \<command\> [subcommand] [options]** provides fine-grained control over instances, tasks, authentication, and configuration.
**Plain Text Mode** : Activated automatically when stdin is piped, output is redirected, or **\--json**/**\--yolo** flags are used. Outputs clean text without the Ink UI, suitable for scripting and CI/CD pipelines.
# AGENT BEHAVIOR
Cline operates in two primary modes:
**ACT MODE**
**ACT MODE** : Cline actively uses tools to accomplish tasks. He can read files, write code, execute commands, use a headless browser, and more. This is the default mode for task execution.
: Cline actively uses tools to accomplish tasks. He can read files, write code, execute commands, use a headless browser, and more. This is the default mode for task execution.
**PLAN MODE**
: Cline gathers information and creates a detailed plan before implementation. He explores the codebase, asks clarifying questions, and presents a strategy for user approval before switching to ACT MODE.
# INSTANT TASK OPTIONS
When using the instant task syntax **cline "prompt"** the following options are available:
**-o**, **\--oneshot**
: Full autonomous mode. Cline completes the task and stops following after completion. Example: cline -o "what's 6 + 8?"
**-s**, **\--setting** *setting**value*
: Override a setting for this task
**-y**, **\--no-interactive**, **\--yolo**
: Enable fully autonomous mode. Disables all interactivity:
- ask_followup_question tool is disabled
- attempt_completion happens automatically
- execute_command runs in non-blocking mode with timeout
: Additional workspace paths. Can be specified multiple times to include multiple directories. The current working directory is always included as the first workspace. Example: cline -w /path/to/other/project "refactor shared code"
When you use **-F json**, the CLI prints each client message as JSON.
Each message is a **ClineMessage** object.
Required fields:
- **type**: "ask" or "say"
- **text**: message text
- **ts**: Unix epoch timestamp in milliseconds
Optional fields (omitted when empty):
- **reasoning**: reasoning text
- **say**: say subtype (present when type is "say")
- **ask**: ask subtype (present when type is "ask")
- **partial**: streaming flag
- **images**: list of image URIs
- **files**: list of file paths
- **lastCheckpointHash**: git checkpoint hash
- **isCheckpointCheckedOut**: checkpoint checkout flag
- **isOperationOutsideWorkspace**: workspace safety flag
**-h**, **\--help**
: Display help information for the command.
**-v**, **\--verbose**
: Enable verbose output for debugging.
**PLAN MODE** : Cline gathers information and creates a detailed plan before implementation. He explores the codebase, asks clarifying questions, and presents a strategy for user approval before switching to ACT MODE.
# COMMANDS
## Authentication
## task (alias: t)
**cline auth** [*provider*] [*key*]
Run a new task with a prompt.
**cline a**[*provider*] [*key*]
**cline task***prompt* [*options*]
: Configure authentication for AI model providers. Launches an interactive wizard if no arguments provided. If provider is specified without a key, prompts for the key or launches the appropriate OAuth flow.
**cline t***prompt* [*options*] : Create and run a new task. Options:
## Instance Management
**-a**, **\--act** : Run in act mode (default)
Cline Core instances are independent agent processes that can run in the background. Multiple instances can run simultaneously, enabling parallel task execution.
**-p**, **\--plan** : Run in plan mode
**cline instance**
**-y**, **\--yolo** : Enable yolo/yes mode (auto-approve all actions, output in plain mode, exit process automatically when task complete)
**cline i**
**-t**, **\--timeout** *seconds* : Optional timeout in seconds. Only applied when explicitly provided.
: Display instance management help.
**-m**, **\--model** *model* : Model to use for the task
**cline instance new** [**-d**|**\--default**]
**-i**, **\--images** *paths...* : Image file paths to include with the task
**cline i n** [**-d**|**\--default**]
**-v**, **\--verbose** : Show verbose output including reasoning
: Spawn a new Cline Core instance. Use **\--default** to set it as the default instance for subsequent commands.
**-c**, **\--cwd** *path* : Working directory for the task
**cline instance list**
**\--config** *path* : Path to Cline configuration directory
**\--json** : Output messages as JSON instead of styled text. Forces plain text mode.
Configuration can be set globally. Override these global settings for a task using the **\--setting** flag
**-T**, **\--taskId** *id* : Resume an existing task by ID instead of starting a new one. The prompt becomes an optional follow-up message.
**cline config**
**\--continue** : Resume the most recent task from the current working directory instead of starting a new one.
**cline c**
# JSON OUTPUT FORMAT
**cline config set***key**value*
When using**\--json**, each message is output as a JSON object with these fields:
**cline c s***key**value*
**Required fields:**
: Set a configuration variable.
- **type**: "ask" or "say"
- **text**: message text
- **ts**: Unix epoch timestamp in milliseconds
**cline config get***key*
**Optional fields:**
**cline c g***key*
- **reasoning**: reasoning text
- **say**: say subtype (when type is "say")
- **ask**: ask subtype (when type is "ask")
- **partial**: streaming flag
- **images**: list of image URIs
- **files**: list of file paths
: Read a configuration variable.
# EXAMPLES
**cline config list**
**cline c l**
: List all configuration variables and their values.
# TASK SETTINGS
Task settings are persisted in the *~/.cline/x/tasks* directory. When resuming a task with **cline task open**, task settings are automatically restored.
Common settings include:
**yolo**
: Enable autonomous mode (true/false)
**mode**
: Starting mode (act/plan)
# NOTES & EXAMPLES
The **cline task send** and **cline task new** commands support reading from stdin, enabling powerful pipeline compositions:
## Basic Usage
```bash
cat requirements.txt | cline task send
echo"Refactor this code"|cline -y
# Launch interactive mode
cline
# Run a task directly
cline "Create a hello world function in Python"
# Run with verbose output and extended thinking
cline -v --thinking "Analyze this codebase architecture"
```
## Instance Management
Manage multiple Cline instances:
## Mode Selection
```bash
# Start a new instance and make it default
cline instance new --default
# Run in plan mode (gather info before acting)
cline -p "Design a REST API for user management"
# List all running instances
cline instance list
# Run in act mode with auto-approval (yolo)
cline -y "Fix the typo in README.md"
```
# Kill a specific instance
cline instance kill localhost:50052
## Using Specific Models
# Kill all CLI instances
cline instance kill --all-cli
```bash
# Use a specific model
cline -m claude-sonnet-4-5-20250929 "Refactor this function"
**CLINE_DIR** : Override the default configuration directory. When set, Cline stores all data in this directory instead of `~/.cline/data/`.
: JSON configuration for restricting which shell commands Cline can execute. When set, commands are validated against allow/deny patterns before execution. When not set, all commands are allowed.
**CLINE_COMMAND_PERMISSIONS**: JSON configuration for restricting which shell commands Cline can execute. When set, commands are validated against allow/deny patternks before execution. When not set, all commands are allowed.
- **allow** (array of strings): Glob patterns for allowed commands. If specified, only matching commands are permitted. Uses `*` to match any characters and `?` to match a single character. Setting allow on anything will deny all others.
- **deny** (array of strings): Glob patterns for denied commands. Deny rules take precedence over allow rules.
- **allowRedirects** (boolean): Whether to allow shell redirects (`>`, `>>`, `<`, etc.). Defaults to false.
- **allow** (array of strings): Glob patterns for allowed commands. If specified, only matching commands are permitted. Uses `*` to match any characters and `?` to match a single character. Setting allow on anything will deny all others.
- **deny** (array of strings): Glob patterns for denied commands. Deny rules take precedence over allow rules.
- **allowRedirects** (boolean): Whether to allow shell redirects (`>`, `>>`, `<`, etc.). Defaults to false.
**Rule evaluation:**
**Rule evaluation:**
1. Check for dangerous characters (backticks outside single quotes, unquoted newlines)
2. Parse command into segments split by operators (`&&`, `||`, `|`, `;`)
3. If redirects detected and `allowRedirects` is not true, command is denied
4. Each segment is validated against deny rules first, then allow rules
5. Subshell contents (`$(...)` and `(...)`) are recursively validated
6. All segments must pass for the command to be allowed
1. Check for dangerous characters (backticks outside single quotes, unquoted newlines)
2. Parse command into segments split by operators (`&&`, `||`, `|`, `;`)
3. If redirects detected and `allowRedirects` is not true, command is denied
4. Each segment is validated against deny rules first, then allow rules
5. Subshell contents (`$(...)` and `(...)`) are recursively validated
6. All segments must pass for the command to be allowed
returncline.ApiProvider_BEDROCK,fmt.Errorf("bedrock provider is not supported for quick setup due to complex authentication requirements. Please use interactive setup: cline auth")
}
// Map provider string to enum using existing function
return"","",fmt.Errorf("failed to get API key: %w",err)
}
// For OpenAI (Compatible) provider, prompt for base URL
ifprovider==cline.ApiProvider_OPENAI{
varbaseURLstring
baseURLForm:=huh.NewForm(
huh.NewGroup(
huh.NewInput().
Title("Base URL (optional, for OpenAI-compatible providers)").
Placeholder("e.g., https://api.example.com/v1").
Value(&baseURL).
Description("Press Enter to skip if using standard OpenAI API"),
),
)
iferr:=baseURLForm.Run();err!=nil{
return"","",fmt.Errorf("failed to get base URL: %w",err)
}
returnapiKey,baseURL,nil
}
returnapiKey,"",nil
}
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.