Skip to content

Commit 2111832

Browse files
author
Serge H.
committed
Merge remote-tracking branch 'upstream/main'
2 parents d4edcea + 3ffe61f commit 2111832

File tree

155 files changed

+5326
-1008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+5326
-1008
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs v20.18.1
1+
nodejs 20.18.1

.vscodeignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ vsc-extension-quickstart.md
2020
**/.vscode-test.*
2121

2222
# Custom
23-
demo.gif
2423
.nvmrc
2524
.gitattributes
2625
.prettierignore
@@ -51,6 +50,8 @@ webview-ui/node_modules/**
5150
# Include default themes JSON files used in getTheme
5251
!src/integrations/theme/default-themes/**
5352

53+
# Ignore doc assets
54+
assets/docs/**
5455
# Include icons and images
5556
!assets/icons/**
5657
!assets/images/**

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@
77
- Add LiteLLM provider support - adapted from Cline's implementation (PR #1618) - allowing connection to any LLM via a LiteLLM proxy server. Includes configuration for API URL, API Key, and Model ID, plus cost calculation support via the `/spend/calculate` endpoint.
88

99
=======
10+
## [3.11.15] - 2025-04-13
11+
12+
- Add ability to filter task history by workspace (thanks @samhvw8!)
13+
- Fix Node.js version in the .tool-versions file (thanks @bogdan0083!)
14+
- Fix duplicate suggested mentions for open tabs (thanks @samhvw8!)
15+
- Fix Bedrock ARN validation and token expiry issue when using profiles (thanks @vagadiya!)
16+
- Add Anthropic option to pass API token as Authorization header instead of X-Api-Key (thanks @mecab!)
17+
- Better documentation for adding new settings (thanks @KJ7LNW!)
18+
- Localize package.json (thanks @samhvw8!)
19+
- Add option to hide the welcome message and fix the background color for the new profile dialog (thanks @zhangtony239!)
20+
- Restore the focus ring for the VSCodeButton component (thanks @pokutuna!)
21+
22+
## [3.11.14] - 2025-04-11
23+
24+
- Support symbolic links in rules folders to directories and other symbolic links (thanks @taisukeoe!)
25+
- Stronger enforcement of the setting to always read full files instead of doing partial reads
26+
27+
## [3.11.13] - 2025-04-11
28+
29+
- Loads of terminal improvements: command delay, PowerShell counter, and ZSH EOL mark (thanks @KJ7LNW!)
30+
- Add file context tracking system (thanks @samhvw8 and @canvrno!)
31+
- Improved display of diff errors + easy copying for investigation
32+
- Fixes to .vscodeignore (thanks @franekp!)
33+
- Fix a zh-CN translation for model capabilities (thanks @zhangtony239!)
34+
- Rename AWS Bedrock to Amazon Bedrock (thanks @ronyblum!)
35+
- Update extension title and description (thanks @StevenTCramer!)
1036

1137
## [3.11.12] - 2025-04-09
1238

README.md

Lines changed: 23 additions & 0 deletions
Large diffs are not rendered by default.

cline_docs/settings.md

Lines changed: 132 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -183,59 +183,59 @@ These steps ensure that:
183183

184184
To add a new configuration item to the system, the following changes are necessary:
185185

186-
1. **Feature-Specific Class** (if applicable)
186+
1. **Feature-Specific Class** (if applicable)
187187

188188
- For settings that affect specific features (e.g., Terminal, Browser, etc.)
189189
- Add a static property to store the value
190190
- Add getter/setter methods to access and modify the value
191191

192-
2. **Schema Definition**
192+
2. **Schema Definition**
193193

194194
- Add the item to globalSettingsSchema in schemas/index.ts
195195
- Add the item to globalSettingsRecord in schemas/index.ts
196196

197-
3. **Type Definitions**
197+
3. **Type Definitions**
198198

199199
- Add the item to exports/types.ts
200200
- Add the item to exports/roo-code.d.ts
201201
- Add the item to shared/ExtensionMessage.ts
202202
- Add the item to shared/WebviewMessage.ts
203203

204-
4. **UI Component**
204+
4. **UI Component**
205205

206206
- Create or update a component in webview-ui/src/components/settings/
207207
- Add appropriate slider/input controls with min/max/step values
208208
- Ensure the props are passed correctly to the component in SettingsView.tsx
209209
- Update the component's props interface to include the new settings
210210

211-
5. **Translations**
211+
5. **Translations**
212212

213213
- Add label and description in webview-ui/src/i18n/locales/en/settings.json
214214
- Update all other languages
215215
- If any language content is changed, synchronize all other languages with that change
216216
- Translations must be performed within "translation" mode so change modes for that purpose
217217

218-
6. **State Management**
218+
6. **State Management**
219219

220220
- Add the item to the destructuring in SettingsView.tsx
221221
- Add the item to the handleSubmit function in SettingsView.tsx
222222
- Add the item to getStateToPostToWebview in ClineProvider.ts
223223
- Add the item to getState in ClineProvider.ts with appropriate default values
224224
- Add the item to the initialization in resolveWebviewView in ClineProvider.ts
225225

226-
7. **Message Handling**
226+
7. **Message Handling**
227227

228228
- Add a case for the item in webviewMessageHandler.ts
229229

230-
8. **Implementation-Specific Logic**
230+
8. **Implementation-Specific Logic**
231231

232232
- Implement any feature-specific behavior triggered by the setting
233233
- Examples:
234234
- Environment variables for terminal settings
235235
- API configuration changes for provider settings
236236
- UI behavior modifications for display settings
237237

238-
9. **Testing**
238+
9. **Testing**
239239

240240
- Add test cases for the new settings in appropriate test files
241241
- Verify settings persistence and state updates
@@ -305,40 +305,139 @@ To add a new configuration item to the system, the following changes are necessa
305305

306306
11. **Debugging Settings Persistence Issues**
307307

308-
If a setting is not persisting across reload, check the following:
308+
If a setting is not persisting across reload, check the following:
309309

310-
1. **Complete Chain of Persistence**:
310+
1. **Complete Chain of Persistence**:
311311

312-
- Verify that the setting is added to all required locations:
313-
- globalSettingsSchema and globalSettingsRecord in schemas/index.ts
314-
- Initial state in ExtensionStateContextProvider
315-
- getState method in ClineProvider.ts
316-
- getStateToPostToWebview method in ClineProvider.ts
317-
- resolveWebviewView method in ClineProvider.ts (if feature-specific)
318-
- A break in any part of this chain can prevent persistence
312+
- Verify that the setting is added to all required locations:
313+
- globalSettingsSchema and globalSettingsRecord in schemas/index.ts
314+
- Initial state in ExtensionStateContextProvider
315+
- getState method in ClineProvider.ts
316+
- getStateToPostToWebview method in ClineProvider.ts
317+
- resolveWebviewView method in ClineProvider.ts (if feature-specific)
318+
- A break in any part of this chain can prevent persistence
319319

320-
2. **Default Values Consistency**:
320+
2. **Default Values Consistency**:
321321

322-
- Ensure default values are consistent across all locations
323-
- Inconsistent defaults can cause unexpected behavior
322+
- Ensure default values are consistent across all locations
323+
- Inconsistent defaults can cause unexpected behavior
324324

325-
3. **Message Handling**:
325+
3. **Message Handling**:
326326

327-
- Confirm the webviewMessageHandler.ts has a case for the setting
328-
- Verify the message type matches what's sent from the UI
327+
- Confirm the webviewMessageHandler.ts has a case for the setting
328+
- Verify the message type matches what's sent from the UI
329329

330-
4. **UI Integration**:
330+
4. **UI Integration**:
331331

332-
- Check that the setting is included in the handleSubmit function in SettingsView.tsx
333-
- Ensure the UI component correctly updates the state
332+
- Check that the setting is included in the handleSubmit function in SettingsView.tsx
333+
- Ensure the UI component correctly updates the state
334334

335-
5. **Type Definitions**:
335+
5. **Type Definitions**:
336336

337-
- Verify the setting is properly typed in all relevant interfaces
338-
- Check for typos in property names across different files
337+
- Verify the setting is properly typed in all relevant interfaces
338+
- Check for typos in property names across different files
339339

340-
6. **Storage Mechanism**:
341-
- For complex settings, ensure proper serialization/deserialization
342-
- Check that the setting is being correctly stored in VSCode's globalState
340+
6. **Storage Mechanism**:
341+
- For complex settings, ensure proper serialization/deserialization
342+
- Check that the setting is being correctly stored in VSCode's globalState
343343

344344
These checks help identify and resolve common issues with settings persistence.
345+
346+
12. **Advanced Troubleshooting: The Complete Settings Persistence Chain**
347+
348+
Settings persistence requires a complete chain of state management across multiple components. Understanding this chain is critical for both humans and AI to effectively troubleshoot persistence issues:
349+
350+
1. **Schema Definition (Entry Point)**:
351+
352+
- Settings must be properly defined in `globalSettingsSchema` and `globalSettingsRecord`
353+
- Enum values should use proper zod schemas: `z.enum(["value1", "value2"])`
354+
- Example:
355+
356+
```typescript
357+
// In schemas/index.ts
358+
export const globalSettingsSchema = z.object({
359+
// Existing settings...
360+
commandRiskLevel: z.enum(["readOnly", "reversibleChanges", "complexChanges"]).optional(),
361+
})
362+
363+
const globalSettingsRecord: GlobalSettingsRecord = {
364+
// Existing settings...
365+
commandRiskLevel: undefined,
366+
}
367+
```
368+
369+
2. **UI Component (User Interaction)**:
370+
371+
- Must use consistent components (Select vs. select) with other similar settings
372+
- Must use `setCachedStateField` for state updates, not direct state setting
373+
- Must generate the correct message type through `vscode.postMessage`
374+
- Example:
375+
```tsx
376+
// In a settings component
377+
<Select value={commandRiskLevel} onValueChange={(value) => setCachedStateField("commandRiskLevel", value)}>
378+
<SelectTrigger className="w-full">
379+
<SelectValue placeholder={t("settings:common.select")} />
380+
</SelectTrigger>
381+
<SelectContent>
382+
<SelectGroup>
383+
<SelectItem value="readOnly">{t("label.readOnly")}</SelectItem>
384+
{/* Other options... */}
385+
</SelectGroup>
386+
</SelectContent>
387+
</Select>
388+
```
389+
390+
3. **Message Handler (State Saving)**:
391+
392+
- Must use correct message type in `webviewMessageHandler.ts`
393+
- Must use `updateGlobalState` with properly typed values
394+
- Must call `postStateToWebview` after updates
395+
- Example:
396+
```typescript
397+
// In webviewMessageHandler.ts
398+
case "commandRiskLevel":
399+
await updateGlobalState(
400+
"commandRiskLevel",
401+
(message.text ?? "readOnly") as "readOnly" | "reversibleChanges" | "complexChanges"
402+
)
403+
await provider.postStateToWebview()
404+
break
405+
```
406+
407+
4. **State Retrieval (Reading State)**:
408+
409+
- In `getState`, state must be properly retrieved from stateValues
410+
- In `getStateToPostToWebview`, the setting must be in the destructured parameters
411+
- The setting must be included in the return value
412+
- Use `contextProxy.getGlobalState` for direct access when needed
413+
- Example:
414+
415+
```typescript
416+
// In ClineProvider.ts getStateToPostToWebview
417+
const {
418+
// Other state properties...
419+
commandRiskLevel,
420+
} = await this.getState()
421+
422+
return {
423+
// Other state properties...
424+
commandRiskLevel: commandRiskLevel ?? "readOnly",
425+
}
426+
```
427+
428+
5. **Debugging Strategies**:
429+
430+
- **Follow the State Flow**: Watch the setting's value at each step in the chain
431+
- **Type Safety**: Ensure the same type is used throughout the chain
432+
- **Component Consistency**: Use the same pattern as other working settings
433+
- **Check Return Values**: Ensure the setting is included in all return objects
434+
- **State vs. Configuration**: Understand when to use state vs. VSCode configuration
435+
436+
6. **Common Pitfalls**:
437+
- **Type Mismatch**: Using string where an enum is expected
438+
- **Chain Breaks**: Missing the setting in return objects
439+
- **UI Inconsistency**: Using different component patterns
440+
- **DefaultValue Issues**: Inconsistent default values across components
441+
- **Missing Schema**: Not adding to schema or record definitions
442+
443+
Remember: A break at ANY point in this chain can cause persistence failures. When troubleshooting, systematically check each link in the chain to identify where the issue occurs.

evals/.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nodejs v20.18.1
21
python 3.13.2
32
golang 1.24.2
43
rust 1.85.1
4+
nodejs 20.18.1

evals/apps/cli/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
"execa": "^9.5.2",
1717
"gluegun": "^5.1.2",
1818
"p-map": "^7.0.3",
19-
"p-wait-for": "^5.0.2"
19+
"p-wait-for": "^5.0.2",
20+
"ps-tree": "^1.2.0"
2021
},
2122
"devDependencies": {
2223
"@evals/eslint-config": "workspace:^",
23-
"@evals/typescript-config": "workspace:^"
24+
"@evals/typescript-config": "workspace:^",
25+
"@types/ps-tree": "^1.1.6"
2426
}
2527
}

0 commit comments

Comments
 (0)