Skip to content

Commit 1eed57e

Browse files
merge upstream/main (a4f774b) into vps2/n5-ack-history
Hand-resolved the MessageTarget union (keep viewStateClaim + diagnosticsRequest) and the ClineProvider diagnostic dispatch (non-awaiting postMessage with diagnostics recording and the drop log).
2 parents f789fc8 + a4f774b commit 1eed57e

359 files changed

Lines changed: 4920 additions & 9325 deletions

File tree

Some content is hidden

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

‎.github/workflows/code-qa.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ jobs:
7070
install-args: "--frozen-lockfile"
7171
- name: Verify all translations are complete
7272
run: node scripts/find-missing-translations.js
73+
- name: Verify t() calls pass every interpolation variable
74+
run: node scripts/check-i18n-interpolation.js
7375

7476
knip:
7577
runs-on: ubuntu-latest

‎.github/workflows/solheim-provider-smoke.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
pnpm --filter @roo-code/vscode-webview build
4242
4343
- name: Install display dependencies
44+
timeout-minutes: 5
4445
run: sudo apt-get update && sudo apt-get install -y xvfb ffmpeg libasound2t64
4546

4647
- name: Run Solheim provider smoke
@@ -73,6 +74,7 @@ jobs:
7374
path: |
7475
${{ runner.temp }}/solheim-provider-smoke/verdict.json
7576
${{ runner.temp }}/solheim-provider-smoke/trace.json
77+
${{ runner.temp }}/solheim-provider-smoke/sidebar-focus.json
7678
if-no-files-found: error
7779
retention-days: 7
7880

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// i18next splits a namespace from a key on ":" only. t("chat.foo") has no namespace, so it looks in the
2+
// default namespace, misses, and shows the raw key to the user. Built-in no-restricted-syntax only.
3+
import { readdirSync } from "node:fs"
4+
import { basename } from "node:path"
5+
6+
/**
7+
* @param {URL | string} enLocalesDir The `en` locale directory. Each JSON file name is a namespace.
8+
*/
9+
export function createI18nDotKeyConfig(enLocalesDir) {
10+
const namespaces = readdirSync(enLocalesDir)
11+
.filter((file) => file.endsWith(".json"))
12+
.map((file) => basename(file, ".json"))
13+
const dotKey = `/^(${namespaces.join("|")})\\./`
14+
const message = "Write the key as 'namespace:path'. A dot after the namespace is not a namespace separator."
15+
16+
return {
17+
files: ["**/*.ts", "**/*.tsx"],
18+
ignores: ["**/__tests__/**", "**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx"],
19+
rules: {
20+
"no-restricted-syntax": [
21+
"error",
22+
...i18nDotKeySelectors(dotKey).map((selector) => ({ selector, message })),
23+
],
24+
},
25+
}
26+
}
27+
28+
/** The selectors alone, for a file set that already sets no-restricted-syntax. */
29+
export function getI18nDotKeySelectors(config) {
30+
return config.rules["no-restricted-syntax"].slice(1)
31+
}
32+
33+
function i18nDotKeySelectors(dotKey) {
34+
const call = "CallExpression:matches([callee.name='t'], [callee.property.name='t'])"
35+
return [`${call}[arguments.0.value=${dotKey}]`, `${call}[arguments.0.quasis.0.value.cooked=${dotKey}]`]
36+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import assert from "node:assert/strict"
2+
import { describe, it } from "node:test"
3+
import { URL } from "node:url"
4+
5+
import { Linter } from "eslint"
6+
import typescriptEslint from "typescript-eslint"
7+
8+
import { createI18nDotKeyConfig } from "./i18n-keys.js"
9+
10+
const linter = new Linter({ configType: "flat" })
11+
const config = [
12+
{ files: ["**/*.ts", "**/*.tsx"], languageOptions: { parser: typescriptEslint.parser } },
13+
createI18nDotKeyConfig(new URL("../../webview-ui/src/i18n/locales/en", import.meta.url)),
14+
]
15+
16+
const lint = (code, filename = "components/example.tsx") =>
17+
linter.verify(code, config, { filename }).map((message) => message.message)
18+
19+
describe("i18n dot-form keys", () => {
20+
for (const code of [
21+
't("chat.commandExecution.exitStatus", { exitCode })',
22+
'i18next.t("settings.autoApprove.title")',
23+
"t(`chat.errors.${name}`)",
24+
"t(`chat\\u002ecommandExecution.exitStatus`)",
25+
]) {
26+
it(`flags: ${code}`, () => {
27+
assert.equal(lint(code).length, 1)
28+
})
29+
}
30+
31+
for (const code of [
32+
't("chat:commandExecution.exitStatus", { exitCode })',
33+
't("unknownNamespace.key")',
34+
"t(`chat:errors.${name}`)",
35+
]) {
36+
it(`allows: ${code}`, () => {
37+
assert.deepEqual(lint(code), [])
38+
})
39+
}
40+
41+
it("does not apply to spec files", () => {
42+
assert.deepEqual(lint('t("chat.key")', "components/__tests__/example.spec.tsx"), [])
43+
})
44+
})

‎packages/config-eslint/package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
"./react": "./react.js",
88
"./next-js": "./next.js",
99
"./provider-identifiers": "./provider-identifiers.js",
10-
"./api-provider-hygiene": "./api-provider-hygiene.js"
10+
"./api-provider-hygiene": "./api-provider-hygiene.js",
11+
"./i18n-keys": "./i18n-keys.js"
1112
},
1213
"scripts": {
1314
"lint": "eslint . --max-warnings=0",
14-
"test": "node --test provider-identifiers.test.js api-provider-hygiene.test.js"
15+
"test": "node --test provider-identifiers.test.js api-provider-hygiene.test.js i18n-keys.test.js"
1516
},
1617
"devDependencies": {
1718
"@eslint/js": "9.39.5",

‎packages/types/src/task.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ export type TaskEvents = {
147147
[RooCodeEventName.TaskPaused]: [taskId: string]
148148
[RooCodeEventName.TaskUnpaused]: [taskId: string]
149149
[RooCodeEventName.TaskSpawned]: [taskId: string]
150+
[RooCodeEventName.TaskDelegated]: [childTaskId: string]
151+
[RooCodeEventName.TaskDelegationCompleted]: [childTaskId: string, summary: string]
152+
[RooCodeEventName.TaskDelegationResumed]: [childTaskId: string]
150153

151154
// Task Execution
152155
[RooCodeEventName.Message]: [{ action: "created" | "updated"; message: ClineMessage }]

‎packages/types/src/vscode-extension-host.ts‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export interface ExtensionMessage {
112112
| "rooHistoryImportProgress"
113113
| "themeFixtureProbeRequest"
114114
| "viewStateClaim"
115+
| "diagnosticsRequest"
115116
text?: string
116117
/** For fileContent: { path, content, error? } */
117118
fileContent?: { path: string; content: string | null; error?: string }
@@ -178,6 +179,7 @@ export interface ExtensionMessage {
178179
/** For `viewStateClaim`: the host-minted token the webview stores and echoes on launch. */
179180
viewStateClaim?: string
180181
themeFixture?: WebviewThemeFixture
182+
diagnostics?: WebviewDiagnosticsSnapshot
181183
promptText?: string
182184
results?:
183185
| { path: string; type: "file" | "folder"; label?: string }[]
@@ -475,6 +477,40 @@ export type ClineAskResponse = "yesButtonClicked" | "noButtonClicked" | "message
475477

476478
export type AudioType = "notification" | "celebration" | "progress_loop"
477479

480+
export interface WebviewDiagnosticsSnapshot {
481+
capturedAt: string
482+
didHydrateState?: boolean
483+
documentReadyState?: "loading" | "interactive" | "complete"
484+
documentVisibilityState?: "hidden" | "visible" | "prerender"
485+
activeView?: string
486+
rootMounted?: boolean
487+
rootChildCount?: number
488+
lastReceivedStateSequence?: number
489+
lastAppliedStateSequence?: number
490+
staleStateRejectionCount?: number
491+
unknownMessageUpdateCount?: number
492+
currentTaskId?: string
493+
chatMessageCount?: number
494+
historyItemCount?: number
495+
todoCount?: number
496+
viewport?: { width: number; height: number; devicePixelRatio: number }
497+
theme?: {
498+
kind?: number
499+
identifier?: string
500+
bodyForeground?: string
501+
bodyBackground?: string
502+
rootForeground?: string
503+
rootBackground?: string
504+
variables?: Record<string, string>
505+
}
506+
error?: {
507+
name?: string
508+
message?: string
509+
fingerprint?: string
510+
stackLocations?: string[]
511+
}
512+
}
513+
478514
export interface UpdateTodoListPayload {
479515
// eslint-disable-next-line @typescript-eslint/no-explicit-any
480516
todos: any[]
@@ -678,6 +714,7 @@ export interface WebviewMessage {
678714
| "openRuleFile"
679715
| "openRulesDirectory"
680716
| "themeFixtureProbeResponse"
717+
| "diagnosticsResponse"
681718
text?: string
682719
viewStateId?: string
683720
/** For `webviewDidLaunch`: the claim delivered for `viewStateId`, enforced by setViewStateId. */
@@ -728,6 +765,7 @@ export interface WebviewMessage {
728765
newSkillModeSlugs?: string[] // For updateSkillModes (new mode restrictions)
729766
requestId?: string
730767
themeFixture?: WebviewThemeFixture
768+
diagnostics?: WebviewDiagnosticsSnapshot
731769
ids?: string[]
732770
terminalOperation?: "continue" | "abort"
733771
messageTs?: number

‎packages/types/src/vscode.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const commandIds = [
4949
"toggleAutoApprove",
5050

5151
"showRipgrepDiagnostic",
52+
"createDiagnosticsReport",
5253
] as const
5354

5455
export type CommandId = (typeof commandIds)[number]

‎pnpm-lock.yaml‎

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/agent-evals/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ Execution limits are enforced, not decorative. The controller applies the
3030
activation, task start, task run, usage drain, and teardown step limits, and
3131
the trace records the measured durations.
3232

33+
Two launch options are off by default. `testsPath` adds `--extensionTestsPath`
34+
to the VS Code launch; that module's `run()` must never settle, because VS Code
35+
exits once it does. `holdBeforeTeardownMs` holds the finished task on screen
36+
for that window after the completion message, before teardown starts.
37+
3338
## Structured trace
3439

3540
Each run writes `trace.json` with `traceSchemaVersion: 1`. The trace is

0 commit comments

Comments
 (0)