Skip to content

Commit 5bf1b3c

Browse files
authored
Merge branch 'main' into renovate/tailwind-merge-3.x
2 parents 0870be5 + 7392f14 commit 5bf1b3c

File tree

89 files changed

+2070
-287
lines changed

Some content is hidden

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

89 files changed

+2070
-287
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Roo Code Changelog
22

3+
## [3.21.2] - 2025-06-20
4+
5+
- Add LaTeX math equation rendering in chat window
6+
- Add toggle for excluding MCP server tools from the prompt (thanks @Rexarrior!)
7+
- Add symlink support to list_files tool
8+
- Fix marketplace blanking after populating
9+
- Fix recursive directory scanning in @ mention "Add Folder" functionality (thanks @village-way!)
10+
- Resolve phantom subtask display on cancel during API retry
11+
- Correct Gemini 2.5 Flash pricing (thanks @daniel-lxs!)
12+
- Resolve marketplace timeout issues and display installed MCPs (thanks @daniel-lxs!)
13+
- Onboarding tweaks to emphasize modes (thanks @brunobergher!)
14+
- Rename 'Boomerang Tasks' to 'Task Orchestration' for clarity
15+
- Remove command execution from attempt_completion
16+
- Fix markdown for links followed by punctuation (thanks @xyOz-dev!)
17+
318
## [3.21.1] - 2025-06-19
419

520
- Fix tree-sitter issues that were preventing codebase indexing from working correctly

packages/cloud/src/AuthService.ts

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { RefreshTimer } from "./RefreshTimer"
1111
import { getUserAgent } from "./utils"
1212

