Skip to content

Commit faf2ee5

Browse files
authored
Merge branch 'RooCodeInc:main' into main
2 parents 6745c8f + fb374b3 commit faf2ee5

File tree

100 files changed

+2972
-840
lines changed

Some content is hidden

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

100 files changed

+2972
-840
lines changed

src/core/config/CustomModesManager.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,14 @@ export class CustomModesManager {
401401

402402
public async updateCustomMode(slug: string, config: ModeConfig): Promise<void> {
403403
try {
404+
// Validate the mode configuration before saving
405+
const validationResult = modeConfigSchema.safeParse(config)
406+
if (!validationResult.success) {
407+
const errors = validationResult.error.errors.map((e) => e.message).join(", ")
408+
logger.error(`Invalid mode configuration for ${slug}`, { errors: validationResult.error.errors })
409+
throw new Error(`Invalid mode configuration: ${errors}`)
410+
}
411+
404412
const isProjectMode = config.source === "project"
405413
let targetPath: string
406414

src/core/environment/getEnvironmentDetails.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,12 @@ export async function getEnvironmentDetails(cline: Task, includeFileDetails: boo
179179
// Add current time information with timezone.
180180
const now = new Date()
181181

182-
const formatter = new Intl.DateTimeFormat(undefined, {
183-
year: "numeric",
184-
month: "numeric",
185-
day: "numeric",
186-
hour: "numeric",
187-
minute: "numeric",
188-
second: "numeric",
189-
hour12: true,
190-
})
191-
192-
const timeZone = formatter.resolvedOptions().timeZone
182+
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
193183
const timeZoneOffset = -now.getTimezoneOffset() / 60 // Convert to hours and invert sign to match conventional notation
194184
const timeZoneOffsetHours = Math.floor(Math.abs(timeZoneOffset))
195185
const timeZoneOffsetMinutes = Math.abs(Math.round((Math.abs(timeZoneOffset) - timeZoneOffsetHours) * 60))
196186
const timeZoneOffsetStr = `${timeZoneOffset >= 0 ? "+" : "-"}${timeZoneOffsetHours}:${timeZoneOffsetMinutes.toString().padStart(2, "0")}`
197-
details += `\n\n# Current Time\n${formatter.format(now)} (${timeZone}, UTC${timeZoneOffsetStr})`
187+
details += `\n\n# Current Time\nCurrent time in ISO 8601 UTC format: ${now.toISOString()}\nUser time zone: ${timeZone}, UTC${timeZoneOffsetStr}`
198188

199189
// Add context tokens information.
200190
const { contextTokens, totalCost } = getApiMetrics(cline.clineMessages)

0 commit comments

Comments
 (0)