chrome-devtools-frontend 1.0.1748523
“Chrome DevTools UI”
ADODB.Stream SaveToFile method callActiveXObject constructor reference
SHA-25680d1053272823fd75f8acd5d1c20855806165b235e3a78873c12e106b5db4901
Evidence
1---
2name: devtools/models-and-core/core-ai-agent-context-and-prompt-discipline
3rubric: design
4severity: should_fix
5---
6
7**Rule.** Keep AI agent prompts, tool schemas, and data formatters deterministic, token-efficient, and decoupled from UI and locale state
8- **Look for**: Localized `i18nString` calls or verbose boilerplate prose inside AI data formatters, unsorted flag/property lists in prompt serializers, AI tools missing permission policy declarations, or monolithic trace models passed to response widgets.
9- **Do not flag**: User-facing UI labels rendered in the AI assistance panel chrome rather than sent to the LLM.
10
11**Why.** AI agent data formatters (`models/ai_assistance/data_formatters/`) must produce deterministic, unlocalized, concise text representations decoupled from UI widgets and trace insight models, while tools must declare explicit permission policies and flatten verbose CDP types.
12
13## Examples
14
15Bad:
16
17```ts
18export function formatInsightForPrompt(insight: Insight): string {
19 return `Here is a detailed explanation: ${i18nString(UIStrings.localizedSummary)}`;
20}
21```
22
23Good:
⋯6 lines
1---
2name: devtools/models-and-core/core-cdp-and-extension-error-handling
3rubric: correctness
4severity: blocking
5---
6
7**Rule.** Handle CDP ProtocolResponseWithError and ContentDataOrError explicitly, release RemoteObject handles in finally blocks, and return Promises
8- **Look for**: `try { await ...invoke_*() }` or `try { await request.requestContentData() }` blocks, `Runtime.evaluate` calls creating `RemoteObject`s without `release()` in `finally`, callback-taking SDK methods instead of `Promise`, or `reject(rawObject)` in `ExtensionAPI.ts`.
9- **Do not flag**: `try/catch` blocks that wrap subsequent throwing operations like `JSON.parse()`. Properties marked required (non-optional) in generated `front_end/generated/protocol.ts` CDP types (do not ask for redundant runtime null/undefined checks on them), or `node.shadowRoots()[0]` accesses (elements have at most one shadow root; the array return type is a legacy Shadow DOM v0 artifact).
10
11**Why.** CDP agent calls and `requestContentData()` resolve to error-bearing response objects (`getError()`, `ContentData.isError()`) rather than throwing, so wrapping them in `try/catch` is misleading. Furthermore, temporary `RemoteObject` handles must be released in `finally` blocks, and extension APIs must reject with sanitized `Error` instances.
12
13## Examples
14
15Bad:
16
17```ts
18try {
19 const content = await request.requestContentData();
20 process(content.text);
21} catch (err) {
⋯13 lines
1---
2name: code-review
3description: Generic checklist for reviewing DevTools CLs (your own before upload, or someone else's on Gerrit). Covers test correctness (tautological/vacuous tests, cleanup, leaks), code clarity, CL hygiene, and points to the specialized skills to consult for imports, UI, testing, strings, models, and verification. Use …
3:361… atch, or to self-review before `git cl upload`.
4---
5
6# Code Review
7
8This checklist comes from recurring reviewer feedback on landed DevTools CLs.
9Use it for self-review before upload and for reviewing other people's CLs.
10
11## 1. Gather context
12
13- **Automated Review Agent (diff already in prompt):** Do not run shell
14 commands. Use `read_file` to inspect enclosing classes/functions/tests and
15 `search_files` to verify callers or conventions across the repository.
16- ** …
138:8… w DOM". Check that the setting being toggled actually affects the
139 scenario.
140- **E2E async rendering & split-view selectors:** Watch for two common E2E
141 selector races:
142 - **Async `requestUpdate()` state …
Showing the top 5 files — 6 more files (105 regions) not shown.
No evidence locations were recorded for this file. Raw result