1313
export interface AuthServiceEvents {
14+
"attempting-session": [data: { previousState: AuthState }]
1415
"inactive-session": [data: { previousState: AuthState }]
1516
"active-session": [data: { previousState: AuthState }]
1617
"logged-out": [data: { previousState: AuthState }]
@@ -26,7 +27,7 @@ type AuthCredentials = z.infer<typeof authCredentialsSchema>
2627

2728
const AUTH_STATE_KEY = "clerk-auth-state"
2829

29-
type AuthState = "initializing" | "logged-out" | "active-session" | "inactive-session"
30+
type AuthState = "initializing" | "logged-out" | "active-session" | "attempting-session" | "inactive-session"
3031

3132
const clerkSignInResponseSchema = z.object({
3233
response: z.object({
@@ -93,6 +94,7 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
9394
private credentials: AuthCredentials | null = null
9495
private sessionToken: string | null = null
9596
private userInfo: CloudUserInfo | null = null
97+
private isFirstRefreshAttempt: boolean = false
9698

9799
constructor(context: vscode.ExtensionContext, log?: (...args: unknown[]) => void) {
98100
super()
@@ -129,7 +131,7 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
129131
this.credentials.clientToken !== credentials.clientToken ||
130132
this.credentials.sessionId !== credentials.sessionId
131133
) {
132-
this.transitionToInactiveSession(credentials)
134+
this.transitionToAttemptingSession(credentials)
133135
}
134136
} else {
135137
if (this.state !== "logged-out") {
@@ -156,19 +158,32 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
156158
this.log("[auth] Transitioned to logged-out state")
157159
}
158160

159-
private transitionToInactiveSession(credentials: AuthCredentials): void {
161+
private transitionToAttemptingSession(credentials: AuthCredentials): void {
160162
this.credentials = credentials
161163

162164
const previousState = this.state
163-
this.state = "inactive-session"
165+
this.state = "attempting-session"
164166

165167
this.sessionToken = null
166168
this.userInfo = null
169+
this.isFirstRefreshAttempt = true
167170

168-
this.emit("inactive-session", { previousState })
171+
this.emit("attempting-session", { previousState })
169172

170173
this.timer.start()
171174

175+
this.log("[auth] Transitioned to attempting-session state")
176+
}
177+
178+
private transitionToInactiveSession(): void {
179+
const previousState = this.state
180+
this.state = "inactive-session"
181+
182+
this.sessionToken = null
183+
this.userInfo = null
184+
185+
this.emit("inactive-session", { previousState })
186+
172187
this.log("[auth] Transitioned to inactive-session state")
173188
}
174189

@@ -329,16 +344,27 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
329344
/**
330345
* Check if the user is authenticated
331346
*
332-
* @returns True if the user is authenticated (has an active or inactive session)
347+
* @returns True if the user is authenticated (has an active, attempting, or inactive session)
333348
*/
334349
public isAuthenticated(): boolean {
335-
return this.state === "active-session" || this.state === "inactive-session"
350+
return (
351+
this.state === "active-session" || this.state === "attempting-session" || this.state === "inactive-session"
352+
)
336353
}
337354

338355
public hasActiveSession(): boolean {
339356
return this.state === "active-session"
340357
}
341358

359+
/**
360+
* Check if the user has an active session or is currently attempting to acquire one
361+
*
362+
* @returns True if the user has an active session or is attempting to get one
363+
*/
364+
public hasOrIsAcquiringActiveSession(): boolean {
365+
return this.state === "active-session" || this.state === "attempting-session"
366+
}
367+
342368
/**
343369
* Refresh the session
344370
*
@@ -364,6 +390,9 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
364390
if (error instanceof InvalidClientTokenError) {
365391
this.log("[auth] Invalid/Expired client token: clearing credentials")
366392
this.clearCredentials()
393+
} else if (this.isFirstRefreshAttempt && this.state === "attempting-session") {
394+
this.isFirstRefreshAttempt = false
395+
this.transitionToInactiveSession()
367396
}
368397
this.log("[auth] Failed to refresh session", error)
369398
throw error

packages/cloud/src/CloudService.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class CloudService {
4040
this.authService = new AuthService(this.context, this.log)
4141
await this.authService.initialize()
4242

43+
this.authService.on("attempting-session", this.authListener)
4344
this.authService.on("inactive-session", this.authListener)
4445
this.authService.on("active-session", this.authListener)
4546
this.authService.on("logged-out", this.authListener)
@@ -89,6 +90,11 @@ export class CloudService {
8990
return this.authService!.hasActiveSession()
9091
}
9192

93+
public hasOrIsAcquiringActiveSession(): boolean {
94+
this.ensureInitialized()
95+
return this.authService!.hasOrIsAcquiringActiveSession()
96+
}
97+
9298
public getUserInfo(): CloudUserInfo | null {
9399
this.ensureInitialized()
94100
return this.authService!.getUserInfo()
@@ -152,6 +158,8 @@ export class CloudService {
152158

153159
public dispose(): void {
154160
if (this.authService) {
161+
this.authService.off("attempting-session", this.authListener)
162+
this.authService.off("inactive-session", this.authListener)
155163
this.authService.off("active-session", this.authListener)
156164
this.authService.off("logged-out", this.authListener)
157165
this.authService.off("user-info", this.authListener)

packages/cloud/src/SettingsService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { RefreshTimer } from "./RefreshTimer"
1414
const ORGANIZATION_SETTINGS_CACHE_KEY = "organization-settings"
1515

1616
export class SettingsService {
17-
1817
private context: vscode.ExtensionContext
1918
private authService: AuthService
2019
private settings: OrganizationSettings | undefined = undefined
@@ -43,6 +42,10 @@ export class SettingsService {
4342
this.removeSettings()
4443
}
4544

45+
this.authService.on("attempting-session", () => {
46+
this.timer.start()
47+
})
48+
4649
this.authService.on("active-session", () => {
4750
this.timer.start()
4851
})
@@ -52,7 +55,7 @@ export class SettingsService {
5255
this.removeSettings()
5356
})
5457

55-
if (this.authService.hasActiveSession()) {
58+
if (this.authService.hasOrIsAcquiringActiveSession()) {
5659
this.timer.start()
5760
}
5861
}
@@ -120,5 +123,4 @@ export class SettingsService {
120123
public dispose(): void {
121124
this.timer.stop()
122125
}
123-
124126
}

0 commit comments

Comments
 (0)