Skip to content

Commit ab1e965

Browse files
authored
Merge pull request #1272 from Kilo-Org/roo-v3.23.6
[wip] Include changes from Roo Code v3.23.6
2 parents 02cabe9 + 25e83bf commit ab1e965

File tree

296 files changed

+17612
-3859
lines changed

Some content is hidden

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

296 files changed

+17612
-3859
lines changed

.changeset/tall-parts-march.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
"kilo-code": minor
3+
---
4+
5+
Include changes from Roo Code v3.23.6
6+
7+
- Move codebase indexing out of experimental (thanks @daniel-lxs and @MuriloFP!)
8+
- Add todo list tool (thanks @qdaxb!)
9+
- Fix code index secret persistence and improve settings UX (thanks @daniel-lxs!)
10+
- Add Gemini embedding provider for codebase indexing (thanks @SannidhyaSah!)
11+
- Support full endpoint URLs in OpenAI Compatible provider (thanks @SannidhyaSah!)
12+
- Add markdown support to codebase indexing (thanks @MuriloFP!)
13+
- Add Search/Filter Functionality to API Provider Selection in Settings (thanks @GOODBOY008!)
14+
- Add configurable max search results (thanks @MuriloFP!)
15+
- Add copy prompt button to task actions (thanks @Juice10 and @vultrnerd!)
16+
- Fix insertContentTool to create new files with content (thanks @Ruakij!)
17+
- Fix typescript compiler watch path inconsistency (thanks @bbenshalom!)
18+
- Use actual max_completion_tokens from OpenRouter API (thanks @shariqriazz!)
19+
- Prevent completion sound from replaying when reopening completed tasks (thanks @SannidhyaSah!)
20+
- Fix access_mcp_resource fails to handle images correctly (thanks @s97712!)
21+
- Prevent chatbox focus loss during automated file editing (thanks @hannesrudolph!)
22+
- Resolve intermittent hangs and lack of clear error feedback in apply_diff tool (thanks @lhish!)
23+
- Resolve Go duplicate references in tree-sitter queries (thanks @MuriloFP!)
24+
- Chat UI consistency and layout shifts (thanks @seedlord!)
25+
- Chat index UI enhancements (thanks @MuriloFP!)
26+
- Fix model search being prefilled on dropdown (thanks @kevinvandijk!)
27+
- Improve chat UI - add camera icon margin and make placeholder non-selectable (thanks @MuriloFP!)
28+
- Delete .roo/rules-{mode} folder when custom mode is deleted
29+
- Enforce file restrictions for all edit tools in architect mode
30+
- Add User-Agent header to API providers
31+
- Fix auto question timer unmount (thanks @liwilliam2021!)
32+
- Fix new_task tool streaming issue
33+
- Optimize file listing when maxWorkspaceFiles is 0 (thanks @daniel-lxs!)
34+
- Correct export/import of OpenAI Compatible codebase indexing settings (thanks @MuriloFP!)
35+
- Resolve workspace path inconsistency in code indexing for multi-workspace scenarios
36+
- Always show the code indexing dot under the chat text area
37+
- Fix bug where auto-approval was intermittently failing
38+
- Remove erroneous line from announcement modal
39+
- Update chat area icons for better discoverability & consistency
40+
- Fix a bug that allowed list_files to return directory results that should be excluded by .gitignore
41+
- Add an overflow header menu to make the UI a little tidier (thanks @dlab-anton)
42+
- Fix a bug the issue where null custom modes configuration files cause a 'Cannot read properties of null' error (thanks @daniel-lxs!)
43+
- Replace native title attributes with StandardTooltip component for consistency (thanks @daniel-lxs!)
44+
- Fix: use decodeURIComponent in openFile (thanks @vivekfyi!)
45+
- Fix(embeddings): Translate error messages before sending to UI (thanks @daniel-lxs!)
46+
- Make account tab visible
47+
- Grok 4

