Skip to content

Commit 0ff9b74

Browse files
committed
bugs in React & Next template
1 parent a0bbcee commit 0ff9b74

File tree

30 files changed

+52
-54
lines changed

30 files changed

+52
-54
lines changed

Roo-Code/apps/web-evals/src/app/runs/new/new-run.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function NewRun() {
9494
async (values: CreateRun) => {
9595
try {
9696
if (mode === "openrouter") {
97-
values.settings = { ...(values.settings || {}), openRouterModelId: model }
97+
values.settings = { ...values.settings, openRouterModelId: model }
9898
}
9999

100100
const { id } = await createRun(values)

Roo-Code/packages/cloud/src/TelemetryClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ abstract class BaseTelemetryClient implements TelemetryClient {
6060
// Event properties take precedence in case of conflicts.
6161
const mergedProperties = {
6262
...providerProperties,
63-
...(event.properties || {}),
63+
...event.properties,
6464
}
6565

6666
// Filter out properties that shouldn't be captured by this client

Roo-Code/packages/telemetry/src/BaseTelemetryClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export abstract class BaseTelemetryClient implements TelemetryClient {
5151

5252
// Merge provider properties with event-specific properties.
5353
// Event properties take precedence in case of conflicts.
54-
const mergedProperties = { ...providerProperties, ...(event.properties || {}) }
54+
const mergedProperties = { ...providerProperties, ...event.properties }
5555

5656
// Filter out properties that shouldn't be captured by this client
5757
return Object.fromEntries(Object.entries(mergedProperties).filter(([key]) => this.isPropertyCapturable(key)))

Roo-Code/packages/telemetry/src/TelemetryService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class TelemetryService {
198198
itemType,
199199
itemName,
200200
target,
201-
...(properties || {}),
201+
...properties,
202202
})
203203
}
204204

Roo-Code/src/__tests__/command-mentions.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ npm install
218218

219219
describe("command mention regex patterns", () => {
220220
it("should match valid command mention patterns anywhere", () => {
221-
const commandRegex = /\/([a-zA-Z0-9_\.-]+)(?=\s|$)/g
221+
const commandRegex = /\/([a-zA-Z0-9_.-]+)(?=\s|$)/g
222222

223223
const validPatterns = ["/setup", "/build-prod", "/test_suite", "/my-command", "/command123"]
224224

@@ -230,19 +230,19 @@ npm install
230230
})
231231

232232
it("should match command patterns in middle of text", () => {
233-
const commandRegex = /\/([a-zA-Z0-9_\.-]+)(?=\s|$)/g
233+
const commandRegex = /\/([a-zA-Z0-9_.-]+)(?=\s|$)/g
234234

235235
const validPatterns = ["Please /setup", "Run /build now", "Use /deploy here"]
236236

237237
validPatterns.forEach((pattern) => {
238238
const match = pattern.match(commandRegex)
239239
expect(match).toBeTruthy()
240-
expect(match![0]).toMatch(/^\/[a-zA-Z0-9_\.-]+$/)
240+
expect(match![0]).toMatch(/^\/[a-zA-Z0-9_.-]+$/)
241241
})
242242
})
243243

244244
it("should match commands at start of new lines", () => {
245-
const commandRegex = /\/([a-zA-Z0-9_\.-]+)(?=\s|$)/g
245+
const commandRegex = /\/([a-zA-Z0-9_.-]+)(?=\s|$)/g
246246

247247
const multilineText = "First line\n/setup the project\nAnother line\n/deploy when ready"
248248
const matches = multilineText.match(commandRegex)
@@ -255,7 +255,7 @@ npm install
255255
})
256256

257257
it("should match multiple commands in message", () => {
258-
const commandRegex = /(?:^|\s)\/([a-zA-Z0-9_\.-]+)(?=\s|$)/g
258+
const commandRegex = /(?:^|\s)\/([a-zA-Z0-9_.-]+)(?=\s|$)/g
259259

260260
const validText = "/setup the project\nThen /deploy later"
261261
const matches = validText.match(commandRegex)
@@ -267,7 +267,7 @@ npm install
267267
})
268268

269269
it("should not match invalid command patterns", () => {
270-
const commandRegex = /\/([a-zA-Z0-9_\.-]+)(?=\s|$)/g
270+
const commandRegex = /\/([a-zA-Z0-9_.-]+)(?=\s|$)/g
271271

272272
const invalidPatterns = ["/ space", "/with space", "/with/slash", "//double", "/with@symbol"]
273273

Roo-Code/src/activate/registerCodeActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const registerCodeAction = (context: vscode.ExtensionContext, command: CodeActio
4040
}
4141

4242
const params = {
43-
...{ filePath, selectedText },
43+
filePath, selectedText,
4444
...(startLine !== undefined ? { startLine: startLine.toString() } : {}),
4545
...(endLine !== undefined ? { endLine: endLine.toString() } : {}),
4646
...(diagnostics ? { diagnostics } : {}),

Roo-Code/src/api/providers/bedrock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
823823
* match[4] - The resource ID (e.g., "anthropic.claude-3-sonnet-20240229-v1:0")
824824
*/
825825

826-
const arnRegex = /^arn:aws:(?:bedrock|sagemaker):([^:]+):([^:]*):(?:([^\/]+)\/([\w\.\-:]+)|([^\/]+))$/
826+
const arnRegex = /^arn:aws:(?:bedrock|sagemaker):([^:]+):([^:]*):(?:([^/]+)\/([\w.\-:]+)|([^/]+))$/
827827
let match = arn.match(arnRegex)
828828

829829
if (match && match[1] && match[3] && match[4]) {

Roo-Code/src/api/providers/openai.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
4646

4747
const headers = {
4848
...DEFAULT_HEADERS,
49-
...(this.options.openAiHeaders || {}),
49+
...this.options.openAiHeaders,
5050
}
5151

5252
const timeout = getApiRequestTimeout()
@@ -459,7 +459,7 @@ export async function getOpenAiModels(baseUrl?: string, apiKey?: string, openAiH
459459
const config: Record<string, any> = {}
460460
const headers: Record<string, string> = {
461461
...DEFAULT_HEADERS,
462-
...(openAiHeaders || {}),
462+
...openAiHeaders,
463463
}
464464

465465
if (apiKey) {

Roo-Code/src/api/providers/router-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export abstract class RouterProvider extends BaseProvider {
5050
apiKey,
5151
defaultHeaders: {
5252
...DEFAULT_HEADERS,
53-
...(options.openAiHeaders || {}),
53+
...options.openAiHeaders,
5454
},
5555
})
5656
}

Roo-Code/src/api/transform/cache-strategy/__tests__/cache-strategy.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const defaultModelInfo: ModelInfo = {
1818
const createConfig = (overrides: Partial<CacheStrategyConfig> = {}): CacheStrategyConfig => ({
1919
modelInfo: {
2020
...defaultModelInfo,
21-
...(overrides.modelInfo || {}),
21+
...overrides.modelInfo,
2222
},
2323
systemPrompt: "You are a helpful assistant",
2424
messages: [],

0 commit comments

Comments
 (0)