Add ADE browser CLI proof flow#512
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Review limit reached
More reviews will be available in 10 minutes and 48 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (35)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@copilot review but do not make fixes |
|
@copilot review but do not make fixes |
6d1388f to
5647e78
Compare
|
@copilot review but do not make fixes |
Summary
Validation
npm --prefix apps/ade-cli run testnpm --prefix apps/ade-cli run typechecknpm --prefix apps/ade-cli run buildnpm --prefix apps/desktop run typechecknpm --prefix apps/desktop run lint(passes with existing warnings)npm --prefix apps/desktop run buildnpx vitest run src/main/services/builtInBrowser/builtInBrowserService.test.ts src/main/services/builtInBrowser/builtInBrowserWebAuthn.test.ts src/main/services/computerUse/computerUseArtifactBrokerService.test.tsnpx vitest run src/renderer/components/chat/AgentChatComposer.test.tsx src/renderer/components/chat/AgentChatPane.test.tsx src/renderer/components/terminals/WorkSidebar.test.tsx src/renderer/components/terminals/WorkViewArea.test.tsxnpm --prefix apps/ade-cli run typecheck,npm --prefix apps/desktop run typecheck, and targeted desktop browser/chat testsRisks
Greptile Summary
This PR adds a comprehensive ADE browser agent control layer: project-scoped browser profiles (partition-per-project via SHA-256 key), session management (
startSession/listSessions/endSession), a full observation pipeline (screenshot + DOM snapshot + element map + diagnostics written to.ade/cache/browser-observations), and agent action commands (click,fill,typeText,dispatchKey,scroll,clear,wait). The desktop bridge is extended to expose all new methods, the CLI gains ~830 lines of new sub-commands underbrowser session …,browser observe,browser proof, etc., and the renderer now shows per-tab ownership badges and reads the dynamic browser partition for webview creation.normalizeAdeBrowserWebviewPartitioninmain.tsvalidates that renderer-provided partition strings match the expected format before allowing them.writeObservationpersists screenshots and DOM snapshots to disk,pruneObservationDirectorytrims stale scratch files, element handles (obs-…:e:<n>) are verified throughsanitizePathSegmentand a tab-ID cross-check before anyfs.readFile.work-startreplaces separatechat/clistorage keys for saved drafts; a multi-key read picks up the most-recently-updated snapshot for backward compatibility.Confidence Score: 5/5
sanitizePathSegmentto all user-derived path components, the webview partition is validated against a strict regex, tab leases enforce ownership without silent bypass, and the session/observation pipeline handles error cases (destroyed WebContents, missing project root, stale prune failures) gracefully. The draft-storage migration is backward-compatible via multi-key reads. No data-loss, auth, or correctness issues were found across the changed files.Important Files Changed
path.join. Logic is well-guarded.readValue/readFlagsplices from args in place). TheautoNewOwnedTabheuristic correctly creates isolated tabs for ADE-launched agents.normalizeAdeBrowserWebviewPartitionvalidates partition strings via regex before setting them on webviews;getWindowForProjectRootnow passesforeground: falseto avoid unwanted focus side-effects on passive reads.statusRef.current?.partitionfor webview creation (project-scoped), adds per-tab ownership badge display, and updates navigation method signatures to acceptBrowserTabTargetArgs.work-startkey;readLatestComposerDraftSnapshotandreadLatestLastLaunchConfigprovide backward-compat multi-key reads picking the most recently updated snapshot.configureBuiltInBrowserSessionWebAuthn; aWeakSet<Session>prevents duplicate listeners; Touch ID default now auto-enables on packaged builds without requiring the env var.projectRootinjection viawithProjectRootwrapper on all bridge calls, enabling the desktop service to route to the correct per-project window service without the CLI knowing which window is active.BuiltInBrowserStatus.partitionnow reflects the dynamic profile partition instead of a literal string type.Sequence Diagram
sequenceDiagram participant CLI as ade-cli (browser commands) participant Bridge as desktopBridgeClient participant Server as desktopBridgeServer participant Outer as createBuiltInBrowserService (outer) participant Inner as createBuiltInBrowserWindowService (per-window) participant FS as Filesystem (.ade/cache) participant CDP as Electron WebContents (CDP) CLI->>Bridge: "callBridge("observe", { projectRoot, tabId, ... })" Bridge->>Bridge: withProjectRoot(params) – inject projectRoot Bridge->>Server: JSON-RPC built_in_browser.observe Server->>Outer: service.observe(params) Outer->>Outer: serviceForInput(input) – route by projectRoot → window Outer->>Inner: inner.observe(input) Inner->>CDP: capturePageScreenshot CDP-->>Inner: base64 PNG Inner->>CDP: Runtime.evaluate(BROWSER_DOM_FUNCTION) CDP-->>Inner: DOM snapshot Inner->>FS: "writeFile(obs-*.png)" Inner->>FS: "writeFile(obs-*.json)" Inner->>Inner: pruneObservationDirectory(dir, keepCount) Inner->>FS: "writeFile(obs-*.json) — update cleanup stats" Inner-->>Outer: BuiltInBrowserObservation Outer-->>Server: observation Server-->>Bridge: JSON-RPC result Bridge-->>CLI: observation (filePath, elementMap, dom, …)Reviews (2): Last reviewed commit: "ship: iteration 1 - address browser revi..." | Re-trigger Greptile