Instructions that are relevant when working with the Chrome Remote Desktop (aka. CRD and chromoting) host binaries, or code located in //remoting.
While code for the Chrome Remote Desktop host lives in the Chromium repo (this repo), it is mostly an independent product, separate from Chrome, except for ChromeOS, where the IT2ME native messaging host is part of the Chrome binary.
When working on specific domains, you MUST use the read_file tool to load these documents:
Testing: See docs/testing.md if you are writing, modifying, or debugging tests.
Architecture & IPC: See docs/architecture.md if you are modifying host architecture, IPC, or adding/removing processes.
Native Client: See client/GEMINI.md if you are working on the native client code (ChromeOS/Boca).
D-Bus Interface Generation: See host/linux/dbus_interfaces/GEMINI.md if you need to generate missing D-Bus headers for Linux.
Linux Host Implementation Details: See host/linux/GEMINI.md for information about Linux-specific libraries like GVariant and D-Bus wrappers.
CRD host processes often run with high privileges (e.g., SYSTEM on Windows, root on Linux) while receiving input from the network. You MUST be extremely careful with memory safety, bounds checking, and input sanitization. Correctness is critical to prevent security vulnerabilities.
Code in //remoting is built for many platforms. The file suffix often indicates conditional compilation:
_chromeos.cc: ChromeOS specific.
_mac.cc / _mac.mm: MacOS specific
_posix.cc: Linux and MacOS.
_win.cc: Windows specific.
_wayland.cc: Linux/Wayland specific.
_x11.cc: Linux/X11 specific.
Cross-Platform Testing Limits: Always be aware of the host OS you are currently running on (e.g., Linux). Do NOT attempt to build or run tests for a different platform locally (e.g., do not try to build Mac-only code or run ChromeOS-specific tests on a Linux workstation).
Try-Bots (git cl try): If you modify code for a platform that cannot be tested locally, stop and inform the user. Suggest using git cl try to verify the changes on the appropriate CQ bots. Common try-bots include: linux-rel, mac-rel, win-rel, and chromeos-rel. Example command: git cl try -B luci.chromium.try -b mac-rel. After triggering a try-bot, pause and wait for the human to provide the failure logs. Do not attempt to poll git cl status or download massive raw logs via bb unless explicitly asked.
base::FeatureList) or UMA (base::UmaHistogram*) for non-ChromeOS platforms. Do not introduce these into the codebase unless you are specifically modifying ChromeOS-only code.base/containers/README.md when choosing a container (list, map, etc.).has_value() for boolean testing and * for dereferencing.Our team strongly prefers small, easily reviewable CLs (Changelists).
Before finalizing any task or uploading a CL in //remoting, you MUST trigger an automated self-review to catch common CRD-specific errors.
git cl presubmit -u --force (Linting and presubmit checks).gn check {OUT_DIR} //remoting/* (Headers and dependencies).generalist sub-agent using the invoke_agent tool."You are a senior Chrome Remote Desktop reviewer. Review the following changes [include diff or describe changes]. I have also run the presubmit and gn check commands. Here is their output: [include output]. Your MOST IMPORTANT task is to identify any unintended changes, logical mistakes, or typos. After verifying the core correctness, specifically check for:
- Memory safety in high-privilege processes, particularly preventing Use-After-Free (UAF) errors.
- Platform-specific logic bugs or missing
#if BUILDFLAG(...)guards.- Adherence to the ‘Small CLs’ mandate. Suggest a reasonable split point if the CL is large and a split point is apparent.
- Consider all directives in remoting/GEMINI.md and ensure the CL adheres to them. [include contents of remoting/GEMINI.md]
IMPORTANT: You are the reviewing sub-agent. Do NOT trigger any further sub-agent reviews."
When executing tasks, optimize for total human wall-clock time rather than just the fastest individual command execution. Every shell command requires human approval via the CLI, which causes expensive context switches for the developer.
magi-mode skill. This triggers a multi-agent debate to explore security, performance, and maintainability trade-offs before implementation. It features an iterative “Rumination Cycle” with dynamic topology routing (Star to Roundtable) and human escalation for deadlocks.&& whenever logical. For example, instead of running a build and then asking to run a test, combine them: autoninja -C {OUT_DIR} {TARGET} && tools/autotest.py....wait_for_previous: false parameter in tool calls to perform independent reads or searches in parallel within a single turn.IMPORTANT: When making suggestions for CRD code changes, make sure they are actually relevant to CRD. For example, code changes outside of //remoting usually aren't relevant.
//remoting contains legacy code (10+ years old) that may not align with modern Chromium standards or may duplicate functionality now available in //base.
/remoting/base utility that could be replaced by a standard //base equivalent, flag it to the human in the chat.TODO comments for code health improvements unless explicitly asked by the human.To maintain context efficiency, this root GEMINI.md MUST remain lean. It should only contain critical safety rules, high-level workflow mandates, and routing pointers.
If you discover a complex architectural pattern, a non-obvious dependency, or a critical threading constraint (especially one that differs from standard Chromium conventions):
docs/ directory (e.g., docs/audio.md, docs/style.md).## Relevant Documentation section at the top of this file, instructing future agents on when to load it.//remoting, create a new GEMINI.md file in that sub-directory or update the existing one. Focus on “Why” and “Architecture,” not “What.”Whenever you make any code or build changes in //remoting, you MUST run the following:
git cl format to ensure all changes follow Chromium style.gn check {OUT_DIR} //remoting/* to ensure no circular or missing dependencies were introduced.remoting_unittests to verify your changes. You can use tools/autotest.py --run-all -C {OUT_DIR} remoting/ to run all tests in the remoting directory.git cl presubmit -u --force after you have finished all other validation steps.remoting_all: Build everything related to remoting.remoting_unittests: Run remoting unit tests.remoting_dev_me2me_host: Build a set of targets for running the host locally.remoting_me2me_host: The Me2Me host binary.remoting_native_messaging_host: Native Messaging host for Me2Me.remote_assistance_host: Native Messaging host for It2Me.