.kilocode/rules/rules.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
- Ensure all tests pass before submitting changes
77
- The vitest framework is used for testing; the `describe`, `test`, `it`, etc functions are defined by default in `tsconfig.json` and therefore don't need to be imported
88
- Tests must be run from the same directory as the `package.json` file that specifies `vitest` in `devDependencies`
9+
- Run tests with: `npx vitest <relative-path-from-workspace-root>`
10+
- Do NOT run tests from project root - this causes "vitest: command not found" error
11+
- Tests must be run from inside the correct workspace:
12+
- Backend tests: `cd src && npx vitest path/to/test-file` (don't include `src/` in path)
13+
- UI tests: `cd webview-ui && npx vitest src/path/to/test-file`
14+
- Example: For `src/tests/user.test.ts`, run `cd src && npx vitest tests/user.test.ts` NOT `npx vitest src/tests/user.test.ts`
915

1016
2. Lint Rules:
1117

@@ -15,7 +21,3 @@
1521
- Use Tailwind CSS classes instead of inline style objects for new markup
1622
- VSCode CSS variables must be added to webview-ui/src/index.css before using them in Tailwind classes
1723
- Example: `<div className="text-md text-vscode-descriptionForeground mb-2" />` instead of style objects
18-
19-
# Adding a New Setting
20-
21-
To add a new setting that persists its state, follow the steps in docs/settings.md

packages/cloud/src/CloudService.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import { TelemetryService } from "@roo-code/telemetry"
1212
import { CloudServiceCallbacks } from "./types"
1313
import type { AuthService } from "./auth"
1414
import { WebAuthService, StaticTokenAuthService } from "./auth"
15-
import { SettingsService } from "./SettingsService"
15+
import type { SettingsService } from "./SettingsService"
16+
import { CloudSettingsService } from "./CloudSettingsService"
17+
import { StaticSettingsService } from "./StaticSettingsService"
1618
import { TelemetryClient } from "./TelemetryClient"
1719
import { ShareService, TaskNotFoundError } from "./ShareService"
1820

@@ -59,13 +61,20 @@ export class CloudService {
5961
this.authService.on("logged-out", this.authListener)
6062
this.authService.on("user-info", this.authListener)
6163

62-
this.settingsService = new SettingsService(
63-
this.context,
64-
this.authService,
65-
() => this.callbacks.stateChanged?.(),
66-
this.log,
67-
)
68-
this.settingsService.initialize()
64+
// Check for static settings environment variable
65+
const staticOrgSettings = process.env.ROO_CODE_CLOUD_ORG_SETTINGS
66+
if (staticOrgSettings && staticOrgSettings.length > 0) {
67+
this.settingsService = new StaticSettingsService(staticOrgSettings, this.log)
68+
} else {
69+
const cloudSettingsService = new CloudSettingsService(
70+
this.context,
71+
this.authService,
72+
() => this.callbacks.stateChanged?.(),
73+
this.log,
74+
)
75+
cloudSettingsService.initialize()
76+
this.settingsService = cloudSettingsService
77+
}
6978

7079
this.telemetryClient = new TelemetryClient(this.authService, this.settingsService)
7180

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import * as vscode from "vscode"
2+
3+
import {
4+
ORGANIZATION_ALLOW_ALL,
5+
OrganizationAllowList,
6+
OrganizationSettings,
7+
organizationSettingsSchema,
8+
} from "@roo-code/types"
9+
10+
import { getRooCodeApiUrl } from "./Config"
11+
import type { AuthService } from "./auth"
12+
import { RefreshTimer } from "./RefreshTimer"
13+
import type { SettingsService } from "./SettingsService"
14+
15+
const ORGANIZATION_SETTINGS_CACHE_KEY = "organization-settings"
16+
17+
export class CloudSettingsService implements SettingsService {
18+
private context: vscode.ExtensionContext
19+
private authService: AuthService
20+
private settings: OrganizationSettings | undefined = undefined
21+
private timer: RefreshTimer
22+
private log: (...args: unknown[]) => void
23+
24+
constructor(
25+
context: vscode.ExtensionContext,
26+
authService: AuthService,
27+
callback: () => void,
28+
log?: (...args: unknown[]) => void,
29+
) {
30+
this.context = context
31+
this.authService = authService
32+
this.log = log || console.log
33+
34+
this.timer = new RefreshTimer({
35+
callback: async () => {
36+
return await this.fetchSettings(callback)
37+
},
38+
successInterval: 30000,
39+
initialBackoffMs: 1000,
40+
maxBackoffMs: 30000,
41+
})
42+
}
43+
44+
public initialize(): void {
45+
this.loadCachedSettings()
46+
47+
// Clear cached settings if we have missed a log out.
48+
if (this.authService.getState() == "logged-out" && this.settings) {
49+
this.removeSettings()
50+
}
51+
52+
this.authService.on("active-session", () => {
53+
this.timer.start()
54+
})
55+
56+
this.authService.on("logged-out", () => {
57+
this.timer.stop()
58+
this.removeSettings()
59+
})
60+
61+
if (this.authService.hasActiveSession()) {
62+
this.timer.start()
63+
}
64+
}
65+
66+
private async fetchSettings(callback: () => void): Promise<boolean> {
67+
const token = this.authService.getSessionToken()
68+
69+
if (!token) {
70+
return false
71+
}
72+
73+
try {
74+
const response = await fetch(`${getRooCodeApiUrl()}/api/organization-settings`, {
75+
headers: {
76+
Authorization: `Bearer ${token}`,
77+
},
78+
})
79+
80+
if (!response.ok) {
81+
this.log(
82+
"[cloud-settings] Failed to fetch organization settings:",
83+
response.status,
84+
response.statusText,
85+
)
86+
return false
87+
}
88+
89+
const data = await response.json()
90+
const result = organizationSettingsSchema.safeParse(data)
91+
92+
if (!result.success) {
93+
this.log("[cloud-settings] Invalid organization settings format:", result.error)
94+
return false
95+
}
96+
97+
const newSettings = result.data
98+
99+
if (!this.settings || this.settings.version !== newSettings.version) {
100+
this.settings = newSettings
101+
await this.cacheSettings()
102+
callback()
103+
}
104+
105+
return true
106+
} catch (error) {
107+
this.log("[cloud-settings] Error fetching organization settings:", error)
108+
return false
109+
}
110+
}
111+
112+
private async cacheSettings(): Promise<void> {
113+
await this.context.globalState.update(ORGANIZATION_SETTINGS_CACHE_KEY, this.settings)
114+
}
115+
116+
private loadCachedSettings(): void {
117+
this.settings = this.context.globalState.get<OrganizationSettings>(ORGANIZATION_SETTINGS_CACHE_KEY)
118+
}
119+
120+
public getAllowList(): OrganizationAllowList {
121+
return this.settings?.allowList || ORGANIZATION_ALLOW_ALL
122+
}
123+
124+
public getSettings(): OrganizationSettings | undefined {
125+
return this.settings
126+
}
127+
128+
private async removeSettings(): Promise<void> {
129+
this.settings = undefined
130+
await this.cacheSettings()
131+
}
132+
133+
public dispose(): void {
134+
this.timer.stop()
135+
}
136+
}

0 commit comments

Comments
 (0)