﻿---
title: "Computer Use 结束后检查残留的无头 Chrome"
summary: "桌面应用的浏览器 / Playwright 会话关掉后，无头 Chrome 和工作进程有时不会退出，macOS 上还会把 replayd 打满。"
category: debug
level: intermediate
surfaces: [app, cli]
tags: ["Playwright", "Chrome", "MCP", "排错"]
canonical: /tips/cleanup-playwright-chrome/
---

# Computer Use 结束后检查残留的无头 Chrome

桌面应用的浏览器 / Playwright 会话关掉后，无头 Chrome 和工作进程有时不会退出，macOS 上还会把 replayd 打满。

用过内置 Browser、Computer Use，或把 `@playwright/mcp` 配成 STDIO MCP 之后，如果风扇狂转、普通 Chrome 打不开、内存莫名涨到十几 GB，先看是不是残留进程：

- Activity Monitor 里搜 `Chrome`、`playwright`、`codex app-server`
- 命令行带 `--headless`、`--remote-debugging-pipe`、`playwright_chromiumdev_profile-` 的，多半是 Codex 拉起来的
- macOS 上 `replayd` 长期 100%+ CPU，通常是这些无头窗口还在占屏幕采集

先完全退出 ChatGPT / Codex 桌面应用（含后台 `ChatGPT.exe` / `app-server`），再看残留是否消失。不要一上来 `pkill -9 -f codex`：它会把还在跑的 app-server 和 MCP 一起杀掉，下次启动更脏。

子代理会给每个孩子再拉一套 MCP 进程。浏览器类 MCP 尽量不要 `required = true` 地挂在全局，用完关掉对应服务器，或把 Playwright 留在隔离 worktree / 一次性会话。升级到当前桌面应用后再复查 changelog。

## 来源

- [openai/codex #28352](https://github.com/openai/codex/issues/28352)
- [openai/codex #39031](https://github.com/openai/codex/issues/39031)
